models

package
v0.0.0-...-f4af470 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CollectionBoard is name of collection that stores boards
	CollectionBoard = "boards"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	ID        string   `json:"board_id" bson:"board_id"`
	Width     int      `json:"width" bson:"width"`
	Height    int      `json:"height" bson:"height"`
	Ships     [][]bool `json:"ships" bson:"ships"`
	Torpedoes [][]bool `json:"torpedoes" bson:"torpedoes"`
}

Board model

type BoardInput

type BoardInput struct {
	Width  int `json:"width" bson:"width"`
	Height int `json:"height" bson:"height"`
}

BoardInput model

type BoardStatus

type BoardStatus struct {
	TurnsPlayed int `json:"turnsPlayed" bson:"turnsPlayed"`
	ShipsHit    int `json:"shipsHit" bson:"shipsHit"`
	ShipsLeft   int `json:"shipsLeft" bson:"shipsLeft"`
}

BoardStatus model

type Move

type Move struct {
	X int `json:"x" bson:"x"`
	Y int `json:"y" bson:"y"`
}

Move model

Jump to

Keyboard shortcuts

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