コード例 #1
0
 public DangerGameState(SpaceShipContext ctx)
 {
     Console.WriteLine($"Your in the danger zone you only have {ctx.HitPoints} hit points");
     this.ctx = ctx;
 }
コード例 #2
0
 public LostGameState(SpaceShipContext ctx)
 {
     Console.WriteLine($"Game is lost!");
     this.ctx = ctx;
 }
コード例 #3
0
 public WonGameState(SpaceShipContext ctx)
 {
     Console.WriteLine("You won the game!");
     this.ctx = ctx;
 }
コード例 #4
0
 public NewShip(SpaceShipContext context)
 {
     Console.WriteLine($"Welcome to stage: {ctx.currentStage} You have {ctx.HitPoints} hit points left");
     this.ctx = context;
 }