feat(city): Add controlled property accessors to City class for external rendering systems

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-04-10 09:44:51 -07:00
parent fee70d5b0b
commit 17535ddc69

View file

@ -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: