world 状态获取
This commit is contained in:
parent
102081251c
commit
8ffea356da
5
world.go
5
world.go
|
@ -46,6 +46,7 @@ type World interface {
|
||||||
AddSystem(sys ...ISystem)
|
AddSystem(sys ...ISystem)
|
||||||
Close()
|
Close()
|
||||||
Tick() int
|
Tick() int
|
||||||
|
Running() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type world struct {
|
type world struct {
|
||||||
|
@ -73,7 +74,9 @@ func NewWorld(tick int) World {
|
||||||
quit: make(chan struct{}),
|
quit: make(chan struct{}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (w *world) Running() bool {
|
||||||
|
return w.state == Running
|
||||||
|
}
|
||||||
func (w *world) Tick() int {
|
func (w *world) Tick() int {
|
||||||
return w.tick
|
return w.tick
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue