public PlayerInfo(string sName, ePlayerType eType, eDifficulty eDifficulty) { nID = PlayerCnt++; this.sName = sName; this.eType = eType; this.eDifficulty = eDifficulty; }
private void handleDeadPlayer(IUpdateGameManager i_UpdatesGameManager, ePlayerType i_PlayerType) { IPlayer playerToRemove = null; i_UpdatesGameManager.ScoreChanged -= updatesGameManager_ScoreChanged; i_UpdatesGameManager.GameOver -= updatesGameManager_GameOver; i_UpdatesGameManager.PlayerDown -= updatesGameManager_PlayerDown; if (m_CurrentAlivePlayers == 1) { m_Players[0].IsDead = true; handleGameOverSituation(); } foreach (IPlayer player in m_Players) { if (player.PlayerType == i_PlayerType) { playerToRemove = player; player.IsDead = true; break; } } m_CurrentAlivePlayers--; }
public BasePlayer(ePlayerType type, int onBoardPieces = 15, int eatenPieces = 0, bool readyToClear = false) { Type = type; OnBoardPieces = onBoardPieces; EatenPieces = eatenPieces; ReadyToClear = readyToClear; }
public Player(string i_Name, ePlayerType i_Type, bool i_IsPlayersTurn) { this.m_PlayerName = i_Name; this.m_Points = 0; this.m_IsMyTurn = i_IsPlayersTurn; this.m_PlayerType = i_Type; }
GameObject CreatePlayer(ePlayerType type) { GameObject go = null; switch (type) { case ePlayerType.None: break; case ePlayerType.Programmer: go = Instantiate(m_CloneProgrammer); break; case ePlayerType.Planner: go = Instantiate(m_ClonePlanner); break; case ePlayerType.Artist: go = Instantiate(m_CloneArtist); break; case ePlayerType.Boss: go = Instantiate(m_CloneBoss); break; default: break; } return(go); }
public Player(ePlayerType i_PlayerType, eSign i_Sign, string i_PlayerName) { m_PlayerType = i_PlayerType; m_Sign = i_Sign; m_PlayerName = i_PlayerName; m_NumOfTokens = 0; }
public ePlayerType GetPlayerType() { printMessage(Strings.ChoosePlayer); string userInput = getInputFromUser().ToLower(); bool validPlayerType = false; ePlayerType choosenPlayerType = ePlayerType.Human; while (!validPlayerType) { if (userInput == k_ComputerSymbol.ToString()) { choosenPlayerType = ePlayerType.Computer; validPlayerType = true; } else if (userInput == k_HumenSymbol.ToString()) { choosenPlayerType = ePlayerType.Human; validPlayerType = true; } else { printMessage(Strings.InvalidPlayerType); userInput = getInputFromUser(); } } return(choosenPlayerType); }
private bool checkValidInput(string i_ChoiceStr, ePlayerType i_PlayerType) { bool isValid = true; int chosenRow, chosenCol; if (i_ChoiceStr[0] == 'Q' && i_ChoiceStr.Length == 1) { Environment.Exit(1); } strInputToIndexes(i_ChoiceStr, out chosenRow, out chosenCol); if (i_PlayerType != ePlayerType.computer) { checkRange(chosenRow, chosenCol, ref isValid); if (isValid) { if (checkBoardCellState(chosenRow, chosenCol)) { Console.WriteLine("This cell is already open! please choose again:"); isValid = false; } } } else { isValid = !checkBoardCellState(chosenRow, chosenCol); } return(isValid); }
private void passTurn(ref ePlayerType i_PlayerType) { switch (i_PlayerType) { case ePlayerType.playerOne: if (m_SecondPlayer == null) { i_PlayerType = ePlayerType.computer; } else { i_PlayerType = ePlayerType.playerTwo; } break; case ePlayerType.playerTwo: i_PlayerType = ePlayerType.playerOne; break; case ePlayerType.computer: i_PlayerType = ePlayerType.playerOne; break; } }
public void AddGameScore( int i_BlackScore, int i_WhiteScore, ePlayerType i_BlackPlayer, ePlayerType i_WhitePlayer) { BlackScore += i_BlackScore; WhiteScore += i_WhiteScore; if (i_BlackScore > i_WhiteScore) { BlackWins++; } else if (i_BlackScore < i_WhiteScore) { WhiteWins++; } else { BnWDraws++; } if ((i_BlackPlayer == ePlayerType.Human || i_WhitePlayer == ePlayerType.Human) && i_BlackPlayer != i_WhitePlayer) { updateVsComputerWins(i_BlackScore, i_WhiteScore, i_BlackPlayer, i_WhitePlayer); updateVsComputerScore(i_BlackScore, i_WhiteScore, i_BlackPlayer); } }
void initByPlayerType(ePlayerType type) { switch (type) { case ePlayerType.Programmer: Color = eColor.Blue; break; case ePlayerType.Planner: Color = eColor.Yellow; break; case ePlayerType.Artist: Color = eColor.Red; break; case ePlayerType.Boss: Color = eColor.None; break; case ePlayerType.None: break; default: break; } }
public Player(Player i_Other) { this.r_PlayerName = i_Other.r_PlayerName; this.r_PlayerType = i_Other.r_PlayerType; this.r_PlayerNumber = i_Other.r_PlayerNumber; this.r_PlayerColor = i_Other.r_PlayerColor; this.m_PlayerScore = i_Other.m_PlayerScore; }
public Player(string i_PlayerName, ePlayerType i_PlayerType, ePlayerNumber i_PlayerNumber, ePlayerColor i_PlayerColor, int i_PlayerScore = k_InitialScore) { r_PlayerName = i_PlayerName; r_PlayerType = i_PlayerType; r_PlayerNumber = i_PlayerNumber; m_PlayerScore = i_PlayerScore; r_PlayerColor = i_PlayerColor; }
public Player() { m_PlayerName = "Black Player"; m_PlayerType = ePlayerType.Human; m_Score = 0; m_DiskColor = eKindOfCell.Black; m_AvailableMovesForPlayer = new List <PickedCell>(); }
public Player(string i_Name) { m_Name = i_Name; if (i_Name != "COMPUTER") { e_PlayerType = ePlayerType.Person; } }
public Player() { m_PlayerName = "Black Player"; m_PlayerType = ePlayerType.Human; m_Score = 0; m_DiskColor = eKindOfCell.Black; m_AvailableMovesForPlayer = new List<PickedCell>(); }
// Methods internal Player(ePlayerID i_ID, ePlayerType i_Type, string i_Name, int i_NumberOfPawns) { m_ID = i_ID; m_Type = i_Type; m_Name = i_Name; m_PawnList = new List <Pawn>(i_NumberOfPawns); m_LegalJumpList = new List <LegalJump>(); }
internal Player(eShapeType shape, string PlayerName, ePlayerType i_PlayerType) { this.m_Shape = shape; this.m_PlayerName = PlayerName; v_JumpTurn = false; this.m_PlayerType = i_PlayerType; this.m_Points = 0; }
public FourInARowLogic(int i_BoradLength, int i_BoradWidth, ePlayerType player1Type, ePlayerType player2Type) { m_RowsNumber = i_BoradLength; m_ColsNumber = i_BoradWidth; m_Player1 = new Player(player1Type); m_Player2 = new Player(player2Type); m_BoardMatrix = new eBoardSign [i_BoradLength, i_BoradWidth]; }
Vector3 GetBirtPositionByPlayerType(ePlayerType type) { Vector3 pos = Vector3.zero; m_posDic.TryGetValue(type, out pos); return(pos); }
public Player(eShapeType i_Shape, string i_PlayerName, ePlayerType i_PlayerType) { this.m_Shape = i_Shape; this.m_PlayerName = i_PlayerName; v_JumpTurn = false; this.m_PlayerType = i_PlayerType; this.m_Points = 0; }
public Player(string i_Name, eDirection i_Direction, ePlayerType i_Type, byte i_NumberOfTools, char i_ToolsSign) { m_Name = i_Name; m_Direction = i_Direction; m_Type = i_Type; m_Tools = new Tool[i_NumberOfTools]; m_ToolsSign = i_ToolsSign; }
public PlayerSouls(Game i_Game, Color i_TintColor, ePlayerType i_PlayerType, int i_Index) : base(i_Game, k_AssetName) { AssetName = k_AssetName; TintColor = i_TintColor; m_PlayerType = i_PlayerType; m_Index = i_Index; Scales = new Vector2(0.5f); }
public Player(string i_name, ePlayerType i_TypeOfPlayer, int i_Score, eSquareType i_PieceSymbol, eSquareType i_KingSymbol, bool i_MovesDown) { this.m_Name = i_name; this.m_Score = i_Score; this.m_TypeOfPlayer = i_TypeOfPlayer; this.m_PieceSymbol = i_PieceSymbol; this.m_KingSymbol = i_KingSymbol; this.m_MovesDown = i_MovesDown; }
public Player(ePlayerType i_PlayerType, Square.ePlayerColor i_PlayerColor, string i_Name, int i_Score) { m_PlayerType = i_PlayerType; m_PlayerColor = i_PlayerColor; m_Name = i_Name; m_Score = i_Score; m_PlayerSquares = new List <Square>(); m_PlayerRegularMoves = new List <Move>(); m_PlayerSkippingMoves = new List <Move>(); }
public Player(ePlayerType i_Type = ePlayerType.Computer) { if (i_Type == ePlayerType.Computer) { m_Name = "Robot"; } m_Score = 0; m_Type = i_Type; }
public PlayerSoul(Game i_Game, Color i_TintColor, ePlayerType i_PlayerType, int i_Index) : base(i_Game, k_AssetName) { AssetName = k_AssetName; TintColor = i_TintColor; m_PlayerType = i_PlayerType; m_Index = i_Index; LayerDepth = 0.5f; Scales = new Vector2(0.5f); i_Game.Components.Add(this); }
/* * Initial start up of values at game beginning. */ public static void Init() { initPlayers(); initBoard(); // Determine player2 type and act accordingly ePlayerType ePlayerOrPc = getPlayer2Type(); switch (ePlayerOrPc); }
internal Player(string i_PlayerName, ePlayerType i_PlayerType) { r_Name = i_PlayerName; r_Type = i_PlayerType; m_Score = 0; if (i_PlayerType == ePlayerType.Computer) { m_ComputerMemory = new Dictionary <char, GameCell>(); } }
// Constructors: public User(string i_Name, ePlayerType i_PlayerNumber, bool i_IsComputer) { m_Name = i_Name; m_Score = 0; m_CheckersPiece = null; m_PlayerNumber = i_PlayerNumber; m_CheckerPieceKind = i_PlayerNumber == ePlayerType.MainPlayer ? CheckersPiece.ePieceKind.MainPlayerTool : CheckersPiece.ePieceKind.SecondPlayerTool; m_Moves = null; m_CurrentCheckerPiece = null; m_IsComputer = i_IsComputer; }
public static void InitalizeGame(string i_Player1Name, string i_Player2Name, bool i_IsComputer, int i_Rows, int i_Cols) // Initialize the game from start or restart { Board = new BoardManager(i_Rows, i_Cols); if (s_IsTheFirstGame) { Player1 = new Player(i_Player1Name, ePlayerType.Human, ePlayerNumber.Player1); ePlayerType i_OpponentType = i_IsComputer ? ePlayerType.Computer : ePlayerType.Human; Player2 = new Player(i_Player2Name, i_OpponentType, ePlayerNumber.Player2); } CurrentPlayer = Player1; s_IsTheFirstGame = false; }
private void getMove(out int o_Row, out int o_Col, ePlayerType i_PlayerType) { switch (i_PlayerType) { case ePlayerType.computer: getComputerMove(out o_Row, out o_Col, i_PlayerType); break; default: getPlayerMove(out o_Row, out o_Col, i_PlayerType); break; } }
public Player(ePlayerType i_PlayerType, eKindOfCell i_DiskColor) { m_PlayerType = i_PlayerType; m_DiskColor = i_DiskColor; m_Score = 0; m_AvailableMovesForPlayer = new List<PickedCell>(); if (PlayerType == ePlayerType.Human) { m_PlayerName = string.Format("{0} Player", DiskColor.ToString()); } else { m_PlayerName = "Computer"; } }
public static IPlayer createPlayerOfType(ePlayerType i_PlayerType) { IPlayer player = null; switch (i_PlayerType) { case ePlayerType.Human: player = new HumanPlayer(); break; case ePlayerType.DumbComputer: player = new ComputerPlayer(); break; case ePlayerType.OkComputer: player = createSmartPlayerWithSearchDepthOf(0); break; case ePlayerType.SmartComputer: player = createSmartPlayerWithSearchDepthOf(2); break; case ePlayerType.GeniusComputer: player = createSmartPlayerWithSearchDepthOf(4); break; } return player; }
public void SetWhitePlayerAs(ePlayerType i_PlayerType) { }
public void SetBlackPlayerAs(ePlayerType i_PlayerType) { }
private void updatePlayerWins(ePlayerType player) { if (player == ePlayerType.Human) { HumanWins++; } else { ComputerWins++; } }
private void setWhitePlayerAs(ePlayerType i_PlayerType) { CommandCommander.GetInstance().GetCommand(m_WPlayerToCommand[i_PlayerType]).DoCommand(); }
public void SetWhitePlayerAs(ePlayerType i_PlayerType) { var currentPlayerCommand = m_WPlayerToCommand[OthelloData.GetInstance().OthelloOptions.WhitePlayer]; CommandCommander.GetInstance().GetCommand(currentPlayerCommand).Checked = false; CommandCommander.GetInstance().GetCommand(m_WPlayerToCommand[i_PlayerType]).Checked = true; OthelloData.GetInstance().OthelloOptions.WhitePlayer = i_PlayerType; r_BoardController.UpdatePlayers(); }
// C'tor public Player(string i_Name, ePlayerType i_PlayerType, Coin.eCoinType i_CoinType) { this.m_Name = i_Name; this.m_PlayerType = i_PlayerType; this.m_PlayerCoinType = i_CoinType; }
public Player(string i_Name, ePlayerType i_PlayerType) { m_Name = i_Name; m_Type = i_PlayerType; }
private void updateVsComputerScore(int i_BlackScore, int i_WhiteScore, ePlayerType i_BlackPlayer) { if (i_BlackPlayer == ePlayerType.Human) { HumanScore += i_BlackScore; CompuerScore += i_WhiteScore; } else { CompuerScore += i_BlackScore; HumanScore += i_WhiteScore; } }
public Player(Player.ePlayerType i_PlayerType) { m_Type = i_PlayerType; }
private void buttonGameOpponent_Click(object sender, EventArgs e) { if (sender == m_ButtonPlayAgainstComputer) { m_PlayerType = ePlayerType.Computer; } else { m_PlayerType = ePlayerType.Human; } this.Close(); }
private void updateVsComputerWins( int i_BlackScore, int i_WhiteScore, ePlayerType i_BlackPlayer, ePlayerType i_WhitePlayer) { if (i_BlackScore > i_WhiteScore) { updatePlayerWins(i_BlackPlayer); } else if (i_BlackScore < i_WhiteScore) { updatePlayerWins(i_WhitePlayer); } else { HnCDraws++; } }