using System.ComponentModel; namespace StardustCore.Enums { /// A custom class used to wrap Stardew Valley's direction conventions. public class Directions { /// An enum used to wrap directions. public enum Direction { [Description("Up")] up, [Description("Right")] right, [Description("Down")] down, [Description("Left")] left } /// Get the up direction. public static Direction GetUp() { return Direction.up; } /// Get the down direction. public static Direction GetDown() { return Direction.down; } /// Get the left direction. public static Direction GetLeft() { return Direction.left; } /// Get the right dirction. public static Direction GetRight() { return Direction.right; } /// Converts a direction into it's stardew valley direction equivelent. /// public static int DirectionToInt(Direction dir) { return (int)dir; } /// Get's the direction's enum description so we can convert this to a string. public static string getString(Direction dir) { return dir.GetEnumDescription(); } } }