public CreateItemEntry FindItem(ushort menuNumber) { if (itemEntries != null) { foreach (CreateItemEntry cie in itemEntries) { if (cie.MenuID == menuNumber) { return(cie); } } if (menuEntries != null) { foreach (CreateMenuEntry cme in menuEntries) { CreateItemEntry tmp = cme.FindItem(menuNumber); if (tmp != null) { if (tmp.MenuID == menuNumber) { return(tmp); } } } } } return(null); }
protected static void ParseSubMenu(Script.Section i, CreateMenuEntry parent, Script.BaseScript tObj) { foreach (Script.TagDataPair t in i.TagDataPairs) { if (t.Tag == "MENU") { // do menu parsing here string mToFind = "MENUENTRY " + t.Data; Script.Section k = tObj.FindSection(mToFind); if (k != null) { CreateMenuEntry cmeMade = new CreateMenuEntry(k); parent.AddSubmenu(cmeMade); Script.Section l = tObj.FindSection("SUBMENU " + t.Data); if (l != null) { ParseSubMenu(l, cmeMade, tObj); } } else { missingMenus.Add(t.Tag + " " + t.Data); } } else if (t.Tag == "ITEM") { // do item parsing here string iToFind = "ITEM " + t.Data; Script.Section j = tObj.FindSection(iToFind); if (j != null) { CreateItemEntry cieMade = new CreateItemEntry(j); parent.AddItem(cieMade); } else { missingItems.Add(t.Tag + " " + t.Data); } } } }
public void AddItem(CreateItemEntry nItem) { nItem.ParentMenu = menuID; itemEntries.Add(nItem); }