/* Takes a move object and a chess board object and returns true if the tile on the B position of the move is empty. */ private bool IsMoveBEmpty(FormedMove move, ChessPosition cpm, ref Tile tileB) { tileB = cpm.Board[move.PosB.Item1, move.PosB.Item2]; return tileB.IsEmpty(); }
/* Takes a move object and a chess board object and returns true if the piece on the B position of the move belongs to the other player. TODO: replace with alternate call to previous functions*/ private bool IsMoveBPieceOtherPlayer(FormedMove move, ChessPosition cpm, ref Tile tileB) { bool result = false; tileB = cpm.Board[move.PosB.Item1, move.PosB.Item2]; if (!tileB.IsEmpty()) if (!cpm.Player.Owns(tileB.piece)) result = true; return result; }
/* Takes a move object and a chess board object and returns true if the piece on the A position of the move belongs to the current player. */ private bool IsMoveAPieceCurPlayer(FormedMove move, ChessPosition cpm, ref Tile tileA) { bool result = false; tileA = cpm.Board[move.PosA.Item1, move.PosA.Item2]; if (!tileA.IsEmpty()) if (cpm.Player.Owns(tileA.piece)) result = true; return result; }