terr

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Properties []TerrainProps
View Source
var SymbolToTerrain map[rune]TerrainPair
View Source
var TerrainToSymbol map[TerrainPair]rune

Functions

func IsTerrainName added in v0.2.0

func IsTerrainName(t string) bool

func Prepare

func Prepare(f fs.FS, file string)

Types

type Direction

type Direction uint8
const (
	N Direction = iota
	E
	S
	W
	EndDirection
)

func (Direction) Deltas

func (d Direction) Deltas() (int, int)

func (Direction) Opposite

func (d Direction) Opposite() Direction

type Directions

type Directions uint8

func NewDirections

func NewDirections(dirs ...Direction) Directions

func (Directions) Contains

func (d Directions) Contains(dir Direction) bool

Contains checks whether all the argument's bits are contained in this Subscription.

func (*Directions) Set

func (d *Directions) Set(dir Direction)

func (*Directions) Unset

func (d *Directions) Unset(dir Direction)

type PopulationSupport

type PopulationSupport struct {
	BasePopulation  uint8
	MaxPopulation   uint8
	RequiredTerrain Terrain
	BonusTerrain    Terrains
	MalusTerrain    Terrains
}

type Production

type Production struct {
	Resource          resource.Resource
	MaxProduction     uint8
	HaulCapacity      uint8
	RequiredTerrain   Terrain
	ProductionTerrain Terrains
}

type ResourceAmount

type ResourceAmount struct {
	Resource resource.Resource
	Amount   uint16
}

type Terrain

type Terrain uint8
var Air Terrain
var Buildable Terrain
var Bulldoze Terrain
var Default Terrain
var FirstBuilding Terrain

func TerrainID

func TerrainID(name string) (Terrain, bool)

func ToTerrain added in v0.2.0

func ToTerrain(t string) Terrain

type TerrainBit

type TerrainBit uint16
const (
	IsTerrain TerrainBit = iota
	IsPath
	IsBridge
	IsBuilding
	IsWarehouse
	CanBuild
	CanBuy
	RequiresRange
)

type TerrainBits

type TerrainBits uint16

func NewTerrainBits

func NewTerrainBits(bits ...TerrainBit) TerrainBits

func (TerrainBits) Contains

func (d TerrainBits) Contains(dir TerrainBit) bool

Contains checks whether all the argument's bits are contained in this Subscription.

func (*TerrainBits) Set

func (d *TerrainBits) Set(dir TerrainBit)

type TerrainPair added in v0.2.0

type TerrainPair struct {
	Terrain Terrain
	LandUse Terrain
}

type TerrainProps

type TerrainProps struct {
	Name              string
	BuildOn           Terrains
	ConnectsTo        Terrains
	TerrainBits       TerrainBits
	TerrainBelow      []Terrain
	UnlocksTerrains   uint16
	BuildRadius       uint8
	Population        uint8
	Description       string
	Symbols           []rune
	BuildCost         []ResourceAmount
	Storage           []uint8
	Consumption       []uint8
	Production        Production
	PopulationSupport PopulationSupport
}

type Terrains

type Terrains uint64
var Buildings Terrains
var Paths Terrains

func NewTerrains

func NewTerrains(dirs ...Terrain) Terrains

func ToTerrains added in v0.2.0

func ToTerrains(terr ...string) Terrains

func (Terrains) Contains

func (d Terrains) Contains(dir Terrain) bool

Contains checks whether all the argument's bits are contained in this mask.

func (*Terrains) Set

func (d *Terrains) Set(dir Terrain)

func (*Terrains) Unset

func (d *Terrains) Unset(dir Terrain)

Jump to

Keyboard shortcuts

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