Пример #1
0
 public AdminProfileCommands(
     IProfileService profileService,
     IGuildPreferences guildPreferences,
     IExperienceService experienceService,
     IGotService gotService,
     ILeaveService leaveService,
     ISpellErrorService spellErrorService,
     ISpellCorrectService spellCorrectService,
     IBoganCountService boganCountService,
     IQuietModeService quietModeService,
     ITextProcessorService textProcessorService,
     IGoldService goldService
     )
 {
     _profileService       = profileService;
     _guildPreferences     = guildPreferences;
     _experienceService    = experienceService;
     _gotService           = gotService;
     _leaveService         = leaveService;
     _spellErrorService    = spellErrorService;
     _spellCorrectService  = spellCorrectService;
     _boganCountService    = boganCountService;
     _quietModeService     = quietModeService;
     _textProcessorService = textProcessorService;
     _goldService          = goldService;
 }
Пример #2
0
 public GambleCommands(IProfileService profileService, IExperienceService experienceService, IGotService gotService, ILeaveService leaveService, IGoldService goldService)
 {
     _profileService    = profileService;
     _experienceService = experienceService;
     _gotService        = gotService;
     _leaveService      = leaveService;
     _goldService       = goldService;
 }
Пример #3
0
 public ItemCommands(
     IRobbingItemService robbingItemService,
     IProfileService profileService,
     IGoldService goldService
     )
 {
     _robbingItemService = robbingItemService;
     _profileService     = profileService;
     _goldService        = goldService;
 }
Пример #4
0
 public CrimeCommands(
     IProfileService profileService,
     IGoldService goldService,
     IRobbingItemService robbingItemService
     )
 {
     _profileService     = profileService;
     _goldService        = goldService;
     _robbingItemService = robbingItemService;
 }
Пример #5
0
 public GoldCommands(
     IProfileService profileService,
     IGotService gotService,
     IGoldService goldService,
     IGuildPreferences guildPreferences
     )
 {
     _profileService   = profileService;
     _gotService       = gotService;
     _goldService      = goldService;
     _guildPreferences = guildPreferences;
 }
Пример #6
0
 public adminCommands(
     IGuildPreferences guildPreferences,
     IAssignableRoleService assignableRoleService,
     IGoldService goldService,
     IProfileService profileService
     )
 {
     _guildPreferences      = guildPreferences;
     _assignableRoleService = assignableRoleService;
     _goldService           = goldService;
     _profileService        = profileService;
 }
Пример #7
0
        public void BuyArmy(ArmyPrice armyPrice)
        {
            if (Parent.GetComponent <OwnerComponent>().Owner == 0)
            {
                Parent.GetComponent <SelectComponent>().Selected = true;
            }

            int          owner       = Parent.GetComponent <OwnerComponent>().Owner;
            IGoldService goldService = Parent.Scene.ServiceProvider.GetService <IGoldService>();
            int          gold        = goldService.GetGold(owner);

            if (gold < (int)armyPrice)
            {
                return;
            }

            goldService.RemoveGold(owner, (int)armyPrice);

            IGameEntityFactory factory = (IGameEntityFactory)Parent.Scene.EntityFactory;
            IEntity            entity  = null;

            switch (armyPrice)
            {
            case ArmyPrice.Archer:
                if (Parent.GetComponent <OwnerComponent>().Owner == 0)
                {
                    Parent.Scene.ServiceProvider.GetService <IAudioService>().PlaySound("intro");
                }
                entity = factory.CreateArcher(Parent.Position, owner, 0);
                break;

            case ArmyPrice.Knight:
                if (Parent.GetComponent <OwnerComponent>().Owner == 0)
                {
                    Parent.Scene.ServiceProvider.GetService <IAudioService>().PlaySound("intro");
                }
                entity = factory.CreateKnight(Parent.Position, owner, 0);
                break;

            case ArmyPrice.Catapult:
                if (Parent.GetComponent <OwnerComponent>().Owner == 0)
                {
                    Parent.Scene.ServiceProvider.GetService <IAudioService>().PlaySound("intro");
                }
                entity = factory.CreateCatapult(Parent.Position, owner, 0);
                break;
            }

            if (entity != null)
            {
                new MoveRandomComponent(entity);
            }
        }
        public void Update()
        {
            if (Parent.Scene.ServiceProvider.GetService <ITimeService>().TimeScale == 0)
            {
                return;
            }

            ITimeService timeService = Parent.Scene.ServiceProvider.GetService <ITimeService>();

            if (lastEarn + EarnSpeed > timeService.AbsoluteTime)
            {
                return;
            }
            lastEarn = timeService.AbsoluteTime;

            IGoldService goldService = Parent.Scene.ServiceProvider.GetService <IGoldService>();
            int          owner       = Parent.GetComponent <OwnerComponent>().Owner;

            goldService.AddGold(owner, Amount);
        }
Пример #9
0
 public GoldsController(IGoldService goldService)
 {
     _goldService = goldService;
 }