Skip to content

Class

BuildCost

Generated GDScript class reference for GridPlacement.BuildCost.

Status
Current
Version
v6.2.1
Source updated
2026-09-24
Generated on
2026-10-22

Records what was spent to build a placed instance (5.1.0-D refund contract). Stamped onto the placed Manipulatable's metadata under META_KEY at placement time (stamping is consumer-owned — see the integration guide), then read back by Refunder consumers at 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 Resource

Members

NameKindSummary
META_KEYFieldNamespaced 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.
entriesPropertyItem 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).
currencyPropertyNon-item currency: Dictionary keyed by StringName currency id with numeric amounts.
source_resourcePropertyReference 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_forMethod
from_costsMethod
from_pairsMethod
is_valid_quantityMethod
multipliedMethod