visited

package
v0.0.0-...-b78434c Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: GPL-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action uint8

Action is the type of the cell used to record the player's move

const (
	// Unknown is the value of the cell with no value
	Unknown Action = 1 << iota

	// Number is the value of the cell with a warning value
	Number

	// Bomb is the value of the cell with the mine
	Bomb
)

type History

type History struct {
	Record
	*History
}

History contains the information of all player's movements in a linked list

type Position

type Position interface {
	// X returns the x-coordinate of the cell in the grid
	X() int

	// Y returns the y-coordinate of the cell in the grid
	Y() int
}

Position is used to interface the cell's xy-coordinates used for this package

type Record

type Record struct {
	Position
	Action
}

Record contains the information of the player's movement such as the position of the cell visited and visited cell's type

type StoryTeller

type StoryTeller interface {
	// History returns the list of player's move. The iteration of the returned value
	// is not the same as iterating an array because the returned value is in the
	// implementation of a linked-list.
	History() *History

	// LastAction returns the player's recent move
	LastAction() Record
}

StoryTeller is used to interface the instance of the Minesweeper game to retrieve certain information such as the history of all player's move and the player's recent action

Jump to

Keyboard shortcuts

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