comment pass
This commit is contained in:
@@ -14,12 +14,24 @@ namespace EscapeRoomEngine.Engine.Runtime
|
||||
Orientation.North, Orientation.East, Orientation.South, Orientation.West
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Return the orientation corresponding to an angle, starting at 0 degrees North and going clockwise around the compass.
|
||||
/// </summary>
|
||||
public static Orientation FromAngle(int angle) => (Orientation)angle;
|
||||
|
||||
/// <summary>
|
||||
/// Turn an orientation into its corresponding angle.
|
||||
/// </summary>
|
||||
public static float Angle(this Orientation orientation) => (float)orientation;
|
||||
|
||||
/// <summary>
|
||||
/// Turn an orientation into its corresponding angle.
|
||||
/// </summary>
|
||||
public static int AngleInt(this Orientation orientation) => (int)orientation;
|
||||
|
||||
/// <summary>
|
||||
/// Rotate an orientation by a specific amount of quarter rotations. Rotating <c>East</c> thrice would return <c>North</c>.
|
||||
/// </summary>
|
||||
public static Orientation Rotated(this Orientation orientation, int quarterRotations) =>
|
||||
orientation + quarterRotations * 90;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user