mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
lord
This commit is contained in:
@@ -19,13 +19,20 @@ import java.util.Map;
|
||||
public final class Inventory extends ItemContainer {
|
||||
|
||||
public static enum WearSlot {
|
||||
weapon, shield, head, body, hand, feet, neck, leftring, rightring;
|
||||
|
||||
public static WearSlot fromString(String s, WearSlot default_) {
|
||||
if (s == null) return default_;
|
||||
return valueOf(s);
|
||||
weapon
|
||||
,shield
|
||||
,head
|
||||
,body
|
||||
,hand
|
||||
,feet
|
||||
,neck
|
||||
,leftring
|
||||
,rightring;
|
||||
public static WearSlot fromString(String s, WearSlot default_) {
|
||||
if (s == null) return default_;
|
||||
return valueOf(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int gold = 0;
|
||||
private static final int NUM_WORN_SLOTS = WearSlot.values().length;
|
||||
@@ -46,6 +53,7 @@ public final class Inventory extends ItemContainer {
|
||||
this.gold += loot.gold;
|
||||
this.add(loot.items);
|
||||
}
|
||||
|
||||
public boolean isEmptySlot(WearSlot slot) {
|
||||
return wear[slot.ordinal()] == null;
|
||||
}
|
||||
@@ -53,7 +61,6 @@ public final class Inventory extends ItemContainer {
|
||||
public ItemType getItemTypeInWearSlot(WearSlot slot) {
|
||||
return wear[slot.ordinal()];
|
||||
}
|
||||
|
||||
public void setItemTypeInWearSlot(WearSlot slot, ItemType type) {
|
||||
wear[slot.ordinal()] = type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user