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
16 public MethodModel(string methodName,
17 string apiMethodName,
18 string returnType,
19 string description,
20 ParameterModel[] parameters,
21 bool isVoidReturn,
22 string returnDescription,
23 bool allowNativeReturn)
24 {
25 MethodName = methodName;
26 ApiMethodName = apiMethodName;
27 ReturnType = returnType;
28 Description = description;
29 Parameters = parameters;
30 IsVoidReturn = isVoidReturn;
31 ReturnDescription = returnDescription;
32 AllowNativeReturn = allowNativeReturn;
33 }
34
35 public bool Equals(MethodModel other)
36 {
37 return MethodName == other.MethodName &&
38 ApiMethodName == other.ApiMethodName &&
39 ReturnType == other.ReturnType &&
40 ReturnDescription == other.ReturnDescription &&
41 Description == other.Description &&
42 IsVoidReturn == other.IsVoidReturn &&
45 }
46
47 public override bool Equals(object? obj)
48 {
49 return obj is MethodModel other && Equals(other);
50 }
51
52 public override int GetHashCode()
53 {
54 unchecked
55 {
56 int hashCode = MethodName.GetHashCode();
57 hashCode = (hashCode * 397) ^ ApiMethodName.GetHashCode();
58 hashCode = (hashCode * 397) ^ ReturnType.GetHashCode();
59 hashCode = (hashCode * 397) ^ ReturnDescription.GetHashCode();
60 hashCode = (hashCode * 397) ^ Description.GetHashCode();
61 hashCode = (hashCode * 397) ^ IsVoidReturn.GetHashCode();
62 hashCode = (hashCode * 397) ^ Parameters.GetHashCode();
63 hashCode = (hashCode * 397) ^ AllowNativeReturn.GetHashCode();
64
65 return hashCode;
66 }
67 }
68
69 public static bool operator ==(MethodModel left, MethodModel right)
70 {
71 return left.Equals(right);
72 }
73
74 public static bool operator !=(MethodModel left, MethodModel right)
75 {
76 return !left.Equals(right);
77 }
78}
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)