Ejemplo n.º 1
0
        public BotStatisticsViewModel(IArenaClient arenaClient, IStatisticsClient statisticsClient, ITimerService timerService, IEventAggregator eventAggregator, ICacheService cacheService)
        {
            _arenaClient      = arenaClient;
            _statisticsClient = statisticsClient;
            _cacheService     = cacheService;

            InitializeTimer(timerService);
            SubscribeEvents(eventAggregator);
        }
        public BotDeploymentViewModel(IArenaClient arenaClient, IBotClient botClient, IDeploymentClient deploymentClient, IScriptClient scriptClient, IEventAggregator eventAggregator, IFileExplorerService fileExplorerService, IFileService fileService, ITimerService timerService, ICacheService cacheService)
        {
            _arenaClient         = arenaClient;
            _botClient           = botClient;
            _deploymentClient    = deploymentClient;
            _scriptClient        = scriptClient;
            _eventAggregator     = eventAggregator;
            _fileExplorerService = fileExplorerService;
            _fileService         = fileService;
            _cacheService        = cacheService;

            timerService.Start(TimeSpan.FromSeconds(5), RefreshArenas);

            SubscribeEvents(eventAggregator);

            SaveScriptCommand        = new RelayCommand(OnSaveScript);
            LoadScriptCommand        = new RelayCommand(OnLoadScript);
            ValidateBotScriptCommand = new RelayCommand(OnValidateBotScript);
            DeployBotCommand         = new RelayCommand(OnDeployBot,
                                                        () => SelectedArena != null && ScriptValid && (TimeUntilNextAllowedDeployment <= TimeSpan.Zero && (BotPhysicalHealth + BotStamina <= SelectedArena.MaximumPoints) /*|| CurrentTeam.Predator*/));
        }