# src/core/rule_config.gd
class_name RuleConfig
extends RefCounted

const BOMB_BY_RANK := 0
const BOMB_BY_COUNT := 1

const TEAM_FIXED_1_3 := 0
const TEAM_RANDOM := 1

var same_suit_straight_beats_bomb: bool = true
var double_down_levels: int = 3
var can_tribute_wild: bool = false
var tribute_return_max_rank: int = 10
var straight_extends_to_ace: bool = true
var bomb_compare_priority: int = BOMB_BY_RANK
var wild_count: int = 2
var team_formation: int = TEAM_FIXED_1_3

static func standard() -> RuleConfig:
    var c := RuleConfig.new()
    return c

static func huaian() -> RuleConfig:
    var c := RuleConfig.new()
    c.same_suit_straight_beats_bomb = false
    c.straight_extends_to_ace = false
    return c

func to_hash_data() -> Dictionary:
    return {
        "same_suit_bomb": same_suit_straight_beats_bomb,
        "double_down": double_down_levels,
        "can_tribute_wild": can_tribute_wild,
        "tribute_return_max": tribute_return_max_rank,
        "straight_ace": straight_extends_to_ace,
        "bomb_compare": bomb_compare_priority,
        "wild_count": wild_count,
        "team": team_formation
    }
