Пример #1
0
        public void Initialize(HeroContext heroParam, HeroModel heroModelParam, SpellSlot slotParam, string icon) {
            slot = slotParam;
            Level = slot.level;
            Icon = icon;
            Parent = heroParam;
            heroModel = heroModelParam;

            slot.OnStartCooldown += OnStartCooldown;
            slot.OnEndCooldown += OnEndCooldown;
            if (slot.Cooldown != null) {
                IsOnCooldown = true;
                slot.Cooldown.OnTick += OnTick;
            } else {
                IsOnCooldown = false;
            }
        }
Пример #2
0
 protected bool TrySelectHero() {
     var selectedTarget =
             SelectionManager.GetSelectedObjects()[0].GetView().GetModel<ITarget>();
     if (selectedTarget is HeroModel) {
         IsHeroSelected = true;
         CurrentHero = new HeroContext();
         InjectionBinder.injector.Inject(CurrentHero);
         CurrentHero.InitializeSlots(selectedTarget as HeroModel);
         ResetSpawner();
         return true;
     } else {
         ResetHero();
         return false;
     }
 }