From 17535ddc69b3e2fc53144dbd28245e427913c793 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 10 Apr 2026 09:44:51 -0700 Subject: [PATCH] =?UTF-8?q?feat(city):=20=E2=9C=A8=20Add=20controlled=20pr?= =?UTF-8?q?operty=20accessors=20to=20City=20class=20for=20external=20rende?= =?UTF-8?q?ring=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/src/entities/city.gd | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/game/engine/src/entities/city.gd b/src/game/engine/src/entities/city.gd index cbf268c3..115c6aba 100644 --- a/src/game/engine/src/entities/city.gd +++ b/src/game/engine/src/entities/city.gd @@ -46,6 +46,28 @@ var production_queue: Array = [] ## Accumulated hammers toward the current production_queue[0]. var production_progress: int = 0 +# ── Property accessors (used by renderers) ───────────────────────── + +var population: int: + get: + return get_population() + +var hp: int: + get: + return get_hp() + set(v): + set_hp(v) + +var max_hp: int: + get: + return get_max_hp() + set(v): + set_max_hp(v) + +var owned_tiles: Array: + get: + return get_owned_tiles() + ## The Rust GdCity instance. var _gd_city: RefCounted = null @@ -86,29 +108,6 @@ func rename_city(new_name: String) -> void: _gd_city.call("rename", new_name) -# ── Property accessors (used by renderers) ───────────────────────── - -var population: int: - get: - return get_population() - -var hp: int: - get: - return get_hp() - set(v): - set_hp(v) - -var max_hp: int: - get: - return get_max_hp() - set(v): - set_max_hp(v) - -var owned_tiles: Array: - get: - return get_owned_tiles() - - # ── Getters (delegate to Rust) ────────────────────────────────────── func get_population() -> int: