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); } } }
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); } } }
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; }
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*/; }