void GetAllSurfaceSamples(ConfigNode achievements) { foreach (var node in achievements.GetNodes("SURFACESAMPLE")) { string key = "", title = "", text = "", bodies = ""; if (node.TryGetValue("key", ref key) && node.TryGetValue("title", ref title) && node.TryGetValue("text", ref text) && node.TryGetValue("bodies", ref bodies)) { SurfaceSample ss = new SurfaceSample(key, title, text); if (AddBodiesTo(ss, bodies)) { string b = "any"; node.TryGetValue("bodyRequirement", ref b); if (b != "") { ss.requireAll = (b.ToLower() == "all"); ss.individual = (b.ToLower() == "individual"); } allSurfaceSamples.Add(key, ss); } } } }
public bool AddBodiesTo(SurfaceSample ss, string bodies) { ss.bodies.AddRange(GetAllbodies(bodies)); ss.bodiesHash = new HashSet <string>(ss.bodies); return(ss.bodies.Count > 0); }