diff options
Diffstat (limited to 'internal/game/core_command_queue.go')
| -rw-r--r-- | internal/game/core_command_queue.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/game/core_command_queue.go b/internal/game/core_command_queue.go index 8fce71d..0108ecd 100644 --- a/internal/game/core_command_queue.go +++ b/internal/game/core_command_queue.go @@ -89,6 +89,14 @@ func (q *CommandQueue) PeekActive(name string) (*QueuedCommand, bool) { return qc, ok } +// PeekConsume returns the pending consume command without removing it. +func (q *CommandQueue) PeekConsume(name string) (*QueuedCommand, bool) { + q.mu.Lock() + defer q.mu.Unlock() + qc, ok := q.consumeQueue[name] + return qc, ok +} + // PeekFree returns a copy of the free commands for the player without removing. func (q *CommandQueue) PeekFree(name string) []QueuedCommand { q.mu.Lock() |
