[][src]Module spacebattleship::game::simple

Implementation of the basic game of battleship with two players and five ships on a 10x10 grid.

Structs

Coordinate

The corrdinates of a [GridCell][crate::board::GridCell] in the board.

Game

Simplified game that uses a fixed set of ships and players.

GameSetup

Struct used to setup the simple game.

Placement

Represents a placement of a ship. Allows extracting the orientation and start, as well as iterating the coordinates.

Enums

CannotPlaceReason

Reason why a ship could not be placed at a given position.

CannotShootReason

Reason why a shot at the board failed.

Orientation

Placement orientation of a ship.

Player

Player ID for the simple game. Either P1 or P2.

Ship

Ship ID for the simple game.

ShotOutcome

Outcome of a successfully-fired shot.

Type Definitions

CellRef

Alias to CellRef with fixed generic types.

ShipRef

Alias to ShipRef with fixed generic types.