Documentation
¶
Index ¶
- type BasicModule
- type Manager
- func (m *Manager) Add(mod Module) Module
- func (m *Manager) Find(t reflect.Type) Module
- func (m *Manager) FindAll(t reflect.Type) []Module
- func (m *Manager) Get(i int) Module
- func (m *Manager) Init() error
- func (m *Manager) Len() int
- func (m *Manager) Shutdown()
- func (m *Manager) Start()
- func (m *Manager) Update(now time.Time, dt time.Duration)
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicModule ¶ added in v0.1.2
type BasicModule struct {
// contains filtered or unexported fields
}
BasicModule implements the Module interface{}
func NewBasicModule ¶ added in v0.1.2
func NewBasicModule(name string) *BasicModule
NewBasicModule creates a BasicModule
func (*BasicModule) Init ¶ added in v0.1.2
func (mod *BasicModule) Init() error
Init implements Module Init method
func (*BasicModule) Logger ¶ added in v0.1.2
func (mod *BasicModule) Logger() *log.ContextLogger
Logger returns the Module logger
func (*BasicModule) Name ¶ added in v0.1.2
func (mod *BasicModule) Name() string
Name implements Module Name method
func (*BasicModule) Shutdown ¶ added in v0.1.2
func (mod *BasicModule) Shutdown()
Shutdown implements Module Shutdown method
func (*BasicModule) Start ¶ added in v0.1.2
func (mod *BasicModule) Start()
Start implements Module Start method
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager used to manages a group of modules
type Module ¶
type Module interface { // Name returns the name of module Name() string // Init initializes the module Init() error // Start starts the module Start() // Shutdown shutdwons the module Shutdown() // Update updates the module per frame Update(time.Time, time.Duration) }
Module represents a generic logic module
Click to show internal directories.
Click to hide internal directories.