pub enum ItemKind<Id: Copy + Eq + Hash + Debug> {
Consumable,
Equipment,
KeyItem,
Evolution,
StatBoost,
Currency,
TeachMove,
Custom(Id),
}Expand description
Broad classification of an item’s purpose, influencing default shop, bag, and usage behaviour.
The generic parameter Id allows a game-specific crate to supply
additional custom kinds (e.g. ItemKind::Custom(GameItemKind::TM)).
§Default methods
Each variant has baked-in defaults for four orthogonal behaviours.
A game’s ItemProvider implementation may
override any of these per-item.
Variants§
Consumable
Single-use recovery / utility items (potions, antidotes, repels).
Equipment
Equippable gear (weapons, armour, accessories).
KeyItem
Plot-critical items that cannot be sold, discarded, or stacked.
Evolution
Items that trigger a monster evolution.
StatBoost
Permanent stat-enhancing items (vitamins, feathers).
Currency
In-game currency (dollars, coins, shards).
TeachMove
Items that teach a new move (TMs, HMs, skill discs).
Custom(Id)
Game-specific kind not covered by the standard variants.
Implementations§
Source§impl<Id: Copy + Eq + Hash + Debug> ItemKind<Id>
impl<Id: Copy + Eq + Hash + Debug> ItemKind<Id>
Sourcepub fn default_sellable(&self) -> bool
pub fn default_sellable(&self) -> bool
Whether shops will buy this kind of item by default.
Sourcepub fn default_discardable(&self) -> bool
pub fn default_discardable(&self) -> bool
Whether this kind of item can be discarded from the bag by default.
Sourcepub fn default_stackable(&self) -> bool
pub fn default_stackable(&self) -> bool
Whether multiple copies of this kind of item stack in a single inventory slot by default.
Sourcepub fn default_consumed_on_use(&self) -> bool
pub fn default_consumed_on_use(&self) -> bool
Whether this kind of item is consumed (removed from inventory) on successful use by default.