Records what was spent to build a placed instance (5.1.0-D refund contract). Stamped onto the placed [Manipulatable]'s metadata under [constant META_KEY] at placement time (stamping is consumer-owned — see the integration guide), then read back by [Refunder] consumers at [signal ManipulationState.pre_demolish] time so refund logic has a canonical "what was paid" record. The canonical cost shape is keyed by [StringName] IDs, not [Resource] references: the consumer's inventory system owns the id -> Resource mapping.
Source: addons/grid_placement/resources/build_cost.gd
Syntax
class BuildCost extends ResourceMembers
| Name | Kind | Summary |
|---|---|---|
META_KEY | Field | Namespaced meta-key for stamping onto a Manipulatable. Reference this constant rather than hardcoding the string to avoid collisions with consumer metadata. Underscore-namespaced because Object.set_meta only accepts valid ASCII identifiers (a ':' separator is rejected). Uses the "placement" prefix per the plugin's public naming convention. |
entries | Property | Item entries: Array[Dictionary] of {id: StringName, quantity: int}. Generic — the consumer maps each id to whatever their inventory system uses (Resource, item database, runtime registry, etc). |
currency | Property | Non-item currency: Dictionary keyed by StringName currency id with numeric amounts. |
source_resource | Property | Reference back to the resource that produced this cost (e.g. the ScenePlacementEntry that defined it). Optional; informational only — refunders do not branch on this. |
resolve_for | Method | |
rule_cost | Property | |
search_root | Property | |
instance | Property | |
costs | Property | |
cost | Property | |
from_costs | Method | |
cost | Property | |
from_pairs | Method | |
cost | Property | |
from_resource_stacks | Method | |
cost | Property |
Source
addons/grid_placement/resources/build_cost.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs