class_name Humiliation
extends RefCounted
## A Banter-memory row (charter §9). weight 1..10 drives reference frequency;
## turn drives decay. Append-only at the container level — these stack.

var id: String
var text: String
var weight: int
var turn: int


func _init(p_id := "", p_text := "", p_weight := 1, p_turn := 0) -> void:
	id = p_id
	text = p_text
	weight = clampi(p_weight, 1, 10)
	turn = maxi(p_turn, 0)


func to_dict() -> Dictionary:
	return {"id": id, "text": text, "weight": weight, "turn": turn}


static func from_dict(d: Dictionary) -> Humiliation:
	return Humiliation.new(d.get("id", ""), d.get("text", ""), int(d.get("weight", 1)), int(d.get("turn", 0)))
