comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -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;
}