File tree Expand file tree Collapse file tree
src/Arch.Unity/Assets/Arch.Unity/Runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+
13namespace Arch . Unity . Conversion
24{
3- public readonly struct GameObjectDisabled { }
5+ public readonly struct GameObjectDisabled : IEquatable < GameObjectDisabled >
6+ {
7+ public bool Equals ( GameObjectDisabled other ) => true ;
8+ public override bool Equals ( object obj ) => obj is GameObjectDisabled ;
9+ public override int GetHashCode ( ) => 0 ;
10+ public override string ToString ( ) => "()" ;
11+ }
412}
Original file line number Diff line number Diff line change 1+ using System ;
12using UnityEngine ;
23
34namespace Arch . Unity . Conversion
45{
5- public readonly struct GameObjectReference
6+ public readonly struct GameObjectReference : IEquatable < GameObjectReference >
67 {
78 public GameObjectReference ( GameObject gameObject )
89 {
910 this . GameObject = gameObject ;
1011 }
1112
1213 public readonly GameObject GameObject ;
14+
15+ public bool Equals ( GameObjectReference other )
16+ {
17+ return other . GameObject == GameObject ;
18+ }
19+
20+ public override bool Equals ( object obj )
21+ {
22+ if ( obj is GameObjectReference reference ) return Equals ( reference ) ;
23+ return false ;
24+ }
25+
26+ public override int GetHashCode ( )
27+ {
28+ return GameObject . GetHashCode ( ) ;
29+ }
1330 }
1431}
Original file line number Diff line number Diff line change 1+ using System ;
2+
13namespace Arch . Unity . Toolkit
24{
3- public struct SystemState
5+ public struct SystemState : IEquatable < SystemState >
46 {
57 public float DeltaTime ;
68 public double Time ;
9+
10+ public readonly bool Equals ( SystemState other )
11+ {
12+ return other . DeltaTime == DeltaTime && other . Time == Time ;
13+ }
14+
15+ public override readonly bool Equals ( object obj )
16+ {
17+ if ( obj is SystemState state ) return Equals ( state ) ;
18+ return false ;
19+ }
20+
21+ public override readonly int GetHashCode ( )
22+ {
23+ return HashCode . Combine ( DeltaTime , Time ) ;
24+ }
725 }
826}
You can’t perform that action at this time.
0 commit comments