public static class SideAndCornerExtensions { public static (Corner, Corner) GetCorners(this Side side) => side switch { Side.Left => (Corner.TopLeft, Corner.BottomLeft), Side.Top => (Corner.TopLeft, Corner.TopRight), Side.Right => (Corner.TopRight, Corner.BottomRight), Side.Bottom => (Corner.BottomLeft, Corner.BottomRight), _ => throw new ArgumentException($"Invalid Side value '{side}'", nameof(side)), }; public static Side GetOpposite(this Side side) => side switch { Side.Left => Side.Right, Side.Top => Side.Bottom, Side.Right => Side.Left, Side.Bottom => Side.Top, _ => throw new ArgumentException($"Invalid Side value '{side}'", nameof(side)), }; public static Corner GetOpposite(this Corner corner) => corner switch { Corner.TopLeft => Corner.BottomRight, Corner.TopRight => Corner.BottomLeft, Corner.BottomRight => Corner.TopLeft, Corner.BottomLeft => Corner.TopRight, _ => throw new ArgumentException($"Invalid Corner value '{corner}'", nameof(corner)), }; }