summaryrefslogtreecommitdiff
path: root/engine/game.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-09-22 21:29:39 +0200
committerewy <ewy0@protonmail.com>2026-09-22 21:29:39 +0200
commite57ab3ca3907ae186bae1af088ca880ae880c312 (patch)
tree97015e4b13de8faee8a172f7bc306a8fa66355c2 /engine/game.go
parent283f6e19741b262c46a8a2ba3f7ba81f01519d70 (diff)
progress
Diffstat (limited to 'engine/game.go')
-rw-r--r--engine/game.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/engine/game.go b/engine/game.go
index 0735958..399a17f 100644
--- a/engine/game.go
+++ b/engine/game.go
@@ -25,6 +25,8 @@ type Game struct {
CurrentPlayerSlot string `json:"CurrentPlayer"`
History []Turn
+
+ You, Them string
}
func (g *Game) propagate() {
@@ -90,13 +92,17 @@ func (g *Game) Present(p *Player) Game {
localGame := *g
switch p {
case g.Yin:
+ localGame.You = "PlayerYin"
+ localGame.Them = "PlayerYang"
localGame.Yang.Hide()
case g.Yang:
+ localGame.You = "PlayerYang"
+ localGame.Them = "PlayerYin"
localGame.Yin.Hide()
}
var acs []Action
for _, a := range g.Actions {
- if a.Actor(g) == p {
+ if a.Actor(g) == p || (a.Actor(g) == nil && g.CurrentPlayer == p) {
acs = append(acs, a)
}
}