public void SetPlayerMove(PlayerMove i_PlayerMove) { CheckersMen FromSlotContent = r_Board[i_PlayerMove.FromSlotKey].Content.Value; r_Board[i_PlayerMove.FromSlotKey].Clear(); r_Board[i_PlayerMove.ToSlotKey].Content = FromSlotContent; if (i_PlayerMove.Type == PlayerMove.eMoveType.Eat) { r_Board[i_PlayerMove.SlotKeyToEat].Clear(); } }
private void checkIfPlayerMoveToEnemyBaseLine(PlayerMove i_PlayerMove) { CheckersBoard.GetRowAndColumnFromKey(i_PlayerMove.ToSlotKey, out char toRowKeyPlayerMove, out char toColumnKeyPlayerMove); if (toRowKeyPlayerMove == m_PlayerEnemy.BaseLineRowKey) { CheckersMen slotContent = m_Board[i_PlayerMove.ToSlotKey].Content.Value; if (slotContent.Type == CheckersMen.eType.Regular) { setKing(i_PlayerMove.ToSlotKey); } } }
public Player(string i_Name, eType i_Type, CheckersMen.eSign i_RegularSign, CheckersMen.eSign i_KingSign, char i_BaseLineRowKey, int i_m_AmountOfMenOnBoard) { r_Name = i_Name; r_Type = i_Type; r_RegularCheckersMen = new CheckersMen(i_RegularSign); r_KingCheckersMen = new CheckersMen(i_KingSign); r_PossibleMoves = new List <PlayerMove>(0); r_LastMovesPlayed = new List <PlayerMove>(0); r_RandomNumberGenerator = new Random(); m_CanEatAgain = false; r_BaseLineRowKey = i_BaseLineRowKey; m_AmountOfMenOnBoard = i_m_AmountOfMenOnBoard; m_Score = 0; if (i_RegularSign == CheckersMen.eSign.O) { r_Direction = new Direction(1, -1, 1, -1); } else { r_Direction = new Direction(-1, 1, -1, 1); } }