ai

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAIFile

func IsAIFile(content []byte) bool

IsAIFile checks if the content looks like a TA / TA: Kingdoms AI profile file. TA's own AI files always carry per-difficulty `plan <name>` blocks; TA: Kingdoms profiles often skip them and list weights/limits directly, so a single weight or limit directive is enough to identify the file.

Types

type AIFile

type AIFile struct {
	Plans []DifficultyPlan
}

AIFile represents a complete AI configuration file

func Parse

func Parse(content []byte) (*AIFile, error)

Parse parses an AI file from bytes

type Difficulty

type Difficulty int

Difficulty represents a game difficulty level

const (
	Easy Difficulty = iota
	Medium
	Hard
)

func (Difficulty) String

func (d Difficulty) String() string

type DifficultyPlan

type DifficultyPlan struct {
	Name    string       // e.g., "easy", "medium", "hard"
	Weights []UnitWeight // Weight directives
	Limits  []UnitLimit  // Limit directives
}

DifficultyPlan represents AI configuration for one difficulty level

type UnitLimit

type UnitLimit struct {
	UnitName string
	Maximum  int
}

UnitLimit represents a unit's build limit

type UnitWeight

type UnitWeight struct {
	UnitName string
	Weight   float64
}

UnitWeight represents a unit's weight value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL