Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Rand = rand.Intn
Rand - random function
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface { Reaction(xp int, health int, player Player, state State, action Action, fn func()) Start() RenderGame(players []Player, p Player) SelectAction(player Player, state State, onSelect func(action Action)) GameOver() GameWon() PizzaDelivery(fn func()) Welcome(fn func(string)) }
Engine represents the game's user interface rendering engine
type Game ¶
type Game struct { Players []Player Round int Prod Production Alive []Player BandName string }
Game represents a Platforms and Programmers Game where a band of player will attempt to take on production
func (*Game) DequeuePlayer ¶
DequeuePlayer pops the next player from the queue
func (*Game) EnqueuePlayer ¶
EnqueuePlayer returns a player to the end of the queue
type Player ¶
type Player interface { // Alive checks if the player is alive Alive() bool // ApplyXPDiff applies the XP diff to the player's XP ApplyXPDiff(xp int) (actual int) // ApplyHealthDiff takes in the amount of health to be gained and applies it to the player's health // up to a maximum health of 100 and down to 0. It returns the actual difference that was applied ApplyHealthDiff(health int) (actual int) // Skills returns the skills of the player Skills() []Skill // Health returns the player's current health level Health() int // AsciiArt returns the player's ascii art AsciiArt() string // XP returns the player's XP level XP() int }
Player represents a P&P player
type Skill ¶
type Skill int
Skill represents a Player's skill in a Programmers & Platforms game
Click to show internal directories.
Click to hide internal directories.