aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-01-15 23:03:12 +0100
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-01-15 23:03:12 +0100
commitd1e361f74e0d424b4d6a99adea1463982d9f1475 (patch)
tree5a4cebb4c9fc09d0094c252fcb14a16d624945b2 /main.go
parent13626410c4d6db7fdc15ded5ee7865fcdbf0b88a (diff)
First integration test
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()
}