mr:bag_item
Table of Contents
Bag Item - Machine Readable Reference
Java Classes
- Bag.java - Base bag/container class
- Implements: Iterable<Item>
- Key methods:
- `actions(Char hero)` - Returns actions including AC_OPEN
- `_execute(Char chr, String action)` - Handles AC_OPEN to show bag UI
- `collect(Bag container)` - Collects items from another bag
- `onDetach()` - Returns items to owner's inventory when detached
- `isUpgradable()` - Returns false (bags cannot be upgraded)
- `isIdentified()` - Returns true (bags are always identified)
- `storeInBundle(Bundle bundle)` / `restoreFromBundle(Bundle bundle)` - Serialization
- `contains(Item item)` - Checks if bag contains item (recursive)
- `grab(Item item)` - Checks if item can go in this bag type
- `getSize()` - Returns capacity based on owner
- `getEntityKind()` - Returns class simple name for item type matching
- `setOwner(Char owner)` - Sets owner for bag and all contained items
- Subclasses:
- ScrollHolder (scrolls)
- WandHolster (wands)
- PotionBelt (potions)
- Quiver (arrows)
- SeedPouch (seeds)
- Keyring (keys)
- Backpack (general inventory)
JSON Configuration
This entity is implemented in Java, no JSON configuration exists
String Resources
<string name="Bag_ACOpen">Open</string>
Lua Scripts
This entity is implemented in Java, no Lua script exists
Related mr Entities
- Scroll Holder (Item) - Container for scrolls
- Wand Holster (Item) - Container for wands
- Potion Belt (Item) - Container for potions
- Quiver (Item) - Container for arrows
- Seed Pouch (Item) - Container for seeds
- Keyring (Item) - Container for keys
- Backpack (Item) - Hero's main inventory
Content Verification
- Information source: Java code (Bag.java and subclasses)
- Last updated: Based on Remixed Dungeon source code analysis
mr/bag_item.txt · Last modified: by 127.0.0.1
