Struct backgammon_logic::board::Board[][src]

pub struct Board {
    pub board: InternalBoard,
    pub bar_black: u8,
    pub bar_white: u8,
}

Fields

Methods

impl Board
[src]

Return a board setup as such:

+11-10--9--8--7--6-----5--4--3--2--1--0-+
| B  .  .  .  W  . | | W  .  .  .  .  B |
| B  .  .  .  W  . | | W  .  .  .  .  B |
| B  .  .  .  W  . | | W  .  .  .  .  . |
| B  .  .  .  .  . | | W  .  .  .  .  . |
| B  .  .  .  .  . | | W  .  .  .  .  . |
|                  | |                  |
| W  .  .  .  .  . | | B  .  .  .  .  . |
| W  .  .  .  .  . | | B  .  .  .  .  . |
| W  .  .  .  B  . | | B  .  .  .  .  . |
| W  .  .  .  B  . | | B  .  .  .  .  W |
| W  .  .  .  B  . | | B  .  .  .  .  W |
+12-13-14-15-16-17----18-19-20-21-22-23-+

Returns a board that is counter-clockwise from the Player.

Check if a submove is legal. Returns true if valid or false if invalid.

Checks (in order):

  • Ensure chequer exists
  • Check chequer ownership
  • Check bar
  • Check not moving onto an opponent's point

Return the pip count for the Player.

TODO: it would be nice to perform this functionally with zip() and fold().

Trait Implementations

impl Clone for Board
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Board

impl Sync for Board