Beispiel #1
0
        void OnCancelInput(int senderId, bool cancel)
        {
            UnitEntityView entityView;

            if (entityViewsDB.TryQueryEntityView(senderId, out entityView))
            {
                AbilitySelectInfo abilitySelectInfo = new AbilitySelectInfo(senderId, -1);
                if (entityView.turnComponent.state.value == UnitTurnState.AbilitySelected)
                {
                    entityView.turnComponent.state.value       = UnitTurnState.Movement;
                    entityView.abilityComponent.currentAbility = -1;
                }
            }
        }
Beispiel #2
0
        void OnAbilitySelected(int senderId, int abilityID)
        {
            UnitEntityView entityView;

            if (entityViewsDB.TryQueryEntityView(senderId, out entityView))
            {
                var abilities = entityViewsDB.QueryGroupedEntityViews <AbilityEntityView>(senderId);
                var matches   = abilities.Where(x => x.ID == abilityID);

                if (matches.Count() != 0)
                {
                    AbilitySelectInfo abilitySelectInfo = new AbilitySelectInfo(senderId, abilityID);
                    entityView.abilityComponent.currentAbility = abilityID;
                    entityView.turnComponent.state.value       = UnitTurnState.AbilitySelected;
                    _abilityUseSequence.Next(this, ref abilitySelectInfo, AbilityUseCondition.select);
                }
            }
        }