Resources#
Resources are represented by two models, one is the Resource which is the blueprint or definition of a item and the
other is PersonaResource which is instance of a Resource``owned by a ``Persona or User and stored in their
Inventory. PersonaResource are added to a inventory via transactions and can also be auto
populated to the central back’s inventory based on configuration, see Central Bank, during the Resource
creation route. NOTE, PersonaResource
does not have a direct API route to create or update.
Creation#
A Resource contains a set of properties to define the structure and metadata of an items. Standard properties
include name which is a unique system identifier, title which is used for end user display and description
to help describe the Resource. Other Resource properties are cost which provides the ability to describe a
Resource and value (amount) needed for such things as purchasing or crafting an item and stackable which
defines how the PersonaResource will be stored in the inventory.
Further definition and creation of PersonaResource is handled through defaults , stats and data
properties on the Resource. The defaults property will be used to define the quantity, stats and
data that will be persisted on the PersonaResource during creation via auto population or during
transactions of unique(non-stackable) PersonaResource to or from the central bank. Where as
the stats and data on the Resource object defines global information that can
be applied to all instances PersonaResource that are related to that Resource via the resourceUid.