public GameController(IGameViewer viewer, Game game, bool hasHumanPlayer, params IPlayer[] players) { Viewer = viewer; Viewer.SetGame(game); _players = players; Game = game; if (_players == null || _players.Length != Game.NumberOfUniversities) { throw new ArgumentException("Number of players does not match number of universities in the game"); } Game.HasHumanPlayer = hasHumanPlayer; Debug.Assert(Game.Board.IsLocked); }
/// <summary> /// Creates an all computer players game /// </summary> /// <param name="viewer">Object that receive all the information about the game real-time</param> /// <param name="plugins">array of 4 player types</param> /// <param name="num_of_rounds">number of rounds to play</param> /// <param name="milisecs_between_turns">time to wait between each turn</param> /// <param name="game_name">name of game</param> public static void CreateGame(IGameViewer viewer, string[] plugins, int num_of_rounds, int milisecs_between_turns, string game_name) { if (game_name == null) game_name = ""; Game g = new Game(num_of_rounds, milisecs_between_turns, game_name); g.Viewer = viewer; Games.Add(g); for (int i = 0; i < plugins.Length; i++) { IAsyncPlayer p = Brain.PlayerFactory.CreatePlayer(plugins[i]); if (p != null) g.AddPlayer(p, plugins[i]); } }
public Cell(IGameViewer viewer, Tuple <int, int> coords) { this.viewer = viewer; this.pos = coords; viewer.DisplayCell(this); }
public SimplexLearning(IGameViewer gameGameViewer, IPredefinedBoardConstructor boardConstructor) { _gameViewer = gameGameViewer; _boardConstructor = boardConstructor; }