feat: turn stage increment after player's command

This commit is contained in:
Ilia Denisov
2026-02-08 16:35:58 +02:00
parent bf34843568
commit ba5d4e1ba8
14 changed files with 102 additions and 81 deletions
+5 -8
View File
@@ -6,17 +6,14 @@ import (
)
func JoinEqualGroups(configure func(*controller.Param), race string) (err error) {
control(configure, func(c *controller.Controller) {
c.ExecuteGame(func(r controller.Repo, g *game.Game) {
err = joinEqualGroups(c, r, g, race)
err = control(configure, func(c *controller.Controller) error {
return c.ExecuteCommand(func(r controller.Repo, g *game.Game) error {
return joinEqualGroups(c, race)
})
})
return
}
func joinEqualGroups(c *controller.Controller, r controller.Repo, g *game.Game, race string) error {
if err := c.JoinEqualGroups(race); err != nil {
return err
}
return r.SaveLastState(g)
func joinEqualGroups(c *controller.Controller, race string) error {
return c.JoinEqualGroups(race)
}