Versions in this module Expand all Collapse all v0 v0.2.1 Apr 10, 2024 v0.2.0 Mar 25, 2024 Changes in this version + type EditorMode struct + IsEditor bool + type RandomTerrains struct + AllowRemove []bool + Terrains []terr.Terrain + TotalAvailable int + TotalPlaced int type Rules + InitialRandomTerrains int type SaveEvent + ShouldQuit bool + ShouldSaveMap bool + type SaveTime struct + Time time.Time + type Screen struct + Height int + Image *ebiten.Image + Width int type Selection + Randomize bool type Sprites + TextHighlightColor color.RGBA type Stock + Total []int + func (s *Stock) AddResources(res resource.Resource, amount int) type UI + func (ui *UI) DisableButton(id terr.Terrain, message string) + func (ui *UI) Draw(screen *ebiten.Image) + func (ui *UI) EnableButton(id terr.Terrain) + func (ui *UI) SetRandomTilesLabel(text string) + func (ui *UI) SetStatusLabel(text string) + func (ui *UI) Update() v0.1.0 Mar 10, 2024 Changes in this version + type Buildable struct + func NewBuildable(w, h int) Buildable + func (b *Buildable) NeighborsMask(x, y int) (terr.Directions, terr.Directions) + type EbitenImage struct + Height int + Image *ebiten.Image + Width int + type EntityFactory struct + func NewEntityFactory(world *ecs.World) EntityFactory + func (f *EntityFactory) RemoveLandUse(world *ecs.World, x, y int) + func (f *EntityFactory) Set(world *ecs.World, x, y int, value terr.Terrain, randSprite uint16) ecs.Entity + func (f *EntityFactory) SetBuildable(x, y, r int, build bool) + type Fonts struct + Default font.Face + Title font.Face + func NewFonts(fSys fs.FS) Fonts + type GameSpeed struct + MaxSpeed int8 + MinSpeed int8 + Pause bool + Speed int8 + type GameTick struct + RenderTick int64 + Tick int64 + type Grid struct + func NewGrid[T comparable](width, height int) Grid[T] + func (g *Grid[T]) Clamp(x, y int) (int, int) + func (g *Grid[T]) Contains(x, y int) bool + func (g *Grid[T]) Fill(value T) + func (g *Grid[T]) Get(x, y int) T + func (g *Grid[T]) GetPointer(x, y int) *T + func (g *Grid[T]) Height() int + func (g *Grid[T]) MarshalJSON() ([]byte, error) + func (g *Grid[T]) Set(x, y int, value T) + func (g *Grid[T]) UnmarshalJSON(data []byte) error + func (g *Grid[T]) Width() int + type LandUse struct + func NewLandUse(w, h int) LandUse + type LandUseEntities struct + type Mouse struct + IsInside bool + type Production struct + Cons []int + Prod []int + func NewProduction() Production + func (p *Production) Reset() + type RandomTerrain struct + AllowRemove bool + Terrain terr.Terrain + type Rules struct + InitialBuildRadius int + InitialPopulation int + InitialResources []int + RandomTerrains []terr.Terrain + RandomTerrainsCount int + SpecialCardProbability float64 + WorldSize int + func NewRules(f fs.FS, file string) Rules + type SaveEvent struct + ShouldSave bool + type Selection struct + AllowRemove bool + BuildType terr.Terrain + ButtonID int + RandSprite uint16 + func (s *Selection) Reset() + func (s *Selection) SetBuild(build terr.Terrain, button int, randSprite uint16, allowRemove bool) + type Sprites struct + Background color.RGBA + TextColor color.RGBA + TileHeight int + TileWidth int + func NewSprites(fSys fs.FS, dir, tileSet string) Sprites + func (s *Sprites) Get(idx int) *ebiten.Image + func (s *Sprites) GetIndex(name string) int + func (s *Sprites) GetInfo(idx int) *util.Sprite + func (s *Sprites) GetMultiTileIndex(idx int, dirs terr.Directions, frame int, rand int) int + func (s *Sprites) GetMultiTileTerrainIndex(t terr.Terrain, dirs terr.Directions, frame int, rand int) int + func (s *Sprites) GetRand(idx int, frame int, rand int) *ebiten.Image + func (s *Sprites) GetSprite(idx int) *ebiten.Image + func (s *Sprites) GetTerrainIndex(t terr.Terrain) int + type Stock struct + Cap []int + MaxPopulation int + Population int + Res []int + func NewStock(initial []int) Stock + func (s *Stock) CanPay(cost []terr.ResourceAmount) bool + func (s *Stock) Pay(cost []terr.ResourceAmount) + type Terrain struct + func NewTerrain(w, h int) Terrain + type TerrainEntities struct + type TerrainGrid struct + func (g *TerrainGrid) CountNeighbors4(x, y int, tp terr.Terrain) int + func (g *TerrainGrid) CountNeighbors8(x, y int, tp terr.Terrain) int + func (g *TerrainGrid) CountNeighborsMask4(x, y int, tp terr.Terrains) int + func (g *TerrainGrid) CountNeighborsMask8(x, y int, tp terr.Terrains) int + func (g *TerrainGrid) NeighborsMask(x, y int, tp terr.Terrain) terr.Directions + func (g *TerrainGrid) NeighborsMaskMulti(x, y int, tp terr.Terrains) terr.Directions + func (g *TerrainGrid) NeighborsMaskMultiReplace(x, y int, tp terr.Terrains, rx, ry int, rt terr.Terrain) terr.Directions + type UI struct + RandomTerrains []RandomTerrain + func NewUI(world *ecs.World, selection *Selection, fonts *Fonts, sprts *Sprites, ...) UI + func (ui *UI) ClearSelection() + func (ui *UI) CreateRandomButtons(randomTerrains int) + func (ui *UI) MouseInside(x, y int) bool + func (ui *UI) ReplaceAllButtons(rules *Rules) + func (ui *UI) ReplaceButton(stock *Stock, rules *Rules, renderTick int64, target stdimage.Point) bool + func (ui *UI) SetButtonEnabled(id terr.Terrain, enabled bool) + func (ui *UI) SetPopulationLabel(text string) + func (ui *UI) SetResourceLabel(id resource.Resource, text string) + func (ui *UI) SetSpeedLabel(text string) + func (ui *UI) SetTimerLabel(text string) + func (ui *UI) UI() *ebitenui.UI + type UpdateInterval struct + Countdown int + Interval int64 + type View struct + MouseOffset int + TileHeight int + TileWidth int + X int + Y int + Zoom float64 + func NewView(tileWidth, tileHeight int) View + func (v *View) Bounds(w, h int) image.Rectangle + func (v *View) BoundsToGlobal(b *WorldBounds) image.Rectangle + func (v *View) Center(cell image.Point, screenWidth, screenHeight int) + func (v *View) GlobalToTile(x, y int) image.Point + func (v *View) MapBounds(screenWidth, screenHeight int) image.Rectangle + func (v *View) Offset() image.Point + func (v *View) ScreenToGlobal(x, y int) (int, int) + func (v *View) SubtileToGlobal(x, y float64) image.Point + func (v *View) TileToGlobal(x, y int) image.Point + type WorldBounds struct + func (b *WorldBounds) AddPoint(p image.Point) + func (b *WorldBounds) Contains(p image.Point) bool