player

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package player controls the game for each player

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// WinPoints are the amount of points a player gets if they win a game.
	// A player's win points are decremented each time he attempts to unsuccessfully finish/win a game.
	WinPoints int
}

Config can be used to create new players.

func (Config) New

func (cfg Config) New(b *board.Board) (*Player, error)

New creates a player with the winPoints defined by config and a board to modify.

type Player

type Player struct {
	WinPoints int
	Board     *board.Board
}

Player stores the board and other player-specific data for each player in the game.

Jump to

Keyboard shortcuts

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