aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.go b/main.go
index e67e50b..80ee064 100644
--- a/main.go
+++ b/main.go
@@ -36,6 +36,7 @@ type Game struct {
ResourceAmount int
FaceSource *text.GoTextFaceSource
UnitBuilder EntityBuilder
+ NowFunc func() time.Time
// Components
Mask []ecs.Mask
// Entities []*Entity
@@ -53,6 +54,9 @@ type Game struct {
}
func (g Game) Now() time.Time {
+ if g.NowFunc != nil {
+ return g.NowFunc()
+ }
return time.Now()
}