Exemple #1
0
 public override void NextState(ShipStatusBase shipStatusBase)
 {
     this.ctx.shipState = shipStatusBase;
     if (steps == 3 && this.ctx.shipState.getShipStatus() == "Fixed")
     {
         this.ctx.gameState = new Win(this.ctx);
     }
     else if (this.ctx.shipState.getShipStatus() == "Danger")
     {
         this.ctx.gameState = new Lose(this.ctx);
     }
     else
     {
         this.steps++;
     }
 }
Exemple #2
0
 public override void NextState(ShipStatusBase shipStatusBase)
 {
     System.Console.WriteLine("You won!");
 }