Beispiel #1
0
        private ModifierRoot ParseAbilityModifier(AbilityModifier abilityModifier)
        {
            ModifierRoot root = new ModifierRoot(abilityModifier.duration);

            if (abilityModifier.OnIntervalThink != null)
            {
                foreach (var command in abilityModifier.OnIntervalThink)
                {
                    root.AddModifier(new ModifierThinkInterval(ParseCommands(command), command.thinkInterval));
                }
            }

            if (abilityModifier.OnAdd != null)
            {
                foreach (var command in abilityModifier.OnAdd)
                {
                    root.AddModifier(new ModifierOnAdd(ParseCommands(command)));
                }
            }

            if (abilityModifier.OnRemove != null)
            {
                foreach (var command in abilityModifier.OnRemove)
                {
                    root.AddModifier(new ModifierOnRemove(ParseCommands(command)));
                }
            }

            return(root);
        }
        public override IModifierExecutor Clone()
        {
            var root = new ModifierRoot(m_Duration);

            foreach (var modifier in modifiers)
            {
                root.AddModifier(modifier.Clone());
            }
            return(root);
        }