Example #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);
         }
     }
 }
Example #2
0
 public abstract void PlayerMoved(BasePlayer player, Point from, Point to);
Example #3
0
 public abstract void PlayerAttacked(BasePlayer player, Point from, Point to, GamePieceType piece, AttackResult result);
Example #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;
 }
Example #5
0
 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();
 }