示例#1
0
 public IEnumerable <BodyPartRecord> GetPartsWithDef(BodyPartDef def)
 {
     for (int i = 0; i < this.AllParts.Count; i++)
     {
         BodyPartRecord part = this.AllParts[i];
         if (part.def == def)
         {
             yield return(part);
         }
     }
 }
示例#2
0
 public IEnumerable <BodyPartRecord> GetPartsWithDef(BodyPartDef def)
 {
     for (int i = 0; i < AllParts.Count; i++)
     {
         BodyPartRecord bodyPartRecord = AllParts[i];
         if (bodyPartRecord.def == def)
         {
             yield return(bodyPartRecord);
         }
     }
 }
示例#3
0
 public BattleLogEntry_StateTransition(Thing subject, RulePackDef transitionDef, Pawn initiator, Hediff culpritHediff, BodyPartDef culpritTargetDef)
 {
     if (subject is Pawn)
     {
         this.subjectPawn = (subject as Pawn);
     }
     else if (subject != null)
     {
         this.subjectThing = subject.def;
     }
     this.transitionDef = transitionDef;
     this.initiator     = initiator;
     if (culpritHediff != null)
     {
         this.culpritHediffDef = culpritHediff.def;
         if (culpritHediff.Part != null)
         {
             this.culpritHediffTargetDef = culpritHediff.Part.def;
         }
     }
     this.culpritTargetDef = culpritTargetDef;
 }
示例#4
0
文件: BodyDef.cs 项目: potsh/RimWorld
        public IEnumerable <BodyPartRecord> GetPartsWithDef(BodyPartDef def)
        {
            int            i = 0;
            BodyPartRecord part;

            while (true)
            {
                if (i >= AllParts.Count)
                {
                    yield break;
                }
                part = AllParts[i];
                if (part.def == def)
                {
                    break;
                }
                i++;
            }
            yield return(part);

            /*Error: Unable to find new state assignment for yield return*/;
        }