unit

package
v0.0.0-...-75eaa32 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHealth

func CompareHealth(a, b Health) int

func MeanWoundsRemaining

func MeanWoundsRemaining(dist prob.Dist[Health]) *big.Rat

Types

type Battle

type Battle struct {
	// contains filtered or unexported fields
}

func NewBattle

func NewBattle() *Battle

func (*Battle) NewUnit

func (b *Battle) NewUnit(tpl *UnitTemplate) *Unit

func (*Battle) StringKey

func (b *Battle) StringKey() string

type BattleID

type BattleID struct {
	// contains filtered or unexported fields
}

func (BattleID) StringKey

func (id BattleID) StringKey() string

type Health

type Health []int64

func (Health) ModelsRemaining

func (mh Health) ModelsRemaining() int64

func (Health) StringKey

func (mh Health) StringKey() string

func (Health) ToDist

func (mh Health) ToDist() prob.Dist[Health]

func (Health) WithDamage

func (mh Health) WithDamage(idx int, damage int64) Health

func (Health) WoundsRemaining

func (mh Health) WoundsRemaining() int64

type Model

type Model struct {
	// contains filtered or unexported fields
}

func (*Model) Datasheet

func (i *Model) Datasheet() Datasheet

func (*Model) IsAlive

func (m *Model) IsAlive(health Health) bool

func (*Model) Points

func (m *Model) Points() float64

func (*Model) PointsLost

func (m *Model) PointsLost(health Health) float64

func (*Model) StringKey

func (i *Model) StringKey() string

func (*Model) WeaponProfiles

func (m *Model) WeaponProfiles() [][]*WeaponProfile

func (*Model) Weapons

func (m *Model) Weapons() []*Weapon

type ModelDatasheet

type ModelDatasheet struct {
	Name       string
	Toughness  int64
	Save       int64
	InvulnSave int64
	Wounds     int64
	Leadership int64
}

type ModelID

type ModelID struct {
	// contains filtered or unexported fields
}

func (ModelID) StringKey

func (id ModelID) StringKey() string

type ModelTemplate

type ModelTemplate struct {
	Weapons []*WeaponTemplate
	// contains filtered or unexported fields
}

func NewModelTemplate

func NewModelTemplate(stats ModelDatasheet, weapons ...*WeaponTemplate) *ModelTemplate

func (ModelTemplate) Datasheet

func (tpl ModelTemplate) Datasheet() D

type Unit

type Unit struct {
	// contains filtered or unexported fields
}

func (*Unit) Datasheet

func (i *Unit) Datasheet() Datasheet

func (*Unit) Models

func (u *Unit) Models() []*Model

func (*Unit) PointsLost

func (u *Unit) PointsLost(health Health) float64

func (*Unit) StartingHealth

func (u *Unit) StartingHealth() Health

func (*Unit) StringKey

func (i *Unit) StringKey() string

func (*Unit) SurvivingModels

func (u *Unit) SurvivingModels(health Health) []*Model

func (*Unit) SurvivingWeapons

func (u *Unit) SurvivingWeapons(health Health) *util.OrderedMap[*WeaponKind, []*Weapon]

func (*Unit) Toughness

func (u *Unit) Toughness(health Health) int64

func (*Unit) WeaponKinds

func (u *Unit) WeaponKinds() []*WeaponKind

func (*Unit) WeaponProfiles

func (u *Unit) WeaponProfiles() [][]*WeaponProfile

type UnitDatasheet

type UnitDatasheet struct {
	Name       string
	PointsCost int
}

type UnitID

type UnitID struct {
	// contains filtered or unexported fields
}

func (UnitID) StringKey

func (id UnitID) StringKey() string

type UnitTemplate

type UnitTemplate struct {
	Models []*ModelTemplate
	// contains filtered or unexported fields
}

func NewUnitTemplate

func NewUnitTemplate(stats UnitDatasheet, models ...*ModelTemplate) *UnitTemplate

func (UnitTemplate) Datasheet

func (tpl UnitTemplate) Datasheet() D

type Weapon

type Weapon struct {
	// contains filtered or unexported fields
}

func (*Weapon) Datasheet

func (i *Weapon) Datasheet() Datasheet

func (*Weapon) Kind

func (w *Weapon) Kind() *WeaponKind

func (*Weapon) Profiles

func (w *Weapon) Profiles() []*WeaponProfile

func (*Weapon) StringKey

func (i *Weapon) StringKey() string

type WeaponDatasheet

type WeaponDatasheet struct {
	Name string
}

type WeaponID

type WeaponID struct {
	// contains filtered or unexported fields
}

func (WeaponID) StringKey

func (id WeaponID) StringKey() string

type WeaponKind

type WeaponKind struct {
	// contains filtered or unexported fields
}

func (*WeaponKind) Datasheet

func (i *WeaponKind) Datasheet() Datasheet

func (*WeaponKind) Profiles

func (wk *WeaponKind) Profiles() []*WeaponProfileKind

func (*WeaponKind) StringKey

func (i *WeaponKind) StringKey() string

type WeaponKindID

type WeaponKindID struct {
	// contains filtered or unexported fields
}

func (WeaponKindID) StringKey

func (id WeaponKindID) StringKey() string

type WeaponProfile

type WeaponProfile struct {
	// contains filtered or unexported fields
}

func (*WeaponProfile) Datasheet

func (i *WeaponProfile) Datasheet() Datasheet

func (*WeaponProfile) Kind

func (wp *WeaponProfile) Kind() *WeaponProfileKind

func (*WeaponProfile) StringKey

func (i *WeaponProfile) StringKey() string

type WeaponProfileDatasheet

type WeaponProfileDatasheet struct {
	Name             string
	RangeInches      int64
	Attacks          value.Interface
	Skill            int64
	Strength         value.Interface
	ArmorPenetration int64
	Damage           value.Interface
	LethalHits       bool
	SustainedHits    int64
}

type WeaponProfileID

type WeaponProfileID struct {
	// contains filtered or unexported fields
}

func (WeaponProfileID) StringKey

func (id WeaponProfileID) StringKey() string

type WeaponProfileKind

type WeaponProfileKind struct {
	// contains filtered or unexported fields
}

func (*WeaponProfileKind) Datasheet

func (i *WeaponProfileKind) Datasheet() Datasheet

func (*WeaponProfileKind) StringKey

func (i *WeaponProfileKind) StringKey() string

type WeaponProfileKindID

type WeaponProfileKindID struct {
	// contains filtered or unexported fields
}

func (WeaponProfileKindID) StringKey

func (id WeaponProfileKindID) StringKey() string

type WeaponProfileTemplate

type WeaponProfileTemplate struct {
	// contains filtered or unexported fields
}

func NewWeaponProfileTemplate

func NewWeaponProfileTemplate(stats WeaponProfileDatasheet) *WeaponProfileTemplate

func (WeaponProfileTemplate) Datasheet

func (tpl WeaponProfileTemplate) Datasheet() D

type WeaponTemplate

type WeaponTemplate struct {
	Profiles []*WeaponProfileTemplate
	// contains filtered or unexported fields
}

func NewWeaponTemplate

func NewWeaponTemplate(stats WeaponDatasheet, profiles ...*WeaponProfileTemplate) *WeaponTemplate

func (WeaponTemplate) Datasheet

func (tpl WeaponTemplate) Datasheet() D

Jump to

Keyboard shortcuts

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