Exemplo n.º 1
0
        public bool GenerateQuests()
        {
            configurationAdapter.LoadConfigs(_configRepository);
            var now           = DateTime.Now;
            var refreshResult = _refreshingMechnism.GetRefreshStatus(RefreshOption.Quests, now);

            if (refreshResult.Status == RefresStatus.Ready)
            {
                _questRepository.Clear(_accountManagement.GetLoggedAccount().ID);
                List <Quest> quests = new List <Quest>();
                for (int i = 1; i <= configurationAdapter.NumberOfQuests; i++)
                {
                    quests.Add(GenerateFightQuest(GetRandomLevel(configurationAdapter.QuestGenerateChances), i));
                }

                _questRepository.AddMany(quests, _accountManagement.GetLoggedAccount().ID);

                _refreshingMechnism.AddRefreshFactForLoggedAccount(RefreshOption.Quests, now);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool GenerateMercenaries()
        {
            configurationAdapter.LoadConfigs(_configRepository);
            var now = DateTime.Now;

            if (_refreshingMechnism.GetRefreshStatus(RefreshOption.Mercenaries, now).Status == RefresStatus.Ready)
            {
                _recruitsRepository.Clear(_accountManagement.GetLoggedAccount().ID);
                AddRandomMercenaries(configurationAdapter.NumberOfRecruits);
                _refreshingMechnism.AddRefreshFactForLoggedAccount(RefreshOption.Mercenaries, now);
                return(true);
            }
            return(false);
        }