private int loadStackCategory(List <byte> byteFile, int currentOffset, byte category) { int count = 0; switch (category) { case (int)DDD_ItemCategories.DREAM_PIECE: count = COUNT_DREAM_PIECES; break; case (int)DDD_ItemCategories.TREAT: count = COUNT_TREATS; break; case (int)DDD_ItemCategories.TRAINING_TOY: count = COUNT_TRAINING_TOYS; break; default: break; } for (int i = 0; i < count; i++) { List <byte> byteEntry = byteFile.GetRange(currentOffset, ENTRY_SIZE_STACK); DDD_inventory_EntryStack entry = BinaryWrapper.toObject <DDD_inventory_EntryStack>(byteEntry); entry.categoryId = category; entry.typeId = (byte)i; entriesStack.Add(entry); currentOffset += ENTRY_SIZE_STACK; } return(currentOffset); }
public DDD_spcom_File(List <byte> byteFile) { counts = new ObservableCollection <DDD_spcom_Count>(); entriesA = new ObservableCollection <DDD_spcom_CombinationA>(); entriesB = new ObservableCollection <DDD_spcom_CombinationB>(); header = BinaryWrapper.toObject <DDD_spcom_Header>(byteFile.GetRange(0, DDD_spcom_Header.SIZE)); // COUNTS int countsCount = header.spiritCount + 1; // + padding? for (int i = 0; i < countsCount; i++) { counts.Add(BinaryWrapper.toObject <DDD_spcom_Count>(byteFile.GetRange(header.countsOffset + i * DDD_spcom_Count.SIZE, DDD_spcom_Count.SIZE))); } //TABLE A for (int i = 0; i < header.tableACount; i++) { entriesA.Add(BinaryWrapper.toObject <DDD_spcom_CombinationA>(byteFile.GetRange(header.tableAOffset + i * DDD_spcom_CombinationA.SIZE, DDD_spcom_CombinationA.SIZE))); } // TABLE B for (int i = 0; i < header.tableBCount; i++) { entriesB.Add(BinaryWrapper.toObject <DDD_spcom_CombinationB>(byteFile.GetRange(header.tableBOffset + i * DDD_spcom_CombinationB.SIZE, DDD_spcom_CombinationB.SIZE))); } }
public DDD_techprm_File(List <byte> byteFile) { entries = new ObservableCollection <DDD_techprm_Entry>(); for (int i = 0; i < (byteFile.Count / DDD_techprm_Entry.SIZE); i++) { List <byte> byteEntry = byteFile.GetRange(i * DDD_techprm_Entry.SIZE, DDD_techprm_Entry.SIZE); DDD_techprm_Entry entry = BinaryWrapper.toObject <DDD_techprm_Entry>(byteEntry); entries.Add(entry); } }
public DDD_spirit_File(List <byte> byteFile) { entries = new ObservableCollection <DDD_spirit_Entry>(); for (int i = 0; i < ENTRY_COUNT; i++) { List <byte> byteEntry = byteFile.GetRange(i * ENTRY_SIZE, ENTRY_SIZE); DDD_spirit_Entry entry = BinaryWrapper.toObject <DDD_spirit_Entry>(byteEntry); entries.Add(entry); } }
public void readAction(ProcessHandler processHandler) { try { DDD_spcom_Header byteFileHeader = BinaryWrapper.toObject <DDD_spcom_Header>(processHandler.readBytesFromProcessModule((long)DDD_Pointers.SPCOM_MOD_EGS, DDD_spcom_Header.SIZE)); loadFile(processHandler.readBytesFromProcessModule((long)DDD_Pointers.SPCOM_MOD_EGS, byteFileHeader.getFileSize())); } catch { writeInfoLabel("Error reading"); } }
private void construct(List <byte> byteFile) { entries = new ObservableCollection <DDD_lboard_Entry>(); int entryCount = byteFile.Count / DDD_lboard_Entry.SIZE; for (int i = 0; i < entryCount; i++) { List <byte> byteEntry = byteFile.GetRange(i * DDD_lboard_Entry.SIZE, DDD_lboard_Entry.SIZE); DDD_lboard_Entry entry = BinaryWrapper.toObject <DDD_lboard_Entry>(byteEntry); entries.Add(entry); } }
public DDD_btlparam_File(List <byte> byteFile) { entries = new ObservableCollection <DDD_btlparam_Entry>(); int entryCount = byteFile.Count / ENTRY_SIZE; for (int i = 0; i < entryCount; i++) { List <byte> byteEntry = byteFile.GetRange(i * ENTRY_SIZE, ENTRY_SIZE); DDD_btlparam_Entry entry = BinaryWrapper.toObject <DDD_btlparam_Entry>(byteEntry); entries.Add(entry); } }
public DDD_tboxdt_File(List <byte> byteFile) { // Header header = BinaryWrapper.toObject <DDD_tboxdt_FileHeader>(byteFile.GetRange(0, HEADER_SIZE)); // Entries entries = new ObservableCollection <DDD_tboxdt_Entry>(); for (int i = 0; i < header.totalCount; i++) { List <byte> byteEntry = byteFile.GetRange(HEADER_SIZE + (i * ENTRY_SIZE), ENTRY_SIZE); DDD_tboxdt_Entry entry = BinaryWrapper.toObject <DDD_tboxdt_Entry>(byteEntry); entries.Add(entry); } }
public DDD_lbtList_File(List <byte> byteFile) { // Header header = BinaryWrapper.toObject <DDD_lbtList_FileHeader>(byteFile.GetRange(0, HEADER_SIZE)); // Boards boards = new ObservableCollection <DDD_lbtList_Board>(); for (int i = 0; i < header.boardCount; i++) { List <byte> byteBoard = byteFile.GetRange(HEADER_SIZE + (i * DDD_lbtList_Board.SIZE), DDD_lbtList_Board.SIZE); DDD_lbtList_Board board = new DDD_lbtList_Board(byteBoard, i); boards.Add(board); } // EOF padding filePadding = byteFile.GetRange(byteFile.Count - EOFPADDING_SIZE, EOFPADDING_SIZE); }
private int loadCategory(List <byte> byteFile, int currentOffset, byte category) { int count = 0; switch (category) { case (int)DDD_ItemCategories.KEYBLADE: count = COUNT_KEYBLADES; break; case (int)DDD_ItemCategories.RECIPE: count = COUNT_RECIPES; break; case (int)DDD_ItemCategories.KEY_ITEM: count = COUNT_KEY_ITEMS; break; case (int)DDD_ItemCategories.GLOSSARY: count = COUNT_GLOSSARY; break; case (int)DDD_ItemCategories.MEMENTO: count = COUNT_MEMENTO; break; case (int)DDD_ItemCategories.UNKNOWN: count = COUNT_UNKNOWN; break; default: break; } for (int i = 0; i < count; i++) { List <byte> byteEntry = byteFile.GetRange(currentOffset, ENTRY_SIZE); DDD_inventory_Entry entry = BinaryWrapper.toObject <DDD_inventory_Entry>(byteEntry); entry.categoryId = category; entry.typeId = (byte)i; entries.Add(entry); currentOffset += ENTRY_SIZE; } return(currentOffset); }
public DDD_lboard_File(List <byte> byteFile) { header = BinaryWrapper.toObject <DDD_lboard_Header>(byteFile.GetRange(0, DDD_lboard_Header.SIZE)); boards = new ObservableCollection <DDD_lboard_Board>(); for (int i = 0; i < header.boardCount; i++) { int boardOffset = header.boardOffsets[i]; int nextOffset; if (i == header.boardCount - 1) { nextOffset = byteFile.Count - DDD_lboard_Entry.SIZE; } else { nextOffset = header.boardOffsets[i + 1]; } int boardSize = nextOffset - boardOffset; List <byte> byteEntry = byteFile.GetRange(boardOffset, boardSize); DDD_lboard_Board entry = new DDD_lboard_Board(byteEntry, i); boards.Add(entry); } }