Files
code_of_conquest_dnd/client/scripts/canon_log/party_member.gd
Phillip Tarrant a682022f17 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>
2026-07-09 14:12:16 -05:00

26 lines
611 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class_name PartyMember
extends RefCounted
## A companion row. Owns the disposition clamp (100..100, charter §9).
var id: String
var name: String
var disposition: int
func _init(p_id := "", p_name := "", p_disposition := 0) -> void:
id = p_id
name = p_name
set_disposition(p_disposition)
func set_disposition(v: int) -> void:
disposition = clampi(v, -100, 100)
func to_dict() -> Dictionary:
return {"id": id, "name": name, "disposition": disposition}
static func from_dict(d: Dictionary) -> PartyMember:
return PartyMember.new(d.get("id", ""), d.get("name", ""), int(d.get("disposition", 0)))