Example #1
0
        private void SelectStrategy(ShipMovement movement)
        {
            switch (movement)
            {
            case ShipMovement.None:
                strategy = new EmptyShipMovementStrategy(this);
                break;

            case ShipMovement.Horizontal:
                strategy = new HorizontalShipMovementStrategy(this);
                break;

            case ShipMovement.Vertical:
                strategy = new VerticalShipMovementStrategy(this);
                break;
            }
        }
Example #2
0
 internal void SetStrategy(ShipMovement movement = ShipMovement.None)
 {
     strategy = new EmptyShipMovementStrategy(this);
     ;
 }