public override void InitializeGame(IPlayerBoard board, int size, int targetLength) { this.Size = size; this.TargetLength = targetLength; this.allSequences = APFinder.FindAllSequences(board, targetLength, size).ToList(); this.myAvailableSequences = this.allSequences.ToList(); this.opponentAvailableSequences = this.allSequences.ToList(); }
public GameMaster(GameType gameType, int size, int targetLength, Strategy[] computerStrategies, bool isComputerFirst) { this.GameType = gameType; this.Size = size; this.TargetLength = targetLength; this.guiController = new GuiController(); List <List <Field> > allPossibilities; do { this.Board = new Board(size); allPossibilities = APFinder.FindAllSequences(Board, TargetLength, Size); } while (allPossibilities.Count == 0); StartPossibilitiesCount = allPossibilities.Count; this.Players = PlayersFactory.CreatePlayers(gameType, computerStrategies, isComputerFirst); this.playerAPPossibilities = new List <List <Field> > [Players.Length]; for (int i = 0; i < playerAPPossibilities.Length; i++) { playerAPPossibilities[i] = allPossibilities.ToList(); } }