class

PointClickEngine::Inventory::InventoryItem

Inherits YAML::Serializable < Reference < Object

Individual inventory item

Constants

MAX_COMBINABLES = 50
MAX_COMBINE_ACTIONS = 50
MAX_DESC_LENGTH = 500
MAX_NAME_LENGTH = 64

Maximum lengths

MAX_USABLE_ON = 50
NAME_PATTERN = /\A[a-zA-Z][a-zA-Z0-9_-]*\z/

Valid characters for item names: alphanumeric, underscore, dash

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(name : String, description : String)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

after_yaml_deserialize(ctx : YAML::ParseContext)
Source
can_combine_with?(other_item : InventoryItem) : Bool
Source
can_use_on?(target_name : String) : Bool
Source
combinable_with
Source
combinable_with=(combinable_with : Array(String))
Source
combine_actions
Source
combine_actions=(combine_actions : Hash(String, String))
Source
consumable
Source
consumable=(consumable : Bool)
Source
description
Source
description=(description : String)
Source
get_combine_action(other_item_name : String) : String | Nil
Source
icon
Source
icon=(icon : RL::Texture2D | Nil)
Source
icon_path
Source
icon_path=(icon_path : String | Nil)
Source
load_icon(path : String)
Source
name
Source
name=(name : String)
Source
usable_on
Source
usable_on=(usable_on : Array(String))
Source
use_action
Source
use_action=(use_action : String | Nil)
Source
valid?

Check if item is valid

Source
validate

Validates the item and returns an array of error messages

Source
validate!

Validates the item and raises ItemValidationError if invalid

Source