feat(client): id helper + leaf canon-log entities with owned invariants
Also configure GUT to not treat push_error() as a test failure (client/.gutconfig.json: failure_error_types = [engine, gut]). The brief's LogPlayer/Quest setters intentionally push_error() on rejected input; GUT's default failure_error_types includes push_error, which would fail test_player_rejects_unknown_class and test_quest_status_enum despite their assertions passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
client/scripts/canon_log/log_location.gd
Normal file
21
client/scripts/canon_log/log_location.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name LogLocation
|
||||
extends RefCounted
|
||||
## A canon-log location row: id (code key) + name (prose).
|
||||
|
||||
var id: String
|
||||
var name: String
|
||||
|
||||
|
||||
func _init(p_id := "", p_name := "") -> void:
|
||||
if p_id != "" and not Ids.is_valid(p_id):
|
||||
push_error("invalid location id: %s" % p_id)
|
||||
id = p_id
|
||||
name = p_name
|
||||
|
||||
|
||||
func to_dict() -> Dictionary:
|
||||
return {"id": id, "name": name}
|
||||
|
||||
|
||||
static func from_dict(d: Dictionary) -> LogLocation:
|
||||
return LogLocation.new(d.get("id", ""), d.get("name", ""))
|
||||
Reference in New Issue
Block a user