strategy

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackStrategy

type AttackStrategy struct {
	Name        string
	Description string
	DeployLine  string
	Sides       int
	DropOrders  []Drop
}

func ParseCSV

func ParseCSV(path string) (*AttackStrategy, error)

func (AttackStrategy) AllTroops

func (s AttackStrategy) AllTroops() []string

func (AttackStrategy) TroopCount

func (s AttackStrategy) TroopCount(troop string) int

type Drop

type Drop struct {
	X, Y     int
	Troop    string
	Quantity int
	Delay    int
	Slot     int
	DropType string
	Wave     int
}

type DynamicStrategy

type DynamicStrategy struct {
	Name                  string  `yaml:"name"`
	Description           string  `yaml:"description"`
	TargetEdge            string  `yaml:"target_edge"`
	Phases                []Phase `yaml:"phases"`
	AutoDeployEventTroops bool    `yaml:"auto_deploy_eventTroops"` // Auto-deploy event troops not in strategy
}

func ParseYAML

func ParseYAML(path string) (*DynamicStrategy, error)

type Phase

type Phase struct {
	Name             string `yaml:"name"`
	Units            []Unit `yaml:"units"`
	Pattern          string `yaml:"pattern"`  // "Line", "Point", "FourSides"
	Position         string `yaml:"position"` // "Center", "Left", "Right", "Full"
	Offset           int    `yaml:"offset"`
	DelayAfterMS     int    `yaml:"delay_after_ms"`
	Retry            int    `yaml:"retry"`              // Max retry attempts per unit (default: 3)
	VerifyBeforeNext bool   `yaml:"verify_before_next"` // Wait for slot empty before next phase
}

type Unit

type Unit struct {
	Name         string `yaml:"name"`
	Amount       string `yaml:"amount"`        // Can be "All" or a number
	Pattern      string `yaml:"pattern"`       // Optional: Override phase pattern (e.g., "Ability")
	FallbackSlot int    `yaml:"fallback_slot"` // Optional: Deterministic slot index (1-based)
	Offset       int    `yaml:"offset"`        // Optional: Per-unit inward offset
}

Jump to

Keyboard shortcuts

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