コード例 #1
0
ファイル: Manager.cs プロジェクト: riQQ/HearthSim.Common
        public Manager(HSReplayNetConfig config = null, IGameDataProvider gameDataProvider = null)
        {
            gameDataProvider = gameDataProvider ?? new HearthMirrorDataProvider();

            LogReader = new LogReader(new List <LogWatcherData>
            {
                LogWatcherConfigs.Power,
                LogWatcherConfigs.LoadingScreen,
                LogWatcherConfigs.Decks,
                LogWatcherConfigs.Arena,
                LogWatcherConfigs.Rachelle
            });

            Game = new Game(gameDataProvider);
            Game.HearthstoneExited += () => LogReader.Stop().Forget();

            _gameEventManager = new GameEventManager(Game, LogReader, gameDataProvider);

            _procWatcher          = new ProcessWatcher("Hearthstone");
            _procWatcher.OnStart += ProcessWatcher_OnStart;
            _procWatcher.OnExit  += ProcessWatcher_OnExit;

            LogConfigWatcher.Start();
            LogConfigUpdater.LogConfigUpdated      += Game.OnHearthstoneRestartRequired;
            LogConfigUpdater.LogConfigUpdateFailed += Game.OnLogConfigError;

            if (config != null)
            {
                HSReplayNet = new HSReplayNet(config);
                _hsReplayNetEventManager = new HSReplayNetEventManager(HSReplayNet, Game);
                HSReplayNet.UpdateAccount().Forget();
            }
        }
コード例 #2
0
 internal TwitchDataManager(OAuthWrapper oauth, HSReplayNetConfig config)
 {
     _oauth  = oauth;
     _config = config;
 }