コード例 #1
0
 /// <summary>
 /// Instances A game  by index with a defualt of the first game avaible
 /// </summary>
 /// <param name="GameNumberToStart">The index of the game in the config</param>
 public void StartGame(object StartRequester, string GameGUIDToStart)
 {
     GameIsStartingEvent?.Invoke(this, new GameStartingEventArgs {
         GameName = Config[GameGUIDToStart].Name, RequestingObj = StartRequester
     });
     RunningGame = new InstanceGame(Config[GameGUIDToStart]);
     RunningGame.GameHasEndedEvent += GameEndedEventChain;
     RunningGame.StartGame();
     GameHasStartedEvent?.Invoke(this, new GameStartedEventArgs {
         GameName = Config[GameGUIDToStart].Name
     });
 }
コード例 #2
0
        /// <summary>
        /// Instances A game by its name
        /// </summary>
        /// <param name="GameNumberToStart">The index of the game in the config</param>
        public void StartGameByName(object StartRequester, string GameNameToStart)
        {
            IGameModel gameConfig = Config.GetGameByName(GameNameToStart);

            GameIsStartingEvent?.Invoke(this, new GameStartingEventArgs {
                GameName = gameConfig.Name, RequestingObj = StartRequester
            });
            RunningGame = new InstanceGame(gameConfig);
            RunningGame.GameHasEndedEvent += GameEndedEventChain;
            RunningGame.StartGame();
            GameHasStartedEvent?.Invoke(this, new GameStartedEventArgs {
                GameName = gameConfig.Name
            });
        }