diff --git a/game/game.go b/game/game.go index 642b813..e48b9c3 100644 --- a/game/game.go +++ b/game/game.go @@ -102,6 +102,15 @@ func (g *Game) PopShell() bool { return *g.Prev } +// Peek returns the current turn's shell if it is revealed for the player with +// the given ID, or nil otherwise. +func (g *Game) Peek(id player.ID) *bool { + if id != g.CurrentPlayer().ID || !g.Reveal { + return nil + } + return &g.Shells[0] +} + // Empty returns whether the shotgun is empty. func (g *Game) Empty() bool { return len(g.Shells) == 0