public GameBoard(GameRules rules) { GameRules = rules; BoardSize = GameConstants.boardSize; Board = new int[BoardSize, BoardSize]; InitBoard(); }
//public List<Tuple<int, int>> posibleMoves = new List<Tuple<int, int>>(); public GameManager() { GameRules = new GameRules(); GameBoard = new GameBoard(GameRules); GameHistory = new Stack <List <int> >(1000); RedoStack = new Stack <List <int> >(1000); GameInProgress = false; Input = ""; }
public int CheckKingSiege(GameBoard board, int row, int col) { int sieged = 0; List <List <int> > adjacted = GameRules.Adjacted(row, col, board); foreach (List <int> position in adjacted) { if (board.Enemy(row, col, position[0], position[1]) && !board.IsKing(position[0], position[1])) { sieged = 20; } } return(sieged); }
public int KingHunting(GameBoard board, int row, int col) { int hunt = 0; List <List <int> > adjacted = GameRules.Adjacted(row, col, board); foreach (List <int> position in adjacted) { if (board.Enemy(row, col, position[0], position[1]) && board.IsKing(position[0], position[1])) { hunt += 2; } } return(hunt); }
private void CheckEndGame() { if (GameRules.EGFrozenKings(GameBoard)) { GameStatus = "draw"; Console.WriteLine("Frozen Kings."); EndGame(); } if (GameRules.EGRoyalLine(GameBoard)) { GameStatus = Enum.ToObject(typeof(PlayerColor), PlayerOnTurn.PlayerColor).ToString() + " Player Win!"; Console.WriteLine("King on Royal Line."); EndGame(); } if (GameRules.EGEnemyBlocked(GameBoard, PlayerOnTurn)) { GameStatus = Enum.ToObject(typeof(PlayerColor), PlayerOnTurn.PlayerColor).ToString() + " Player Win!"; Console.WriteLine("Enemy Blocked."); EndGame(); } }
public BrainAI() { Min = GameConstants.min; Max = GameConstants.max; Rules = new GameRules(); }