diff options
| author | ewy <ewy0@protonmail.com> | 2026-09-11 15:00:48 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-09-11 15:00:48 +0200 |
| commit | c69e6c0770359e2febafcf487eb21c4aa608c3e9 (patch) | |
| tree | d1f4ac93b2bca7b4df62d698fde91ed15371c6c7 /engine/game | |
initial commit
Diffstat (limited to 'engine/game')
| -rw-r--r-- | engine/game/game.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/engine/game/game.go b/engine/game/game.go new file mode 100644 index 0000000..7f3fa76 --- /dev/null +++ b/engine/game/game.go @@ -0,0 +1,33 @@ +package game + +import ( + "sakura/engine/player" + "sakura/engine/pool" +) + +type Game struct { + Shadow *pool.Pool + Distance *pool.Pool + Yin *player.Player + Yang *player.Player + + Must []player.PlayerAction + May []player.PlayerAction +} + +func (g *Game) propagate() { + g.Distance.OverflowsTo = g.Shadow +} + +func New() *Game { + g := &Game{ + Shadow: pool.New(0, pool.Infinite), + Distance: pool.New(0, 10), + Must: nil, + May: nil, + } + g.Yin = player.New(g) + g.Yang = player.New(g) + g.propagate() + return g +} |
