Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControllerSystem ¶
type ControllerSystem struct{}
func NewControllerSystem ¶
func NewControllerSystem() *ControllerSystem
func (*ControllerSystem) ShouldTrack ¶
func (c *ControllerSystem) ShouldTrack(object object.GameObject) bool
ShouldTrack returns whether
func (*ControllerSystem) Update ¶
func (c *ControllerSystem) Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error
type GameSystem ¶
type GameSystem struct {
// contains filtered or unexported fields
}
GameSystem wraps an abstract system in a well-composed system object.
func NewGameSystem ¶
func NewGameSystem(sys System) *GameSystem
NewGameSystem returns a game system from the provided struct implementing the system interface.
func (*GameSystem) Update ¶
func (b *GameSystem) Update(dT time.Duration, currentMap cartography.Map, gameObjects map[uint64]object.GameObject) error
type InitiativeSystem ¶
type InitiativeSystem struct {
// contains filtered or unexported fields
}
func NewInitiativeSystem ¶
func NewInitiativeSystem() *InitiativeSystem
NewInitiativeSystem initializes and returns an initiative system.
func (*InitiativeSystem) ShouldTrack ¶
func (s *InitiativeSystem) ShouldTrack(obj object.GameObject) bool
func (*InitiativeSystem) Update ¶
func (s *InitiativeSystem) Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error
type MovementSystem ¶
type MovementSystem struct { }
func NewMovementSystem ¶
func NewMovementSystem() *MovementSystem
func (*MovementSystem) ShouldTrack ¶
func (s *MovementSystem) ShouldTrack(object object.GameObject) bool
func (*MovementSystem) Update ¶
func (s *MovementSystem) Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
A Renderer renders components.
func NewRenderer ¶
func NewRenderer(engine RenderingEngine) (*Renderer, error)
NewRenderer returns a new rendering system.
func (*Renderer) ShouldTrack ¶
func (r *Renderer) ShouldTrack(object object.GameObject) bool
type RenderingEngine ¶
type RenderingEngine interface { Clear() Draw() Rectangle(x, y int, bgColor color.Color) Text(x, y int, text string, fgColor color.Color) }
RenderingEngine abstracts a rendering engine.
type SightSystem ¶
func NewSightSystem ¶
func NewSightSystem(defaultVisibility float64) *SightSystem
func (*SightSystem) ShouldTrack ¶
func (s *SightSystem) ShouldTrack(object object.GameObject) bool
ShouldTrack returns whether this system should track the object.
func (*SightSystem) Update ¶
func (s *SightSystem) Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error
type System ¶
type System interface { ShouldTrack(object object.GameObject) bool Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error }
System represents a system.
type ViewportSystem ¶
type ViewportSystem struct {
// contains filtered or unexported fields
}
func NewViewportSystem ¶
func NewViewportSystem(camera Viewport) *ViewportSystem
func (*ViewportSystem) ShouldTrack ¶
func (c *ViewportSystem) ShouldTrack(object object.GameObject) bool
func (*ViewportSystem) Update ¶
func (c *ViewportSystem) Update(dT time.Duration, worldMap cartography.Map, objects map[uint64]object.GameObject) error
Click to show internal directories.
Click to hide internal directories.