Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 4
0
 public SimplexLearning(IGameViewer gameGameViewer, IPredefinedBoardConstructor boardConstructor)
 {
     _gameViewer = gameGameViewer;
     _boardConstructor = boardConstructor;
 }