package WayofTime.alchemicalWizardry.book.registries; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import WayofTime.alchemicalWizardry.book.compact.Category; import WayofTime.alchemicalWizardry.book.compact.Entry; public class EntryRegistry { public static void registerCategories(Category category) { categories.add(category); categoryMap.put(category.name, category); entryOrder.put(category, new ArrayList()); categoryCount++; } public static ArrayList categories = new ArrayList(); public static HashMap> entryOrder = new HashMap(); public static HashMap categoryMap = new HashMap(); public static int categoryCount = 0; public static void registerEntry(Category category, HashMap entryMap, Entry entry) { entryMap.put(entry.name, entry); entries.put(category, entryMap); entryOrder.get(category).add(entry.name); if(maxEntries.containsKey(category) && entry.indexPage > maxEntries.get(category)) maxEntries.put(category, entry.indexPage); else if(!maxEntries.containsKey(category)) maxEntries.put(category, 0); } public static HashMap> entries = new HashMap>(); public static HashMap maxEntries = new HashMap(); public static HashMap architect = new HashMap(); public static HashMap basics = new HashMap(); public static HashMap rituals = new HashMap(); public static HashMap bloodUtils = new HashMap(); public static HashMap test = new HashMap(); public static Entry[] getEntriesInOrderForCategory(Category category) { HashMap entries = EntryRegistry.entries.get(category); List nameList = entryOrder.get(category); ArrayList list = new ArrayList(); for(String str : nameList) { list.add(entries.get(str)); } Object[] entriesList = list.toArray(); Entry[] entryList = new Entry[entriesList.length]; for(int i=0; i