Ejemplo n.º 1
0
        internal static GameConstants.Direction8 ConvertToDirection8(GameConstants.Direction4 direction)
        {
            switch (direction)
            {
            case GameConstants.Direction4.Up:
                return(GameConstants.Direction8.Up);

            case GameConstants.Direction4.Right:
                return(GameConstants.Direction8.Right);

            case GameConstants.Direction4.Down:
                return(GameConstants.Direction8.Down);

            case GameConstants.Direction4.Left:
                return(GameConstants.Direction8.Left);

            default: throw new ArgumentException("Invalid Direction4 value received for conversion.");
            }
        }
Ejemplo n.º 2
0
 internal static Point GetNewPointFrom(GameConstants.Direction4 direction, Point fromPoint)
 {
     return(GetNewPointFrom(ConvertToDirection8(direction), fromPoint));
 }