systems

package
v0.0.0-...-65675ae Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AreaOccupySystem

type AreaOccupySystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewAreaOccupySystem

func NewAreaOccupySystem(base BaseSystem) *AreaOccupySystem

func (*AreaOccupySystem) Add

func (t *AreaOccupySystem) Add(entity areaOccupyEntity)

func (*AreaOccupySystem) HandleEvent

func (t *AreaOccupySystem) HandleEvent(e engine.Event)

func (*AreaOccupySystem) Remove

func (t *AreaOccupySystem) Remove(entity engine.Entity)

func (AreaOccupySystem) Start

func (t AreaOccupySystem) Start()

func (AreaOccupySystem) Update

func (t AreaOccupySystem) Update(dt float64)

type AreaSystem

type AreaSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewAreaSystem

func NewAreaSystem(base BaseSystem) *AreaSystem

func (*AreaSystem) Add

func (a *AreaSystem) Add(entity areaEntity)

func (*AreaSystem) HandleEvent

func (a *AreaSystem) HandleEvent(e engine.Event)

func (*AreaSystem) Remove

func (a *AreaSystem) Remove(entity engine.Entity)

func (AreaSystem) Start

func (a AreaSystem) Start()

func (*AreaSystem) Update

func (a *AreaSystem) Update(dt float64)

type BaseSystem

type BaseSystem struct {
	Config   Config
	EventBus *engine.EventBus
	Spawner  Spawner
}

func NewBaseSystem

func NewBaseSystem(config Config, eventBus *engine.EventBus, systemsProvider systemsProvider) BaseSystem

type BuildingControlSystem

type BuildingControlSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewBuildingControlSystem

func NewBuildingControlSystem(base BaseSystem) *BuildingControlSystem

func (*BuildingControlSystem) Add

func (b *BuildingControlSystem) Add(entity buildingControlEntity)

func (*BuildingControlSystem) HandleEvent

func (b *BuildingControlSystem) HandleEvent(e engine.Event)

func (*BuildingControlSystem) Remove

func (b *BuildingControlSystem) Remove(entity engine.Entity)

func (*BuildingControlSystem) ShowBuildPanel

func (b *BuildingControlSystem) ShowBuildPanel()

func (*BuildingControlSystem) Start

func (b *BuildingControlSystem) Start()

func (*BuildingControlSystem) Update

func (b *BuildingControlSystem) Update(dt float64)

type ButtonsSystem

type ButtonsSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewButtonsSystem

func NewButtonsSystem(base BaseSystem) *ButtonsSystem

func (*ButtonsSystem) Add

func (b *ButtonsSystem) Add(entity buttonsEntity)

func (*ButtonsSystem) HandleEvent

func (b *ButtonsSystem) HandleEvent(e engine.Event)

func (ButtonsSystem) Remove

func (b ButtonsSystem) Remove(entity engine.Entity)

func (*ButtonsSystem) Start

func (b *ButtonsSystem) Start()

func (ButtonsSystem) Update

func (b ButtonsSystem) Update(dt float64)

type ClickReleased

type ClickReleased struct {
}

type ClickingSystem

type ClickingSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewClickingSystem

func NewClickingSystem(base BaseSystem) *ClickingSystem

func (*ClickingSystem) Add

func (c *ClickingSystem) Add(entity clickingEntity)

func (*ClickingSystem) Remove

func (c *ClickingSystem) Remove(entity engine.Entity)

func (*ClickingSystem) Start

func (c *ClickingSystem) Start()

func (*ClickingSystem) Update

func (c *ClickingSystem) Update(dt float64)

type CollisionSystem

type CollisionSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewCollisionSystem

func NewCollisionSystem(base BaseSystem) *CollisionSystem

func (*CollisionSystem) Add

func (c *CollisionSystem) Add(entity collisionEntity)

func (*CollisionSystem) HandleEvent

func (c *CollisionSystem) HandleEvent(e engine.Event)

func (*CollisionSystem) Remove

func (c *CollisionSystem) Remove(entity engine.Entity)

func (CollisionSystem) Start

func (c CollisionSystem) Start()

func (*CollisionSystem) Update

func (c *CollisionSystem) Update(dt float64)

type Config

type Config struct {
	TileMap TilemapConfig
	UI      UIConfig
}

func (Config) WindowSize

func (c Config) WindowSize() (width int, height int)

type Drawer

type Drawer interface {
	Draw(canvas engine.Sprite)
}

type DrawingSystem

type DrawingSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewDrawingSystem

func NewDrawingSystem(base BaseSystem) *DrawingSystem

func (*DrawingSystem) Add

func (d *DrawingSystem) Add(e DrawingEntity)

func (DrawingSystem) Draw

func (d DrawingSystem) Draw(screen engine.Sprite)

func (*DrawingSystem) Remove

func (d *DrawingSystem) Remove(e engine.Entity)

func (*DrawingSystem) Start

func (d *DrawingSystem) Start()

func (*DrawingSystem) Update

func (d *DrawingSystem) Update(_ float64)

type EntitiesClicked

type EntitiesClicked struct {
	Entities []engine.Entity
}

type EntitiesCollided

type EntitiesCollided struct {
	Entity engine.Entity
	Other  engine.Entity
}

type EntitiesOutOfCollision

type EntitiesOutOfCollision struct {
	Entity engine.Entity
	Other  engine.Entity
}

type EntityClicked

type EntityClicked struct {
	Entity engine.Entity
}

type EntityList

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

func (*EntityList) Add

func (l *EntityList) Add(entity engine.Entity)

func (*EntityList) All

func (l *EntityList) All() []engine.Entity

func (*EntityList) ByID

func (l *EntityList) ByID(id engine.EntityID) (engine.Entity, bool)

func (*EntityList) Clear

func (l *EntityList) Clear()

func (EntityList) Empty

func (l EntityList) Empty() bool

func (*EntityList) Remove

func (l *EntityList) Remove(entity engine.Entity)

type EntityMap

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

func (*EntityMap) Add

func (m *EntityMap) Add(entity engine.Entity)

func (*EntityMap) All

func (m *EntityMap) All() []engine.Entity

func (*EntityMap) ByID

func (m *EntityMap) ByID(id engine.EntityID) (engine.Entity, bool)

func (*EntityMap) Clear

func (m *EntityMap) Clear()

func (EntityMap) Empty

func (m EntityMap) Empty() bool

func (*EntityMap) Remove

func (m *EntityMap) Remove(entity engine.Entity)

type EntityMoved

type EntityMoved struct {
	Entity engine.Entity
}

type EntityOccupiedArea

type EntityOccupiedArea struct {
	Entity engine.Entity
	Area   engine.Entity
}

type EntityReachedTarget

type EntityReachedTarget struct {
	Entity engine.Entity
}

type EntitySelected

type EntitySelected struct {
	Entity engine.Entity
}

type EntityStoppedOccupyingArea

type EntityStoppedOccupyingArea struct {
	Entity engine.Entity
	Area   engine.Entity
}

type EntityUnselected

type EntityUnselected struct {
	Entity engine.Entity
}

type PointClicked

type PointClicked struct {
	Point engine.Vector
}

type ProgressBarSystem

type ProgressBarSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewProgressBarSystem

func NewProgressBarSystem(base BaseSystem) *ProgressBarSystem

func (*ProgressBarSystem) Add

func (p *ProgressBarSystem) Add(entity progressBarEntity)

func (*ProgressBarSystem) Remove

func (p *ProgressBarSystem) Remove(entity engine.Entity)

func (ProgressBarSystem) Start

func (p ProgressBarSystem) Start()

func (ProgressBarSystem) Update

func (p ProgressBarSystem) Update(dt float64)

type ResourcesSystem

type ResourcesSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewResourcesSystem

func NewResourcesSystem(base BaseSystem) *ResourcesSystem

func (*ResourcesSystem) Add

func (r *ResourcesSystem) Add(entity resourcesEntity)

func (*ResourcesSystem) HandleEvent

func (r *ResourcesSystem) HandleEvent(e engine.Event)

func (*ResourcesSystem) Remove

func (r *ResourcesSystem) Remove(entity engine.Entity)

func (*ResourcesSystem) Start

func (r *ResourcesSystem) Start()

func (ResourcesSystem) Update

func (r ResourcesSystem) Update(dt float64)

type ResourcesUpdated

type ResourcesUpdated struct {
	UsedResources      components.Resources
	AvailableResources components.Resources
}

type SelectionSystem

type SelectionSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewSelectionSystem

func NewSelectionSystem(base BaseSystem) *SelectionSystem

func (*SelectionSystem) Add

func (s *SelectionSystem) Add(entity selectionEntity)

func (*SelectionSystem) HandleEvent

func (s *SelectionSystem) HandleEvent(e engine.Event)

func (SelectionSystem) Remove

func (s SelectionSystem) Remove(entity engine.Entity)

func (*SelectionSystem) Start

func (s *SelectionSystem) Start()

func (*SelectionSystem) Update

func (s *SelectionSystem) Update(dt float64)

type Spawner

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

func NewSpawner

func NewSpawner(systemsProvider systemsProvider) Spawner

func (Spawner) Destroy

func (s Spawner) Destroy(e engine.Entity)

func (Spawner) Spawn

func (s Spawner) Spawn(e engine.Entity)

type System

type System interface {
	Start()
	Update(dt float64)
	Remove(entity engine.Entity)
}

type TilemapConfig

type TilemapConfig struct {
	OffsetX int
	OffsetY int

	Width  int
	Height int

	TileWidth  int
	TileHeight int
}

func (TilemapConfig) TotalHeight

func (t TilemapConfig) TotalHeight() int

func (TilemapConfig) TotalWidth

func (t TilemapConfig) TotalWidth() int

type TilemapSystem

type TilemapSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewTilemapSystem

func NewTilemapSystem(base BaseSystem) *TilemapSystem

func (TilemapSystem) Remove

func (t TilemapSystem) Remove(e engine.Entity)

func (*TilemapSystem) Start

func (t *TilemapSystem) Start()

func (TilemapSystem) TileAtPosition

func (t TilemapSystem) TileAtPosition(position engine.Vector) (tiles.Tile, bool)

func (TilemapSystem) Update

func (t TilemapSystem) Update(_ float64)

type TimeActionsSystem

type TimeActionsSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewTimeActionsSystem

func NewTimeActionsSystem(base BaseSystem) *TimeActionsSystem

func (*TimeActionsSystem) Add

func (t *TimeActionsSystem) Add(entity timeActionsEntity)

func (*TimeActionsSystem) Remove

func (t *TimeActionsSystem) Remove(entity engine.Entity)

func (*TimeActionsSystem) Start

func (t *TimeActionsSystem) Start()

func (*TimeActionsSystem) Update

func (t *TimeActionsSystem) Update(dt float64)

type UIConfig

type UIConfig struct {
	OffsetX int
	OffsetY int

	Width  int
	Height int

	Font font.Face
}

type UISystem

type UISystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewUISystem

func NewUISystem(base BaseSystem) *UISystem

func (UISystem) HandleEvent

func (u UISystem) HandleEvent(e engine.Event)

func (UISystem) Remove

func (u UISystem) Remove(entity engine.Entity)

func (*UISystem) Start

func (u *UISystem) Start()

func (UISystem) Update

func (u UISystem) Update(_ float64)

type UnitControlSystem

type UnitControlSystem struct {
	BaseSystem
	// contains filtered or unexported fields
}

func NewUnitControlSystem

func NewUnitControlSystem(base BaseSystem, tileFinder tileFinder) *UnitControlSystem

func (*UnitControlSystem) Add

func (u *UnitControlSystem) Add(entity unitControlEntity)

func (*UnitControlSystem) HandleEvent

func (u *UnitControlSystem) HandleEvent(e engine.Event)

func (*UnitControlSystem) Remove

func (u *UnitControlSystem) Remove(entity engine.Entity)

func (*UnitControlSystem) Start

func (u *UnitControlSystem) Start()

func (UnitControlSystem) Update

func (u UnitControlSystem) Update(dt float64)

Jump to

Keyboard shortcuts

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