package entity

// Faction represents a team/contender in the sportsbook.
type Faction struct {
	ID                 string             `json:"id"`
	Name               string             `json:"name"`
	Abbreviation       string             `json:"abbreviation"`
	Type               FactionType        `json:"type"`
	Homeworld          string             `json:"homeworld"`
	ColorCode          string             `json:"colorCode"`
	EmblemGlyph        string             `json:"emblemGlyph"`
	BaseShieldStrength int                `json:"baseShieldStrength"`
	BaseAttackPower    int                `json:"baseAttackPower"`
	BaseEvasion        int                `json:"baseEvasion"`
	RivalryModifiers   map[string]float64 `json:"rivalryModifiers"`
}

// FactionType defines the combat archetype.
type FactionType string

const (
	FactionTypeAggressive  FactionType = "aggressive"
	FactionTypeDefensive   FactionType = "defensive"
	FactionTypeTactical    FactionType = "tactical"
	FactionTypeInfiltrator FactionType = "infiltrator"
	FactionTypeSwarm       FactionType = "swarm"
)

// FactionState represents a faction's live combat state within a match.
type FactionState struct {
	ID               string         `json:"id"`
	Name             string         `json:"name"`
	Abbreviation     string         `json:"abbreviation"`
	Type             FactionType    `json:"type"`
	Glyph            string         `json:"glyph"`
	ColorCode        string         `json:"colorCode"`
	ShieldCapacity   float64        `json:"shieldCapacity"`
	EffectiveAttack  float64        `json:"effectiveAttack"`
	EffectiveEvasion float64        `json:"effectiveEvasion"`
	ActiveEffects    []ActiveEffect `json:"activeEffects"`
}

// ActiveEffect represents a temporary buff/debuff on a faction.
type ActiveEffect struct {
	Name           string  `json:"name"`
	RemainingTicks int     `json:"remainingTicks"`
	Stat           string  `json:"stat"`
	Operation      string  `json:"operation"`
	Value          float64 `json:"value"`
}
