package simulator

import "github.com/costap/quarkshologridledger/tongo-core/internal/domain/entity"

// TypeAdvantageMatrix maps attacker type × defender type to a damage multiplier.
type TypeAdvantageMatrix map[entity.FactionType]map[entity.FactionType]float64

// NewTypeAdvantageMatrix returns the default type advantage matrix.
func NewTypeAdvantageMatrix() TypeAdvantageMatrix {
	// The real implementation will hydrate this with the rock-paper-scissors values
	return make(TypeAdvantageMatrix)
}

// Get returns the advantage multiplier for the given attacker/defender pair.
func (m TypeAdvantageMatrix) Get(attacker, defender entity.FactionType) float64 {
	if attackerMap, ok := m[attacker]; ok {
		if val, ok := attackerMap[defender]; ok {
			return val
		}
	}
	return 1.0
}
