game

package
v0.0.0-...-d00a361 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2015 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Id         uint   `json:"id"`
	Name       string `json:"name"`
	SetupRules []*SetupRule
	MinPlayers int `json:"min_players"`
	MaxPlayers int `json:"max_players"`
}

func NewGame

func NewGame(name string, rules []*SetupRule, minPlayers int, maxPlayers int) *Game

type Player

type Player struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type SetupRule

type SetupRule struct {
	Id           int
	Description  string
	Details      string
	Arity        string
	Dependencies []*SetupRule
}

func NewSetupRule

func NewSetupRule(desc string, arity string, deps ...*SetupRule) *SetupRule

func (*SetupRule) Equal

func (a *SetupRule) Equal(b *SetupRule) bool

type SetupStep

type SetupStep struct {
	Rule  *SetupRule
	Owner *Player
	Done  bool
}

func NewGlobalSetupStep

func NewGlobalSetupStep(rule *SetupRule) (*SetupStep, error)

func NewPerPlayerSetupStep

func NewPerPlayerSetupStep(rule *SetupRule, owner *Player) (*SetupStep, error)

func (*SetupStep) CanBeOwnedBy

func (step *SetupStep) CanBeOwnedBy(player *Player) bool

func (*SetupStep) Equal

func (a *SetupStep) Equal(b *SetupStep) bool

func (*SetupStep) Finish

func (step *SetupStep) Finish()

func (*SetupStep) String

func (step *SetupStep) String() string

Jump to

Keyboard shortcuts

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