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