namespace LeMangeurDEnfants.Core
{
    public enum Direction
    {
        Left, Up, Right, Down
    }

    public static class DirectionExt
    {
        public static bool IsHorizontal(this Direction direction)
            => direction == Direction.Left || direction == Direction.Right;

        public static Direction GetOpposite(this Direction direction)
        {
            switch (direction)
            {
                case Direction.Left: return Direction.Right;
                case Direction.Up: return Direction.Down;
                case Direction.Right: return Direction.Left;
                case Direction.Down: return Direction.Up;
            }
            return default;
        }
    }
}