예제 #1
0
 public override void PlayerAttacked(BasePlayer player, Point from, Point to, GamePieceType piece, AttackResult result)
 {
     EstimatedState[from.x, from.y] = null;
     if (result == AttackResult.Win)
     {
         if (player != this)
         {
             EstimatedState[to.x, to.y] = GamePieceFactory.Create(piece, !this.IsRed);
         }
     }
     else if (result == AttackResult.Tie)
     {
         EstimatedState[to.x, to.y] = null;
     }
     else if (result == AttackResult.Lose)
     {
         if (player == this)
         {
             EstimatedState[to.x, to.y] = GamePieceFactory.Create(piece, !this.IsRed);
         }
     }
 }
예제 #2
0
 public abstract void PlayerMoved(BasePlayer player, Point from, Point to);
예제 #3
0
 public abstract void PlayerAttacked(BasePlayer player, Point from, Point to, GamePieceType piece, AttackResult result);
예제 #4
0
 public override void PlayerMoved(BasePlayer player, Point from, Point to)
 {
     EstimatedState[to.x, to.y] = EstimatedState[from.x, from.y];
     EstimatedState[from.x, from.y] = null;
 }
예제 #5
0
파일: Game1.cs 프로젝트: smelch/Stratego
 private void StartNewGame()
 {
     playerIsRed = true;
     stratego = new StrategoGame();
     Red = playerFactory.Create(playerTypes[playerSelectionRed], stratego, PlayerTurn.Red);
     Blue = playerFactory.Create(playerTypes[playerSelectionBlue], stratego, PlayerTurn.Blue);
     stratego.Red = Red;
     stratego.Blue = Blue;
     Red.PlacePieces();
     Blue.PlacePieces();
     stratego.EndSetup();
 }