162
|
1 using System;
|
|
2
|
|
3 namespace Implab.Automaton {
|
166
|
4 public struct AutomatonTransition : IEquatable<AutomatonTransition> {
|
162
|
5 public readonly int s1;
|
|
6 public readonly int s2;
|
|
7 public readonly int edge;
|
|
8
|
|
9 public AutomatonTransition(int s1, int s2, int edge) {
|
|
10 this.s1 = s1;
|
|
11 this.s2 = s2;
|
|
12 this.edge = edge;
|
|
13 }
|
|
14
|
|
15
|
|
16 #region IEquatable implementation
|
|
17 public bool Equals(AutomatonTransition other) {
|
|
18 return other.s1 == s1 && other.s2 == s2 && other.edge == edge ;
|
|
19 }
|
|
20 #endregion
|
|
21
|
|
22 public override bool Equals(object obj) {
|
|
23 if (obj is AutomatonTransition)
|
|
24 return Equals((AutomatonTransition)obj);
|
|
25 return base.Equals(obj);
|
|
26 }
|
|
27
|
|
28 public override int GetHashCode() {
|
|
29 return s1 + s2 + edge;
|
|
30 }
|
|
31 }
|
|
32 }
|
|
33
|