From 8ffea356da60f2811eed5735c5733c0a24b0fbea Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 15 Aug 2023 16:48:55 +0800 Subject: [PATCH] =?UTF-8?q?world=20=E7=8A=B6=E6=80=81=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- world.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/world.go b/world.go index 4b64b50..b67a590 100644 --- a/world.go +++ b/world.go @@ -46,6 +46,7 @@ type World interface { AddSystem(sys ...ISystem) Close() Tick() int + Running() bool } type world struct { @@ -73,7 +74,9 @@ func NewWorld(tick int) World { quit: make(chan struct{}), } } - +func (w *world) Running() bool { + return w.state == Running +} func (w *world) Tick() int { return w.tick }