Example #1
0
        /// <summary>
        /// Creates a copy of the TrapAttack object.
        /// </summary>
        /// <returns>Returns the copy.</returns>
        public TrapAttack Copy()
        {
            TrapAttack ta = new TrapAttack();

            ta.ID            = fID;
            ta.Name          = fName;
            ta.Trigger       = fTrigger;
            ta.Action        = fAction;
            ta.Keywords      = fKeywords;
            ta.Range         = fRange;
            ta.Target        = fTarget;
            ta.HasInitiative = fHasInitiative;
            ta.Initiative    = fInitiative;
            ta.Attack        = fAttack.Copy();
            ta.OnHit         = fOnHit;
            ta.OnMiss        = fOnMiss;
            ta.Effect        = fEffect;
            ta.Notes         = fNotes;

            return(ta);
        }
Example #2
0
        public TrapAttack Copy()
        {
            TrapAttack trapAttack = new TrapAttack()
            {
                ID            = this.fID,
                Name          = this.fName,
                Trigger       = this.fTrigger,
                Action        = this.fAction,
                Keywords      = this.fKeywords,
                Range         = this.fRange,
                Target        = this.fTarget,
                HasInitiative = this.fHasInitiative,
                Initiative    = this.fInitiative,
                Attack        = this.fAttack.Copy(),
                OnHit         = this.fOnHit,
                OnMiss        = this.fOnMiss,
                Effect        = this.fEffect,
                Notes         = this.fNotes
            };

            return(trapAttack);
        }
Example #3
0
        public TrapAttack FindAttack(Guid id)
        {
            TrapAttack trapAttack;

            List <TrapAttack> .Enumerator enumerator = this.fAttacks.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    TrapAttack current = enumerator.Current;
                    if (current.ID != id)
                    {
                        continue;
                    }
                    trapAttack = current;
                    return(trapAttack);
                }
                return(null);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
        }