private static void ProcessRow(string Row) { if (Row == "[") //Don't ask. { return; } string TypeOfRow = RegExManager.GetKeyValue(Row, "type"); switch (TypeOfRow) { case "Class": ParseClass(Row); break; case "Property": ParseProperty(Row); break; case "Enum": ParseEnum(Row); break; case "EnumItem": ParseEnumItem(Row); break; } }
private static void ParseEnum(string Row) { string EnumName = RegExManager.GetKeyValue(Row, "Name"); List <string> Tags = DecodeTags(Row); RobloxEnum.AddRobloxEnum(EnumName, Tags); }
private static void ParseEnumItem(string Row) { string Name = RegExManager.GetKeyValue(Row, "Name"); List <string> Tags = DecodeTags(Row); string Enum = RegExManager.GetKeyValue(Row, "Enum"); RobloxEnum e = RobloxEnum.Enums[Enum]; e.AddEnumItem(Name, Tags); }
private static void ParseClass(string Row) { string Name = RegExManager.GetKeyValue(Row, "Name"); string Superclass = RegExManager.GetKeyValue(Row, "Superclass"); List <string> Tags = DecodeTags(Row); if (RobloxHierachy == null) { RobloxHierachy = new Dictionary <string, RobloxInstance>(); } RobloxHierachy.Add(Name, new RobloxInstance(Name, Tags, Superclass)); }
private static void ParseProperty(string Row) { string ClassName = RegExManager.GetKeyValue(Row, "Class"); RobloxInstance Inst; if (!RobloxHierachy.TryGetValue(ClassName, out Inst)) { throw new ArgumentException("Invalid ClassName " + ClassName); } string Name = RegExManager.GetKeyValue(Row, "Name"); string ValueType = RegExManager.GetKeyValue(Row, "ValueType"); List <string> Tags = DecodeTags(Row); Inst.AddProperty(new RobloxProperty(Name, Tags, ValueType)); }