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>
26 lines
611 B
GDScript
26 lines
611 B
GDScript
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)))
|