Table of Contents

Class Manipulatable

Namespace
GridPlacement.GDScript
Assembly
MoonBark.GridPlacement.GDScript.dll
class Manipulatable extends PlacementGameNode
Manipulatable

Fields

keep_during_preview

Component node that makes a object movable, demolishable, or other system actions to be performed on the object Special marker that tells building system to keep this script during preview

const keep_during_preview = true

Properties

settings

Rule settings for replacing this object in move mode, etc

@export var settings: ManipulatableSettings

build_cost_rule

Optional build-cost label for refund-on-demolish: points at the same saved [SpendMaterialsRuleById] resource the placement pipeline spends from, so cost has one source of truth. Lives here (per-object node, not the shared [ManipulatableSettings] resource) because demolishability and refund value are the same concern — an object without a Manipulatable cannot be demolished at all. ScenePlacementEntry-backed scenes can leave this empty: [PlaceableInstance] already resolves their costs. See [method BuildCost.resolve_for] for the precedence order.

@export var build_cost_rule: SpendMaterialsRuleById

root

The root of the object that should be manipulated by any actions. This manipulatable component is usually a child of the root.

@export var root: Node :

current

var current: Node = self

copy

var copy = root.duplicate()

copy_manipulatable

var copy_manipulatable: Manipulatable = PlacementSearchUtils.find_first(copy, Manipulatable)

issues

var issues: Array[String] = []

issues

var issues: Array[String] = []

null_issues

var null_issues: Array[String] = PlacementValidation.check_not_null(self, ["root"])

new_transform

var new_transform: Transform2D = root.global_transform if root else Transform2D.IDENTITY

root_2d

var root_2d = root as Node2D

Methods

resolve_placement_dependencies

func resolve_placement_dependencies(p_container : PlacementContainer) -> void:

Parameters

p_container

Returns

get_logger

func get_logger() -> PlacementLogger:

Returns

is_root_hierarchy_valid

func is_root_hierarchy_valid() -> bool:

Returns

create_copy

func create_copy(p_name_postfix : String) -> Manipulatable:

Parameters

p_name_postfix

Returns

get_move_rules

func get_move_rules() -> Array[TileCheckRule]:

Returns

is_demolishable

func is_demolishable() -> bool:

Returns

is_movable

func is_movable() -> bool:

Returns

validate_setup

func validate_setup() -> bool:

Returns

get_issues

func get_issues() -> Array[String]:

Returns

complete_manipulation

func complete_manipulation( p_position: Vector2,

Events

manipulation_finished

Emitted when this object's manipulation is finished (placed/moved) This allows the root object to respond to being manipulated Parameters: - old_transform: Transform2D - The transform before manipulation - new_transform: Transform2D - The transform after manipulation

signal manipulation_finished(old_transform: Transform2D, new_transform: Transform2D)