コード例 #1
0
ファイル: SpellieEvent.cs プロジェクト: H1M4W4R1/Spellie
        /// <summary>
        /// Cast spell for all targets
        /// </summary>
        /// <param name="source"></param>
        /// <param name="caster"></param>
        /// <param name="target"></param>
        public List <ICastResult> InvokeAll(ICastSource source, IEntity caster, IEntity target)
        {
            var results = new List <ICastResult>();

            if (CanExecuteOnEntity(target))
            {
                _onInvoke.ForEach(element => results.Add(element.Cast(caster, source, target)));
            }

            return(results);
        }
コード例 #2
0
        /// <summary>
        /// Gets castSource for attached property
        /// </summary>
        /// <param name="attached"></param>
        /// <param name="source"></param>
        /// <param name="caster"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static ICastSource GetSource(string attached, ICastSource source, IEntity caster, IEntity target)
        {
            var parent = null as ICastSource;

            switch (attached)
            {
            case Src.SOURCE:
                parent = source;
                break;

            case Src.CASTER:
                parent = caster;
                break;

            case Src.HIT:
            case Src.TARGET:
                parent = target;
                break;
            }

            return(parent);
        }
コード例 #3
0
 public abstract ICastResult Cast(IEntity caster, ICastSource source, IEntity target);
コード例 #4
0
        public static ChannelingCastResult New(ISpellieElement element, IEntity caster, IEntity target, ICastSource src)
        {
            // Create new object that represents this result
            var channelingObject = new GameObject("channelingObject");

            // Add ChannelingCastResult to object - it will process channeling events
            var r = channelingObject.AddComponent <ChannelingCastResult>();

            // Setup data and initialize object
            r.sourceElement = element;
            r.caster        = caster;
            r.target        = target;
            r.source        = src;
            r.OnChannelStart();
            return(r);
        }
コード例 #5
0
ファイル: Spell.cs プロジェクト: H1M4W4R1/Spellie
 public ICastResult Cast(ICastSource source, IEntity caster, IEntity target)
 {
     return(_onSpellCasted?.Cast(caster, source, target));
 }