aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_consume.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-24 22:55:35 -0400
committerhistoria <[not public]>2026-06-24 22:55:35 -0400
commit15b7e221b799ef107dec44ecdb294026dfd3d059 (patch)
tree3748e464a77f0f082bea1567e9d6990052054961 /internal/game/cmd_consume.go
parent9d4b799db4868bcab291b83599ff088763cd4ed6 (diff)
downloadthehouseoficarus-15b7e221b799ef107dec44ecdb294026dfd3d059.tar.gz
refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object
Diffstat (limited to 'internal/game/cmd_consume.go')
-rw-r--r--internal/game/cmd_consume.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/game/cmd_consume.go b/internal/game/cmd_consume.go
index 223d803..f45b912 100644
--- a/internal/game/cmd_consume.go
+++ b/internal/game/cmd_consume.go
@@ -64,12 +64,12 @@ func (g *Game) doEat(sess *net.Session, input string) {
g.cancelAction(p)
- g.consumeQueue[p.Name] = &QueuedCommand{
+ g.queue.EnqueueConsume(p.Name, QueuedCommand{
Session: sess,
Command: "eat",
Args: itemID,
Timestamp: time.Now(),
- }
+ })
if !p.OptionBool("queue_silently") {
sess.WriteLine(fmt.Sprintf("You prepare to eat %s.", g.itemColorize(sess, def, def.Name)))
@@ -113,11 +113,10 @@ func (g *Game) doEatNow(sess *net.Session, p *player.Player, itemID string, def
}
func (g *Game) processConsumeQueue(p *player.Player, sess *net.Session) bool {
- qc, ok := g.consumeQueue[p.Name]
+ qc, ok := g.queue.DrainConsume(p.Name)
if !ok {
return false
}
- delete(g.consumeQueue, p.Name)
itemID := qc.Args
def, err := g.ItemStore.Load(itemID)
@@ -202,12 +201,12 @@ func (g *Game) doDrink(sess *net.Session, args []string) {
g.cancelAction(p)
- g.consumeQueue[p.Name] = &QueuedCommand{
+ g.queue.EnqueueConsume(p.Name, QueuedCommand{
Session: sess,
Command: "drink",
Args: itemID,
Timestamp: time.Now(),
- }
+ })
if !p.OptionBool("queue_silently") {
sess.WriteLine(fmt.Sprintf("You prepare to drink the %s.", g.itemColorize(sess, def, def.Name)))