Class GGItemData extends Resource

Represents an instance of an inventory item and defines unique item properties.

The inventory item is defined by a type and a quantity.

An item provides the serialize() and unserialize() methods, which may be used by a [GGInventorySerializationStrategy].

This class should be extended by your game to describe additional properties you may need. For example: [codeblock] class_name MyCustomItemData extends GGItemData # Stores the name of the player that crafted this item var crafted_by: String = "" # The quality of the item is determined by the skill level of the player who crafted the item. var quality: float = 0.0 [/codeblock] A custom item data class should only describe properties that are unique to a particular instanec of that item. Properties shared by all instances of a type should be added to a class that extends the [GGItemType] class instead.

# Members

## The item type describes common properties for all item instances. While it is typically desirable for all [GGItemData] instances to be unique, the [GGItemType] instances should be shared. This is best accomplished by using a [code].tres[/code] resource to configure the type.
var type: GGItemType
## Specifies the number of items in the stack out of a maximum of [member GGItemType.stack_size].
var quantity: int = 1
## Whether the item is active. This property can be used to represent whether the item is active, equipped, enabled, or otherwise in use.
var active: bool = false

# Methods

## Creates a copy of the current item. This allows inheriting classes to override the method to selectively duplicate additional object properties, since [method duplicate] cannot be overridden.
func copy() -> GGItemData
## Serializes and returns the internal item state. This is used by the [GGInventorySerializationStrategyDynamic] class.
func serialize() -> Dictionary
## Deserializes and restores the internal item state. This is used by the [GGInventorySerializationStrategyDynamic] class.
func deserialize(data: Dictionary) -> void