manipulation_system_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Test Suite: Manipulation System Integration Tests

Source File: /addons/grid_building/test/integration/system_interactions/manipulation_system_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: manipulatable_settings_all_allowed: [ManipulatableSettings](./manipulatable-settings/) = load("res://addons/grid_building/test/resources/settings/manipulatable/manipulatable_settings_all_allowed.tres")
  • Property: manipulatable_settings_none_allowed: [ManipulatableSettings](./manipulatable-settings/) = load("res://addons/grid_building/test/resources/settings/manipulatable/manipulatable_settings_none_allowed.tres")
  • Property: rules_2_rules_1_tile_check: [ManipulatableSettings](./manipulatable-settings/) = load("res://addons/grid_building/test/resources/settings/manipulation_settings_2_rules_1_tile_check.tres")
  • Property: runner: GdUnitSceneRunner
  • Property: test_hierarchy: [AllSystemsTestEnvironment](./all-systems-test-environment/)
  • Property: system: [ManipulationSystem](./manipulation-system/)
  • Property: manipulation_state: [ManipulationState](./manipulation-state/)
  • Property: all_manipulatable: [Manipulatable](./manipulatable/)
  • Property: manipulation_hierarchy: Dictionary[String, Node]

Private Properties

  • Property: _container: [GBCompositionContainer](./gb-composition-container/) (private)

Constants

  • Constant: ManipulationSystem = preload('res://addons/grid_building/systems/manipulation/manipulation_system.gd')
  • Constant: ROTATION_INCREMENT: float = 45.0
  • Constant: ROTATION_PRECISION: float = 0.0001
  • Constant: SCALE_PRECISION: float = 0.01
  • Constant: POSITION_PRECISION: float = 0.01
  • Constant: NEGATIVE_ROTATION_INCREMENT: float = -33.3333
  • Constant: ROTATION_RANGE_MIN: float = -360.0
  • Constant: ROTATION_RANGE_MAX: float = 360.0
  • Constant: TEST_POSITION: Vector2 = Vector2(8.0, 8.0) - TEST CONFIGURATION
  • Constant: CANCEL_TEST_POSITION: Vector2i = Vector2i(100, -100)
  • Constant: ROTATION_ITERATIONS: int = 10
  • Constant: ALL_SYSTEMS_ENV_PATH: String = GBTestConstants.ALL_SYSTEMS_ENV_PATH

Public Methods

before

1
before() -> void

before_test

1
before_test() -> void

after

1
after() -> void

setup_targeting_state

1
setup_targeting_state() -> void

Sets up the GridTargetingState with a default target for manipulation system tests


instance_manipulatable_hierarchy

1
instance_manipulatable_hierarchy() -> Dictionary[String, Node]

test_cancel

1
test_cancel() -> void

test_failed_placement_with_invalid_move_data_cleans_up

1
test_failed_placement_with_invalid_move_data_cleans_up() -> void

Test: Failed placement due to collision should NOT execute move and should clean up target REGRESSION TEST: Verify that try_placement() properly cleans up when ManipulationData is invalid.

Bug: Both failure paths in try_placement() were missing cleanup logic:

  1. p_move.is_valid() == false (invalid ManipulationData)
  2. validation_results.is_successful == false (collision/rule failures)

Before fix: Failed placements would leave target copies in scene and status would be wrong. After fix: Both paths call tear_down() and cleanup_manipulation_objects()

NOTE: This test checks path #1 (invalid ManipulationData). Path #2 (collision failures) is tested implicitly by other manipulation tests that use the validation system.


test_flip_horizontal

1
test_flip_horizontal() -> void

create_positioned_node

1
2
3
4
create_positioned_node(
    node_name: String,
    position: Vector2
) -> Node2D

Creates a positioned Node2D for testing - reduces code duplication


create_test_manipulatable

1
create_test_manipulatable(p_settings: ManipulatableSettings) -> Manipulatable

Creates a test manipulatable with proper validation - used 3+ times


create_test_move_data

1
create_test_move_data(p_settings: ManipulatableSettings) -> ManipulationData

Creates move data for testing - replaces _create_move_data with better validation


validate_manipulation_data

1
2
3
4
validate_manipulation_data(
    data: ManipulationData,
    context: String
) -> void

Validates manipulation data to prevent null reference errors - used 3+ times


validate_manipulatable_for_transform

1
2
3
4
validate_manipulatable_for_transform(
    p_manipulatable: Manipulatable,
    operation: String
) -> void

Validates manipulatable for transform operations - prevents null errors


normalize_rotation

1
normalize_rotation(rotation_degrees: float) -> float

Normalizes rotation degrees to 0-360 range - mathematical utility


after_test

1
after_test() -> void


Grid Building v5.0.8 | Generated 24/05/2026