Ejemplo n.º 1
0
        public void StartGame(GameStartupParameters parameters, Agents.BaseAgent[] agents)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }
            else if (agents == null)
            {
                throw new ArgumentNullException("agents");
            }
            else if (parameters.PlayerDecks.Count != agents.Length)
            {
                throw new InvalidOperationException("PlayerDecks and agents shall have the same length.");
            }

            Agents = agents.ToIndexable();

            m_game = new Game(parameters.PlayerIds, new XnaUIController(agents, parameters.Seed));
            m_game.Initialize(parameters.PlayerDecks);

            GameApp.Service<GameUI>().GameCreated(m_game);
            GameApp.Service<Graphics.Scene>().GameCreated();

            m_game.StartGameFlowThread();
            GameApp.Service<Sound>().PlayMusic(Sound.MusicEnum.kagamiM);
        }