Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            //global settings
            GlobalCatchemSettings.Load();

            InitWindowsControlls();
            BotWindow = this;
            LogWorker();
            RpcWorker();
            InitBots();
            SettingsView.BotMapPage.SetSettingsPage(SettingsView.BotSettingsPage);
            SetVersionTag();

            SettingsView.BotMapPage.SetGlobalSettings(GlobalCatchemSettings);
            GlobalMapView.SetGlobalSettings(GlobalCatchemSettings);
            SettingsView.BotSettingsPage.SetGlobalSettings(GlobalCatchemSettings);
            RouteCreatorView.SetGlobalSettings(GlobalCatchemSettings);

            _listener             = new WpfEventListener();
            _statisticsAggregator = new StatisticsAggregator();
        }
Example #2
0
            public BotWindowData(string name, GlobalSettings gs, StateMachine sm, Statistics st, StatisticsAggregator sa, WpfEventListener wel, ClientSettings cs, LogicSettings l)
            {
                ProfileName    = name;
                Settings       = new ClientSettings(gs);
                Logic          = new LogicSettings(gs);
                GlobalSettings = gs;
                Machine        = sm;
                Stats          = st;
                Aggregator     = sa;
                Listener       = wel;
                Settings       = cs;
                Logic          = l;

                _ts    = new TimeSpan();
                _timer = new DispatcherTimer {
                    Interval = new TimeSpan(0, 0, 1)
                };
                _timer.Tick += delegate
                {
                    _ts            += new TimeSpan(0, 0, 1);
                    RunTime.Content = _ts.ToString();
                };
                _cts = new CancellationTokenSource();
            }