player

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package player provides data used for tic-tac-go players

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(letter.Letter) int

Callback is a player move callback.

type Player

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

Player represents the game player.

func Create

func Create(t Type, playerLetter letter.Letter, cb Callback) *Player

Create creates a new player.

func (*Player) Letter

func (p *Player) Letter() letter.Letter

Letter returns player's letter.

func (*Player) Move

func (p *Player) Move() int

Move 'makes' player's move.

func (*Player) Name

func (p *Player) Name() string

Name returns player's name.

func (*Player) Type

func (p *Player) Type() Type

Type returns player's type.

type Type

type Type int

Type represents players' types.

const (
	PlayerPC Type = iota
	PlayerPerson
)

player types.

func (Type) String

func (p Type) String() string

Jump to

Keyboard shortcuts

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