Documentation ¶
Index ¶
- Constants
- func BoundsFromSprite(sprite engine.Sprite) engine.Rect
- type Area
- type AreaOccupant
- type AreaOccupantOwner
- type AreaOwner
- type Builder
- type BuilderOption
- type BuilderOwner
- type BuildingType
- type Button
- type ButtonOwner
- type Citizen
- type Class
- type Clickable
- type ClickableOwner
- type Collider
- type ColliderOwner
- type CollisionLayer
- type Drawable
- type DrawableOwner
- type DrawingLayer
- type Movable
- type MovableOwner
- type MovementArea
- type ProgressBar
- type ProgressBarOwner
- type ProgressBarSprites
- type Resources
- type ResourcesCollector
- type ResourcesCollectorOwner
- type ResourcesSource
- type ResourcesSourceOwner
- type Selectable
- type SelectableOwner
- type SettlementType
- type Size
- type SizeOwner
- type Team
- type TimeActions
- type TimeActionsOwner
- type UIColor
- type UnitSpawner
- type UnitSpawnerOption
- type UnitSpawnerOwner
- type WorldSpace
- func (w *WorldSpace) AddChild(child WorldSpaceOwner)
- func (w WorldSpace) HasParent() bool
- func (w WorldSpace) LocalPosition() engine.Vector
- func (w *WorldSpace) SetInWorld(x float64, y float64)
- func (w *WorldSpace) SetLocal(x float64, y float64)
- func (w *WorldSpace) Translate(x float64, y float64)
- func (w WorldSpace) WorldPosition() engine.Vector
- type WorldSpaceOwner
Constants ¶
View Source
const AllLayers = 8
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Area ¶
type Area struct { Occupants int Overlay DrawableOwner }
type AreaOccupant ¶
TODO This should be a "has" relation, not "is"
type AreaOccupantOwner ¶
type AreaOccupantOwner interface {
GetAreaOccupant() *AreaOccupant
}
type Builder ¶
type Builder struct { Options []BuilderOption Queue []BuilderOption Timer *engine.CountdownTimer }
func (*Builder) AddToQueue ¶
func (b *Builder) AddToQueue(option BuilderOption)
func (*Builder) PopFromQueue ¶
func (b *Builder) PopFromQueue() (BuilderOption, bool)
type BuilderOption ¶
type BuilderOption struct { BuildingType BuildingType SpawnTime time.Duration }
type BuilderOwner ¶
type BuilderOwner interface {
GetBuilder() *Builder
}
type BuildingType ¶
type BuildingType int
const ( BuildingSettlement BuildingType = iota BuildingBarracks BuildingChapel BuildingForge BuildingTower )
type ButtonOwner ¶
type ButtonOwner interface {
GetButton() *Button
}
type Clickable ¶
type ClickableOwner ¶
type ClickableOwner interface {
GetClickable() *Clickable
}
type Collider ¶
type Collider struct { Bounds engine.Rect Layer CollisionLayer Overlay DrawableOwner // contains filtered or unexported fields }
func (*Collider) AddCollision ¶
func (*Collider) RemoveCollision ¶
type ColliderOwner ¶
type ColliderOwner interface {
GetCollider() *Collider
}
type CollisionLayer ¶
type CollisionLayer int
const ( CollisionLayerGround CollisionLayer = iota CollisionLayerUnits CollisionLayerBuildings )
type DrawableOwner ¶
type DrawableOwner interface {
GetDrawable() *Drawable
}
type DrawingLayer ¶
type DrawingLayer int
const ( LayerBackground DrawingLayer = iota LayerGround LayerObjects LayerUnits LayerForeground LayerUI LayerUIPanel LayerUIButton )
const ( UILayerBackground DrawingLayer = iota UILayerText )
type Movable ¶
func (*Movable) ClearTarget ¶
func (m *Movable) ClearTarget()
type MovableOwner ¶
type MovableOwner interface {
GetMovable() *Movable
}
type MovementArea ¶
type MovementArea struct { // TODO ? Speed float64 }
type ProgressBar ¶
type ProgressBar struct { Background ProgressBarSprites Foreground ProgressBarSprites Progress float64 }
func (*ProgressBar) SetProgress ¶
func (p *ProgressBar) SetProgress(progress float64)
type ProgressBarOwner ¶
type ProgressBarOwner interface {
GetProgressBar() *ProgressBar
}
type ProgressBarSprites ¶
type ResourcesCollector ¶
type ResourcesCollectorOwner ¶
type ResourcesCollectorOwner interface {
GetResourcesCollector() *ResourcesCollector
}
type ResourcesSource ¶
type ResourcesSource struct {
Resources Resources
}
type ResourcesSourceOwner ¶
type ResourcesSourceOwner interface {
GetResourcesSource() *ResourcesSource
}
type Selectable ¶
type Selectable struct { Selected bool Overlay DrawableOwner }
func (*Selectable) Select ¶
func (s *Selectable) Select()
func (*Selectable) Unselect ¶
func (s *Selectable) Unselect()
type SelectableOwner ¶
type SelectableOwner interface {
GetSelectable() *Selectable
}
type SettlementType ¶
type SettlementType int
const ( SettlementColony SettlementType = iota SettlementVillage SettlementCastle )
type TimeActions ¶
type TimeActions struct {
Timers []*engine.CountdownTimer
}
func (*TimeActions) AddTimer ¶
func (t *TimeActions) AddTimer(timer *engine.CountdownTimer)
type TimeActionsOwner ¶
type TimeActionsOwner interface {
GetTimeActions() *TimeActions
}
type UnitSpawner ¶
type UnitSpawner struct { Options []UnitSpawnerOption Queue []UnitSpawnerOption Timer *engine.CountdownTimer }
func (*UnitSpawner) AddToQueue ¶
func (u *UnitSpawner) AddToQueue(option UnitSpawnerOption)
func (*UnitSpawner) PopFromQueue ¶
func (u *UnitSpawner) PopFromQueue() (UnitSpawnerOption, bool)
type UnitSpawnerOption ¶
type UnitSpawnerOwner ¶
type UnitSpawnerOwner interface {
GetUnitSpawner() *UnitSpawner
}
type WorldSpace ¶
type WorldSpace struct { Parent *WorldSpace Children []WorldSpaceOwner // contains filtered or unexported fields }
func (*WorldSpace) AddChild ¶
func (w *WorldSpace) AddChild(child WorldSpaceOwner)
func (WorldSpace) HasParent ¶
func (w WorldSpace) HasParent() bool
func (WorldSpace) LocalPosition ¶
func (w WorldSpace) LocalPosition() engine.Vector
func (*WorldSpace) SetInWorld ¶
func (w *WorldSpace) SetInWorld(x float64, y float64)
func (*WorldSpace) SetLocal ¶
func (w *WorldSpace) SetLocal(x float64, y float64)
func (*WorldSpace) Translate ¶
func (w *WorldSpace) Translate(x float64, y float64)
func (WorldSpace) WorldPosition ¶
func (w WorldSpace) WorldPosition() engine.Vector
type WorldSpaceOwner ¶
type WorldSpaceOwner interface {
GetWorldSpace() *WorldSpace
}
Click to show internal directories.
Click to hide internal directories.