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>
22 lines
478 B
GDScript
22 lines
478 B
GDScript
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", ""))
|