protected override void Perform(BooterHelper.BootFile file, XmlDbRow row) { TagStaticData data = new TagStaticData(); string name = row.GetString("TypeName"); string icon = row.GetString("Icon"); string color = row.GetString("ColorHEX"); bool business = row.GetBool("isBusinessType"); try { data.SetGUID(name); } catch (ArgumentException e) { Common.Exception("", e); } if (!data.Valid) { return; } data.name = name; data.icon = icon; data.isBusinessType = business; data.SetColorHex(color); if (!Tagger.staticData.ContainsKey(data.GUID)) { Tagger.staticData.Add(data.GUID, data); EnumInjection.InjectEnums<CommercialLotSubType>(new string[] { name }, new object[] { data.GUID }, false); } }
// this is injected even for lots that aren't a bar to take advantage of the core and make the game honor // open/close times for roles and such public static void InjectBarData(string varname, TagStaticData tData) { Lot.MetaAutonomyType type; if (ParserFunctions.TryParseEnum<Lot.MetaAutonomyType>(varname, out type, Lot.MetaAutonomyType.None)) { XmlDbTable table; XmlDbData data = XmlDbData.ReadData("Bars"); if (data.Tables.TryGetValue("Venues", out table)) { XmlDbRow row = table.Rows[1]; Bartending.BarData rowData = new Bartending.BarData(row); rowData.mHourOpen = tData.openHour; rowData.mHourClose = tData.closeHour; if (!Bartending.sData.ContainsKey(type)) { Bartending.sData[type] = rowData; } } } }