PlacementRule

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Base class for placement validation conditions.

Source File: addons/grid_building/placement/placement_rules/placement_rule.gd

Extends: GBResource

Private Properties

  • Property: _grid_targeting_state : [GridTargetingState](./grid-targeting-state/) (private)
  • Property: _ready : bool = false (private) - Whether the rule is ready for use.

Constants

  • Constant: REASON_VIRTUAL : String = "This is a virtual condition function and should be implemented in a class that inherits from PlacementRule"

Public Methods

validate_placement

1
validate_placement() -> RuleResult

Checks a set of shape casts for building validity and returns whether the condition has been met or not


setup

1
setup(p_gts : GridTargetingState) -> Array[String]

The base function sets the grid targeting state for context which sources the target object being placed and the placer. Returns any issues found in the setup as an Array[String].

p_gts: GridTargetingState - Holds contextual state information for what is being targeted for placement and who is doing the placing


apply

1
apply() -> Array[String]

Optional code to be executed if this and all other tested rules validate successfully


tear_down

1
tear_down() -> void

Any cleanup code to run after the system changes preview instances or stops building Runs before the building system changes placeable preview


get_editor_issues

1
get_editor_issues() -> Array[String]

Returns an array of issues found during editor validation


get_runtime_issues

1
get_runtime_issues() -> Array[String]

Returns an array of issues found during runtime validation


Private Methods

_to_string

1
_to_string() -> String

Flags: private