コード例 #1
0
ファイル: Game.cs プロジェクト: tamirshaul/DP140719
 public void NextStage()
 {
     stage++;
     if (stage >= 4)
     {
         currentState = new GameEndedWin();
     }
     else
     {
         currentState = new ShipOK();
     }
     currentState.State();
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: tamirshaul/DP140719
        public void Hit()
        {
            ShipCollisionPoints--;
            if (ShipCollisionPoints <= 0)
            {
                currentState = new GameEndedLost();
            }
            else if (ShipCollisionPoints <= 10)
            {
                currentState = new ShipAtRisk();
            }
            else
            {
                currentState = new ShipOK();
            }

            currentState.State();
        }