File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public Cardinal(int val)
3636 public bool Horizontal => Value % 2 == 0 ;
3737 public bool Vertical => Value % 2 == 1 ;
3838 public Point2 Point => new ( X , Y ) ;
39+ public Vector2 Normal => new ( X , Y ) ;
3940
4041 public int X => Value switch
4142 {
@@ -63,6 +64,7 @@ public Cardinal(int val)
6364 _ => throw new Exception ( )
6465 } ;
6566
67+ public static implicit operator Cardinal ( int val ) => new ( val ) ;
6668 public static implicit operator Cardinal ( Facing f ) => f . Sign > 0 ? Right : Left ;
6769 public static implicit operator Point2 ( Cardinal c ) => c . Point ;
6870 public static bool operator == ( Cardinal a , Cardinal b ) => a . Value == b . Value ;
Original file line number Diff line number Diff line change @@ -90,6 +90,12 @@ public static bool HasAllFlags(this uint flags, uint check)
9090 public static bool HasAnyFlags ( this uint flags , uint check )
9191 => ( flags & check ) != 0 ;
9292
93+ public static bool HasAllFlags ( this ulong flags , ulong check )
94+ => ( flags & check ) == check ;
95+
96+ public static bool HasAnyFlags ( this ulong flags , ulong check )
97+ => ( flags & check ) != 0 ;
98+
9399 public static float Avg ( float a , float b )
94100 => a + ( b - a ) * .5f ;
95101
You can’t perform that action at this time.
0 commit comments