game

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShallowCount number.
	ShallowCount = 60

	// ShallowCombinableCount number.
	ShallowCombinableCount = 1

	// DeepCombinableCount number.
	DeepCombinableCount = 1

	// LegendaryCount number.
	LegendaryCount = 1

	// DiverPrice value.
	DiverPrice = 50

	// SubmarinePrice value.
	SubmarinePrice = 100
)

Variables

View Source
var (
	// ErrNoMoney error.
	ErrNoMoney = errors.New("game: you have no money")

	// ErrNoBoat error.
	ErrNoBoat = errors.New("game: you have no boat")

	// ErrNoDiver error.
	ErrNoDiver = errors.New("game: you have no diver")

	// ErrNoSubmarine error.
	ErrNoSubmarine = errors.New("game: you have no submarine")

	// ErrNoArtifact error.
	ErrNoArtifact = errors.New("game: you have no artifact")

	// ErrInvalidArtifactPair error.
	ErrInvalidArtifactPair = errors.New("game: invalid artifact pair")

	// ErrInvalidGridName error.
	ErrInvalidGridName = errors.New("game: invalid grid name")

	// ErrInvalidGridType error.
	ErrInvalidGridType = errors.New("game: invalid grid type")

	// ErrInvalidGridStatus error.
	ErrInvalidGridStatus = errors.New("game: invalid grid status")

	// ErrInvalidGridArtifactType error.
	ErrInvalidGridArtifactType = errors.New("game: invalid grid artifact type")
)
View Source
var (
	// Cols slice.
	Cols = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}

	// Rows slice.
	Rows = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
)

Functions

This section is empty.

Types

type Game

type Game struct {
	Player       *models.Player
	Grids        []*models.Grid
	Explorations []string
	// contains filtered or unexported fields
}

Game type.

func New

func New(
	explorationRepository models.ExplorationRepository,
	gridRepository models.GridRepository,
	playerRepository models.PlayerRepository,
) *Game

New function.

func (*Game) ArtifactCombine

func (g *Game) ArtifactCombine(artifactName1, artifactName2 string) (*models.Grid, error)

ArtifactCombine function.

func (*Game) ArtifactDonate

func (g *Game) ArtifactDonate(artifactName string) (*models.Grid, error)

ArtifactDonate function.

func (*Game) ArtifactSell

func (g *Game) ArtifactSell(artifactName string) (*models.Grid, error)

ArtifactSell function.

func (*Game) DiscoveredArtifacts

func (g *Game) DiscoveredArtifacts() []*artifact.Artifact

DiscoveredArtifacts function.

func (*Game) DiverExplore

func (g *Game) DiverExplore(gridName string) (*models.Grid, error)

DiverExplore function.

func (*Game) DiverHire

func (g *Game) DiverHire() error

DiverHire function.

func (*Game) DonatedArtifacts

func (g *Game) DonatedArtifacts() []*artifact.Artifact

DonatedArtifacts function.

func (*Game) FreeUnits

func (g *Game) FreeUnits() (int, int, int)

FreeUnits function.

func (*Game) MapCreate

func (g *Game) MapCreate() error

MapCreate function.

func (*Game) MapDelete

func (g *Game) MapDelete() error

MapDelete function.

func (*Game) MapGenerate

func (g *Game) MapGenerate()

MapGenerate function.

func (*Game) MapLoad

func (g *Game) MapLoad() error

MapLoad function.

func (*Game) MapProgress

func (g *Game) MapProgress() int

MapProgress function.

func (*Game) SubmarineBuy

func (g *Game) SubmarineBuy() error

SubmarineBuy function.

func (*Game) SubmarineExplore

func (g *Game) SubmarineExplore(gridName string) (*models.Grid, error)

SubmarineExplore function.

Jump to

Keyboard shortcuts

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