Esempio n. 1
0
 public void NextStage()
 {
     stage++;
     if (stage >= 4)
     {
         currentState = new GameEndedWin();
     }
     else
     {
         currentState = new ShipOK();
     }
     currentState.State();
 }
Esempio n. 2
0
        public void Hit()
        {
            ShipCollisionPoints--;
            if (ShipCollisionPoints <= 0)
            {
                currentState = new GameEndedLost();
            }
            else if (ShipCollisionPoints <= 10)
            {
                currentState = new ShipAtRisk();
            }
            else
            {
                currentState = new ShipOK();
            }

            currentState.State();
        }