public StandardTwoPlayerEngine(IRenderer renderer, IInputProvider inputProvider) { this.renderer = renderer; this.input = inputProvider; this.movementStrategy = new NormalMovementStrategy(); this.board = new Board(); this.players = new List <IPlayer>(); this.movedFigures = new MovedFigures(); }
private bool Path(IBoard board, IPlayer player, bool check) { int availableMoves = MovedFigures.GetAvailableMoves(board, player); if (check == false && availableMoves == 0) { return(true); } return(false); }
private bool CheckCheckmate(IBoard board, IPlayer player) { int availableMoves = MovedFigures.GetAvailableMoves(board, player); if (availableMoves == 0) { return(true); } return(false); }
private bool CheckIfPlayerIsInCheck(IBoard board, IPlayer player) { bool check = false; if (MovedFigures.IsFieldAttacked(board, board.GetFigurePostionByTypeAndColor("King", player.Color), player.Color)) { check = true; } else { check = false; } return(check); }