/// <summary> /// Gets the MonsterGroup for the given map. /// Creates one if it doesn't exist yet. /// </summary> public static MonstersGroup Get(Map theMap) { var group = theMap.FindGroup <MonstersGroup>(); if (group == null) { group = new MonstersGroup(theMap); } return(group); }
public static Group Read(Map theMap, string name, MyData.Reader reader) { Types type = (Types)reader.UInt(name + "_type"); Group g = null; switch (type) { case Types.PlayerChars: g = new Groups.PlayerGroup(theMap); break; case Types.Monsters: g = new Groups.MonstersGroup(theMap); break; default: throw new NotImplementedException(type.ToString()); } reader.Structure(g, name + "_value"); return(g); }