BadScript 2
Loading...
Searching...
No Matches
MethodModel.cs
Go to the documentation of this file.
1using System;
2
4
5public readonly struct MethodModel : IEquatable<MethodModel>
6{
7 public readonly string MethodName;
8 public readonly string ApiMethodName;
9 public readonly string ReturnType;
10 public readonly string ReturnDescription;
11 public readonly string Description;
12 public readonly bool IsVoidReturn;
13 public readonly ParameterModel[] Parameters;
14 public readonly bool AllowNativeReturn;
15
17 string methodName,
18 string apiMethodName,
19 string returnType,
20 string description,
21 ParameterModel[] parameters,
22 bool isVoidReturn,
23 string returnDescription,
24 bool allowNativeReturn)
25 {
26 MethodName = methodName;
27 ApiMethodName = apiMethodName;
28 ReturnType = returnType;
29 Description = description;
30 Parameters = parameters;
31 IsVoidReturn = isVoidReturn;
32 ReturnDescription = returnDescription;
33 AllowNativeReturn = allowNativeReturn;
34 }
35
36 public bool Equals(MethodModel other)
37 {
38 return MethodName == other.MethodName &&
39 ApiMethodName == other.ApiMethodName &&
40 ReturnType == other.ReturnType &&
41 ReturnDescription == other.ReturnDescription &&
42 Description == other.Description &&
43 IsVoidReturn == other.IsVoidReturn &&
46 }
47
48 public override bool Equals(object? obj)
49 {
50 return obj is MethodModel other && Equals(other);
51 }
52
53 public override int GetHashCode()
54 {
55 unchecked
56 {
57 int hashCode = MethodName.GetHashCode();
58 hashCode = hashCode * 397 ^ ApiMethodName.GetHashCode();
59 hashCode = hashCode * 397 ^ ReturnType.GetHashCode();
60 hashCode = hashCode * 397 ^ ReturnDescription.GetHashCode();
61 hashCode = hashCode * 397 ^ Description.GetHashCode();
62 hashCode = hashCode * 397 ^ IsVoidReturn.GetHashCode();
63 hashCode = hashCode * 397 ^ Parameters.GetHashCode();
64 hashCode = hashCode * 397 ^ AllowNativeReturn.GetHashCode();
65
66 return hashCode;
67 }
68 }
69
70 public static bool operator ==(MethodModel left, MethodModel right)
71 {
72 return left.Equals(right);
73 }
74
75 public static bool operator !=(MethodModel left, MethodModel right)
76 {
77 return !left.Equals(right);
78 }
79}
MethodModel(string methodName, string apiMethodName, string returnType, string description, ParameterModel[] parameters, bool isVoidReturn, string returnDescription, bool allowNativeReturn)
static bool operator==(MethodModel left, MethodModel right)
static bool operator!=(MethodModel left, MethodModel right)