void Start() { //Initializing Lists players = new List <Player>(); moveHistory = new List <Move>(); //Initializing Boards internalBoard = new InternalBoard(); //Setting up the players foreach (var playerDetail in GlobalVars.playerDetails) { if (playerDetail.isHuman) { players.Add(new HumanPlayer(playerDetail.id, playerDetail.colour, internalBoard)); } else { players.Add(new ComputerPlayer(playerDetail.id, playerDetail.colour, internalBoard)); } } //Setting up the current Player currentPlayer = players[0]; }
public Player(int playerId, PieceColour colour, InternalBoard internalBoard) { this.playerId = playerId; this.colour = colour; this.internalBoard = internalBoard; //Setting up the pieces depending on the game and colour switch (GlobalVars.gameType) { case (GameType.Standard): setUpStandardGame(); break; case (GameType.FourPlayer): setUpFourPlayerGame(); break; case (GameType.NineSixty): break; case (GameType.FourPointFive): break; } }
public HumanPlayer(int playerId, PieceColour colour, InternalBoard internalBoard) : base(playerId, colour, internalBoard) { highlightsManager = BoardHighlights.Instance; }
public ComputerPlayer(int playerId, PieceColour colour, InternalBoard internalBoard) : base(playerId, colour, internalBoard) { }