Package mmud.database.entities.items
Provides the JPA Database Entities for item definitions and item instances.
The items has been completely overhauled from a database point of view. I'll describe the old situation first. The following tables exist:- mm_charitemtable
- mm_itemattributes
- mm_itemitemtable
- mm_items
- mm_itemtable
- mm_roomitemtable
- mm_shopkeeperitems
Old situation
The definition of an item was stored in mm_items. For example the description and characteristics of a bucket.
The instance of an item, say an actual bucket, one of many, is stored in mm_itemtable. Where this bucket resides is then stored
- either mm_charitemtable if it belongs to a person,
- mm_itemitemtable if it is contained in another item or
- mm_roomitemtable if it is contained in a room.
This was a hassle, as it means having to copy records from one table to the other when a change in situation took place.
New situation
The definition of an item is stored in mm_items. For example the description and characteristics of a bucket.
The instance of an item, say an actual bucket, one of many, is stored in mm_itemtable. It is also registered, at the same place, where this bucket resides. This is done by means of several extra columns.
- belongsto (mm_usertable.name, varchar)
- room (mm_rooms.id, int)
- containerid (mm_itemtable.id, int)
NOTE: Care must be taken to make sure that only one and exactly one of these fields is actually filled (at all times).
A person can, ofcourse, only wear an item if he/she actually owns the item. The person table will be exanded with the idfields for different parts of the body so they can contain items.
I've not moved the 'search' facility of items in rooms. If you want that, I'm going to implement a hidden, invisible item bag in the room, that you can 'search'.
Of course some items have attributes and some do not, hence we have an mm_itemattributes table.
Deprecated
The following tables are deprecated and will need to be removed.
-
ClassDescriptionAn item.The definition of an item.Interface on what is allowed to be done with items.