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)))
