[][src]Module spacebattleship::board

Types that make up the game board.

Re-exports

pub use self::setup::BoardSetup;

Modules

common

Common types that are useful to various types of boards.

rectangular

Implements a basic rectangular board.

setup

Implements the setup phase of the board.

Structs

AddShipError

Error returned when trying to add a ship that already existed.

Board

Represents a single player's board, including their ships and their side of the ocean.

CellRef

Reference to a particular cell in the grid.

NeighborIter

Iterator over the neighbors of a coordinate.

PlaceError

Error caused when attempting to place a ship in an invalid position.

ShipRef

Handle to a ship that allows getting information about its status.

ShotError

Error returned when trying to shoot a cell.

Enums

CannotPlaceReason

Reason why a ship could not be placed with a given projection.

CannotShootReason

Reason why a particular tile could not be shot.

ShotOutcome

Result of a shot on a single player's board.

Traits

ColinearCheck

Trait for Dimensions that support colinearity checks on their coordinates.

Coordinate

Trait for coordinates used in Dimensions. Requires Debug to enable certain common panic messages on misuse. Coordinates are treated as disposable and cheaply cloneable. If you need a complex coordinate type that isn't cheap to clone, you may want to wrap it in Rc or Arc.

Dimensions

Dimensions of a board. Implements methods needed for the board to check bounds, linearize indexes, and compute neighbor cells.

NeighborIterState

State type for the neighbor iterator.