package inventory
- Alphabetic
- Public
- Protected
Type Members
- trait Container extends AnyRef
This object is capable of storing ("stowing")
Equipment
within itself.
The following objects are considered item containers: players (their own inventory), players (their corpse's loot), vehicles (their trunk), and lockers (contents of the player's fifth slot). - class GridInventory extends Container
An inventory are used to stow
Equipment
when it does not exist visually in the game world.
Visually, an inventory is understood as a rectangular region divided into cellular units.An inventory are used to stow
Equipment
when it does not exist visually in the game world.
Visually, an inventory is understood as a rectangular region divided into cellular units. TheEquipment
that is placed into the inventory can also be represented as smaller rectangles, also composed of cells. The same number of cells of the item must overlap with the same number of cells of the inventory. No two items may have cells that overlap. This "grid" maintains a spatial distinction between items when they get stowed.
It is not necessary to actually have a structural representation of the "grid." Adhering to such a data structure does speed up the actions upon the inventory and its contents in certain cases (where noted). TheHashMap
of items is used for quick object lookup. Use of theHashMap
only is hitherto referred as "using the inventory as aList
." TheArray
of spatial GUIDs is used for quick collision lookup. Use of theArray
only is hitherto referred as "using the inventory as a grid." - final case class InventoryDisarrayException(message: String, cause: Throwable, inventory: GridInventory) extends Exception with Product with Serializable
Some data in the grid portion of a
GridInventory
does not match against data that is expected to be found in the "list" portion ofGridInventory
.Some data in the grid portion of a
GridInventory
does not match against data that is expected to be found in the "list" portion ofGridInventory
. While merely eliminating the old data is possible, the discovery of this errant data could be hiding significantly greater issues, and these greater issues must be explored at a higher level of governance.- message
the explanation of why the exception was thrown
- cause
any prior
Exception
that was thrown then wrapped in this one
- class InventoryEquipmentSlot extends OffhandEquipmentSlot
A slot-like interface for a specific grid position in an inventory.
A slot-like interface for a specific grid position in an inventory. The size is typically bound to anything that can be stowed which encompasses most all
Equipment
. The capacity of thisEquipmentSlot
is essentially treated as 1x1. Upon insertions, however, the capacity temporarily is treated as the size of the item being inserted (unlessNone
). This allows a proper check for insertion collision.
Rather than operating on a fixed-size slot, this "slot" represents an inventory region that either includesslot
or starts atslot
. When determining the contents of the inventory atslot
, only that singular cell is checked. When removing an item fromslot
, the item in inventory only has to be positioned in such a way that overlaps withslot
. When adding an item toslot
,slot
is treated as the upper left corner (the initial point) of a larger capacity region.
The following diagrams demonstrate the coordinate association:
- - - - - - - - - - - - - - -
- - - - - - r r x - - - - - -
- - s - - - r r x - - - i i -
- - - - - - x x x - - - i i -
- - - - - - - - - - - - - - -
... where 's' is the 1x1 slot, 'r' is the corner of any 2x2 item that can be removed ('x' is a potential affected edge), and 'i' is the region checked for a 2x2 insertion intoslot
. - class InventoryItem extends AnyRef
Represent the image placard that is used to visually and spatially manipulate an item placed into the grid-like inventory.
Represent the image placard that is used to visually and spatially manipulate an item placed into the grid-like inventory. The unofficial term for this placard (the size of the placard) is a "tile." The size of the tile is usually fixed but the origin point of the tile can be changed.
- class InventoryTile extends AnyRef
A "tile" represents the size of the icon placard that is used by
Equipment
when placed into an inventory or visible slot.A "tile" represents the size of the icon placard that is used by
Equipment
when placed into an inventory or visible slot. It is also used by someObjectDefinition
s to pass information about the size of an inventory itself.- Exceptions thrown
IllegalArgumentException
if either the width or the height are less than zero
- class LocallyRegisteredInventory extends GridInventory
An inventory that contains its own internal unique number system bound by a domain of numbers.
An inventory that contains its own internal unique number system bound by a domain of numbers. When equipment is inserted into this inventory, the equipment is registered to it, assigned one of its internal unique numbers. The equipment must not already be registered to another unique number system for that reason. Upon being removed, the removed equipment is unregistered. The registration system adds another unspoken layer to
Capacity
as it imposes a total object count to the inventory based on he number of unique identifiers available.- See also
NumberSourceHub
RandomSelector
SpecificNumberSource
Value Members
- object GridInventory
- object InventoryDisarrayException extends Serializable
- object InventoryItem
- object InventoryTile