From 15b7e221b799ef107dec44ecdb294026dfd3d059 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 24 Jun 2026 22:55:35 -0400 Subject: refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object --- internal/game/cmd_queued.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'internal/game/cmd_queued.go') diff --git a/internal/game/cmd_queued.go b/internal/game/cmd_queued.go index 303a3ec..dcda825 100644 --- a/internal/game/cmd_queued.go +++ b/internal/game/cmd_queued.go @@ -14,10 +14,10 @@ func (g *Game) executeQueued(sess *net.Session, args []string, rawInput string) func (g *Game) doQueued(sess *net.Session) { p := sess.Player - freeCmds := g.freeQueue[p.Name] - activeCmd := g.activeQueue[p.Name] + freeCmds := g.queue.PeekFree(p.Name) + activeCmd, hasActive := g.queue.PeekActive(p.Name) - if len(freeCmds) == 0 && activeCmd == nil { + if len(freeCmds) == 0 && !hasActive { sess.WriteLine("No actions queued.") return } @@ -51,10 +51,7 @@ func (g *Game) doQueued(sess *net.Session) { sess.WriteLine(fmt.Sprintf(" All queued actions take effect on the next game tick (600ms).")) sess.WriteLine(fmt.Sprintf(" Free actions stack. Only the most recent active action survives.")) - var names []string - for name := range g.activeQueue { - names = append(names, name) - } + names, _ := g.queue.ActivePositions(p.Name) sort.Strings(names) pos := 0 for i, name := range names { -- cgit v1.2.3