コード例 #1
0
        public TraitAllowed DeepCopy()
        {
            TraitAllowed copy = new TraitAllowed();

            copy.name = this.name;
            copy.tag  = this.tag;
            copy.atWhatLevelIsAvailable = this.atWhatLevelIsAvailable;
            copy.automaticallyLearned   = this.automaticallyLearned;
            copy.allow = this.allow;
            copy.useableInSituation           = this.useableInSituation;
            copy.associatedSpellTag           = this.associatedSpellTag;
            copy.needsSpecificTrainingToLearn = this.needsSpecificTrainingToLearn;
            copy.traitWorksOnlyWhen           = new List <string>();
            foreach (string s in this.traitWorksOnlyWhen)
            {
                copy.traitWorksOnlyWhen.Add(s);
            }

            copy.traitWorksNeverWhen = new List <string>();
            foreach (string s in this.traitWorksNeverWhen)
            {
                copy.traitWorksNeverWhen.Add(s);
            }

            return(copy);
        }
コード例 #2
0
ファイル: TraitAllowed.cs プロジェクト: youngneil1/IB2Engine
 public TraitAllowed DeepCopy()
 {
     TraitAllowed copy = new TraitAllowed();
     copy.name = this.name;
     copy.tag = this.tag;
     copy.atWhatLevelIsAvailable = this.atWhatLevelIsAvailable;
     copy.automaticallyLearned = this.automaticallyLearned;
     copy.allow = this.allow;
     return copy;
 }
コード例 #3
0
 public bool hasTraitAlready(TraitAllowed ta)
 {
     //return this.knownTraitsTags.Contains(ta.tag);
     if (this.knownTraitsTags.Contains(ta.tag))
     {
         return(true);
     }
     if (this.learningTraitsTags.Contains(ta.tag))
     {
         return(true);
     }
     return(false);
 }