diff options
| author | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
| commit | 15b7e221b799ef107dec44ecdb294026dfd3d059 (patch) | |
| tree | 3748e464a77f0f082bea1567e9d6990052054961 /internal/game/cmd_queued.go | |
| parent | 9d4b799db4868bcab291b83599ff088763cd4ed6 (diff) | |
| download | thehouseoficarus-15b7e221b799ef107dec44ecdb294026dfd3d059.tar.gz | |
refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object
Diffstat (limited to 'internal/game/cmd_queued.go')
| -rw-r--r-- | internal/game/cmd_queued.go | 11 |
1 files changed, 4 insertions, 7 deletions
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 { |
