示例#1
0
 private void checkCreatureInventory(CreResource cre) {
   HexNumber slots_offset = (HexNumber) cre.getAttribute("Item slots offset");
   items.clear();
   slots.clear();
   for (int i = 0; i < cre.getRowCount(); i++) {
     StructEntry entry = cre.getStructEntryAt(i);
     if (entry instanceof Item) items.add(entry);
     else if (entry.getOffset() >= slots_offset.getValue() + cre.getOffset()
         && entry instanceof DecNumber
         && !entry.getName().equals("Weapon slot selected")
         && !entry.getName().equals("Weapon ability selected")) slots.add(entry);
   }
   for (int i = 0; i < slots.size(); i++) {
     DecNumber slot = (DecNumber) slots.get(i);
     if (slot.getValue() >= 0 && slot.getValue() < items.size())
       items.set(slot.getValue(), slots_offset); // Dummy object
   }
   for (int i = 0; i < items.size(); i++) {
     if (items.get(i) != slots_offset) {
       Item item = (Item) items.get(i);
       table.addTableItem(new CreInvError(cre.getResourceEntry(), item, "Item not in inventory"));
     }
   }
 }
示例#2
0
 public Object getObjectAt(int columnIndex) {
   if (columnIndex == 0) return resourceEntry;
   else if (columnIndex == 1) return structEntry.getName();
   else if (columnIndex == 2) return message;
   return resourceEntry.getSearchString();
 }