cluedo

package
v0.0.0-...-f5b8a7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MeIdent = "ME"

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer int
const (
	UnknownAnswer Answer = iota
	WhoAnswer
	WhatAnswer
	WhereAnswer
	NoAnswer
)

type Card

type Card struct {
	// contains filtered or unexported fields
}

func NewCard

func NewCard(name string) *Card
func (c *Card) AddLink(player *Player, other *Card)

func (*Card) AddNonPossessor

func (c *Card) AddNonPossessor(player *Player)
func (c *Card) AddTriLink(player *Player, one *Card, two *Card)

func (Card) IsFound

func (c Card) IsFound() bool

func (*Card) SetFound

func (c *Card) SetFound(possessor *Player, destroyLinks bool)

type CardCategory

type CardCategory struct {
	Cards []*Card
}

func NewCardCategory

func NewCardCategory(cards ...*Card) CardCategory

func (*CardCategory) FoundCard

func (c *CardCategory) FoundCard(foundCard *Card, possessor *Player) (success bool)

func (CardCategory) GetKnownSolution

func (c CardCategory) GetKnownSolution() *Card

func (CardCategory) HasKnownSolution

func (c CardCategory) HasKnownSolution() bool

func (CardCategory) UpdateMurderKnowledge

func (c CardCategory) UpdateMurderKnowledge()

type Game

type Game struct {
	Me *Player
	// contains filtered or unexported fields
}

func NewDefaultGame

func NewDefaultGame(otherPlayers ...*Player) Game

func (*Game) AddStartingHand

func (g *Game) AddStartingHand(hand []*Card)

func (*Game) DoTurn

func (g *Game) DoTurn(question Question)

func (Game) EnsureValidQuestion

func (g Game) EnsureValidQuestion(question Question) bool

func (Game) GetAllCards

func (g Game) GetAllCards() []*Card

func (Game) String

func (g Game) String() string

func (*Game) Update

func (g *Game) Update()

func (*Game) UpdateCompleteCategories

func (g *Game) UpdateCompleteCategories()

func (*Game) UpdateCompletePlayers

func (g *Game) UpdateCompletePlayers()

func (*Game) UpdateNonPossessors

func (g *Game) UpdateNonPossessors()
type Link struct {
	// contains filtered or unexported fields
}

type Player

type Player struct {
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(name string, count int) *Player

type Question

type Question struct {
	// contains filtered or unexported fields
}

func NewQuestion

func NewQuestion(who, what, where *Card, asker, answerer *Player) Question

func (*Question) SetAnswer

func (q *Question) SetAnswer(a Answer)
type TriLink struct {
	// contains filtered or unexported fields
}

func (TriLink) Equals

func (t TriLink) Equals(other TriLink) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL