Example #1
0
 public ObjectOrientation(ObjectHorizontalVector horizontal, ObjectVerticalVector vertical)
 {
     Name = (horizontal, vertical) switch
     {
         (ObjectHorizontalVector.Left, ObjectVerticalVector.Down) => ObjectOrientationName.DownLeft,
         (ObjectHorizontalVector.Left, ObjectVerticalVector.Neutral) => ObjectOrientationName.Left,
         (ObjectHorizontalVector.Left, ObjectVerticalVector.Up) => ObjectOrientationName.UpLeft,
         (ObjectHorizontalVector.Neutral, ObjectVerticalVector.Down) => ObjectOrientationName.Down,
         (ObjectHorizontalVector.Neutral, ObjectVerticalVector.Up) => ObjectOrientationName.Up,
         (ObjectHorizontalVector.Right, ObjectVerticalVector.Down) => ObjectOrientationName.DownRight,
         (ObjectHorizontalVector.Right, ObjectVerticalVector.Neutral) => ObjectOrientationName.Right,
         (ObjectHorizontalVector.Right, ObjectVerticalVector.Up) => ObjectOrientationName.UpRight,
         _ => throw new ArgumentOutOfRangeException()
     };
 }
Example #2
0
 public ObjectOrientation(ObjectOrientationName name)
 {
     Name = name;
 }