public static string JoyKindsOnMapString(Map map) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < DefDatabase <JoyKindDef> .AllDefsListForReading.Count; i++) { JoyKindDef joyKindDef = DefDatabase <JoyKindDef> .AllDefsListForReading[i]; if (!joyKindDef.needsThing) { JoyUtility.CheckAppendJoyKind(stringBuilder, null, joyKindDef, map); } } foreach (Thing current in JoyUtility.JoySourceBuildings(map)) { JoyUtility.CheckAppendJoyKind(stringBuilder, current, current.def.building.joyKind, map); } foreach (Thing current2 in map.listerThings.ThingsInGroup(ThingRequestGroup.Drug)) { if (current2.def.IsIngestible && current2.def.ingestible.joyKind != null) { JoyUtility.CheckAppendJoyKind(stringBuilder, current2, current2.def.ingestible.joyKind, map); } } foreach (Thing current3 in map.listerThings.ThingsInGroup(ThingRequestGroup.FoodSourceNotPlantOrTree)) { if (current3.def.IsIngestible && current3.def.ingestible.joyKind != null) { JoyUtility.CheckAppendJoyKind(stringBuilder, current3, current3.def.ingestible.joyKind, map); } } JoyUtility.listedJoyKinds.Clear(); return(stringBuilder.ToString().TrimEndNewlines()); }
public static List <JoyKindDef> JoyKindsOnMapTempList(Map map) { for (int i = 0; i < DefDatabase <JoyKindDef> .AllDefsListForReading.Count; i++) { JoyKindDef joyKindDef = DefDatabase <JoyKindDef> .AllDefsListForReading[i]; if (!joyKindDef.needsThing) { JoyUtility.tempKindList.Add(joyKindDef); } } foreach (Thing current in JoyUtility.JoySourceBuildings(map)) { if (!JoyUtility.tempKindList.Contains(current.def.building.joyKind)) { JoyUtility.tempKindList.Add(current.def.building.joyKind); } } foreach (Thing current2 in map.listerThings.ThingsInGroup(ThingRequestGroup.Drug)) { if (current2.def.IsIngestible && current2.def.ingestible.joyKind != null && !JoyUtility.tempKindList.Contains(current2.def.ingestible.joyKind) && !current2.Position.Fogged(map)) { JoyUtility.tempKindList.Add(current2.def.ingestible.joyKind); } } foreach (Thing current3 in map.listerThings.ThingsInGroup(ThingRequestGroup.FoodSourceNotPlantOrTree)) { if (current3.def.IsIngestible && current3.def.ingestible.joyKind != null && !JoyUtility.tempKindList.Contains(current3.def.ingestible.joyKind) && !current3.Position.Fogged(map)) { JoyUtility.tempKindList.Add(current3.def.ingestible.joyKind); } } return(JoyUtility.tempKindList); }