diff --git a/4d68ea94c77e642d94c7.module.wasm b/4d68ea94c77e642d94c7.module.wasm deleted file mode 100644 index 7e7abe5..0000000 Binary files a/4d68ea94c77e642d94c7.module.wasm and /dev/null differ diff --git a/8728f958432289f02420.module.wasm b/8728f958432289f02420.module.wasm new file mode 100644 index 0000000..de5a0e4 Binary files /dev/null and b/8728f958432289f02420.module.wasm differ diff --git a/doc/draught/board/constant.STD_HEIGHT.html b/doc/draught/board/constant.STD_HEIGHT.html index 2d99cc7..ac032a7 100644 --- a/doc/draught/board/constant.STD_HEIGHT.html +++ b/doc/draught/board/constant.STD_HEIGHT.html @@ -1,5 +1,6 @@ -draught::board::STD_HEIGHT - Rust +draught::board::STD_HEIGHT - Rust

Constant draught::board::STD_HEIGHT[][src]

pub const STD_HEIGHT: usize = 8;
+ Change settings

Constant draught::board::STD_HEIGHT[][src]

pub const STD_HEIGHT: usize = 8;

Standard height of a checkers board is 8 squares

+
\ No newline at end of file diff --git a/doc/draught/board/constant.STD_WIDTH.html b/doc/draught/board/constant.STD_WIDTH.html index 456cf81..3eb4acd 100644 --- a/doc/draught/board/constant.STD_WIDTH.html +++ b/doc/draught/board/constant.STD_WIDTH.html @@ -1,5 +1,6 @@ -draught::board::STD_WIDTH - Rust +draught::board::STD_WIDTH - Rust

Constant draught::board::STD_WIDTH[][src]

pub const STD_WIDTH: usize = 8;
+ Change settings

Constant draught::board::STD_WIDTH[][src]

pub const STD_WIDTH: usize = 8;

Standard width of a checkers board is 8 squares

+
\ No newline at end of file diff --git a/doc/draught/board/enums/enum.Moveable.html b/doc/draught/board/enums/enum.Moveable.html index 66ddd89..b1e7852 100644 --- a/doc/draught/board/enums/enum.Moveable.html +++ b/doc/draught/board/enums/enum.Moveable.html @@ -1,13 +1,17 @@ draught::board::enums::Moveable - Rust -

Enum draught::board::enums::Moveable[][src]

#[repr(u8)]pub enum Moveable {
+

Enum draught::board::enums::Moveable[][src]

#[repr(u8)]pub enum Moveable {
     Allowed,
-    Occupied,
+    UnoccupiedSrc,
+    OccupiedDest,
     OutOfBounds,
+    Unplayable,
+    WrongTeamSrc,
+    IllegalTrajectory,
 }

Variants

-
Allowed
Occupied
OutOfBounds

Trait Implementations

impl Clone for Moveable[src]

\ No newline at end of file diff --git a/doc/draught/board/sidebar-items.js b/doc/draught/board/sidebar-items.js index 310be41..d5969b8 100644 --- a/doc/draught/board/sidebar-items.js +++ b/doc/draught/board/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"constant":[["STD_HEIGHT",""],["STD_WIDTH",""]],"mod":[["enums",""],["iter",""]],"struct":[["Board","Models a single state for a checkers board"],["BrdIdx",""],["Direction",""],["Piece",""],["Square",""]]}); \ No newline at end of file +initSidebarItems({"constant":[["STD_HEIGHT","Standard height of a checkers board is 8 squares"],["STD_WIDTH","Standard width of a checkers board is 8 squares"]],"mod":[["enums",""],["iter",""]],"struct":[["Board","Models a single state for a checkers board"],["BrdIdx","Model a rank 2 tensor index to identify a board square by row and column"],["Direction","Model the standard diagonal movements by north west/east etc"],["Piece","Model a game piece by its team and strength (normal or kinged)"],["Square","Model board squares by a state and a possible occupying game piece"]]}); \ No newline at end of file diff --git a/doc/draught/board/struct.Board.html b/doc/draught/board/struct.Board.html index b2b4908..6148ecd 100644 --- a/doc/draught/board/struct.Board.html +++ b/doc/draught/board/struct.Board.html @@ -1,39 +1,73 @@ draught::board::Board - Rust -

Struct draught::board::Board[][src]

pub struct Board {
+

Struct draught::board::Board[][src]

pub struct Board {
     cells: Vec<Square>,
     width: usize,
     height: usize,
     current_turn: Team,
 }

Models a single state for a checkers board

- Fields

cells: Vec<Square>width: usizeheight: usizecurrent_turn: Team

Implementations

impl Board[src]

pub fn cell_mut(&mut self, idx: usize) -> &mut Square[src]

pub fn diagonal_indices(&self, idx: BrdIdx) -> Option<Vec<usize>>[src]

pub fn filter_indices(
    &self,
    idx: BrdIdx,
    player: Team,
    indices: Vec<usize>
) -> Vec<usize>
[src]

pub fn player_diagonal_indices(
    &self,
    idx: BrdIdx,
    player: Team
) -> Option<Vec<usize>>
[src]

pub fn jumpable_indices(&self, idx: BrdIdx) -> Option<Vec<usize>>[src]

pub fn player_jumpable_indices(
    &self,
    idx: BrdIdx,
    player: Team
) -> Option<Vec<usize>>
[src]

impl Board[src]

pub fn cell(&self, idx: usize) -> Square[src]

pub fn grid_cell(&self, idx: BrdIdx) -> Square[src]

pub fn cell_index(&self, row: usize, col: usize) -> usize[src]

pub fn cell_idx(&self, idx: BrdIdx) -> usize[src]

pub fn board_index(&self, idx: usize) -> BrdIdx[src]

pub fn new(width: usize, height: usize) -> Board[src]

pub fn init_game(board: Board) -> Board[src]

pub fn current_turn(&self) -> Team[src]

pub fn cells(&self) -> *const Square[src]

pub fn num_cells(&self) -> usize[src]

pub fn cell_state(&self, idx: usize) -> SquareState[src]

Trait Implementations

impl Clone for Board[src]

Model the standard diagonal movements by north west/east etc

+

Used as an absolute measure, i.e. not relative to the team making a move

+

Use options for when movements are blocked/unallowed contextually

+

+ Fields

nw: Option<T>

North West

+
ne: Option<T>

North East

+
se: Option<T>

South East

+
sw: Option<T>

South West

+

Implementations

impl<T: Clone + Copy> Direction<T>[src]

pub fn empty() -> Direction<T>[src]

Create an empty direction full of Option::None

+

Trait Implementations

impl<T: Clone + Copy> Clone for Direction<T>[src]

impl<T: Copy + Clone> Copy for Direction<T>[src]

impl<T: Debug + Clone + Copy> Debug for Direction<T>[src]

impl<T: Eq + Clone + Copy> Eq for Direction<T>[src]

impl<T: PartialEq + Clone + Copy> PartialEq<Direction<T>> for Direction<T>[src]

impl<T: Copy + Clone> Copy for Direction<T>[src]

impl<T: Debug + Clone + Copy> Debug for Direction<T>[src]

impl<T: Eq + Clone + Copy> Eq for Direction<T>[src]

impl<T: PartialEq + Clone + Copy> PartialEq<Direction<T>> for Direction<T>[src]

impl<T: Clone + Copy> StructuralEq for Direction<T>[src]

impl<T: Clone + Copy> StructuralPartialEq for Direction<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Direction<T> where
    T: RefUnwindSafe

impl<T> Send for Direction<T> where
    T: Send

impl<T> Sync for Direction<T> where
    T: Sync

impl<T> Unpin for Direction<T> where
    T: Unpin

impl<T> UnwindSafe for Direction<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T: Clone + Copy> StructuralEq for Direction<T>[src]

impl<T: Clone + Copy> StructuralPartialEq for Direction<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Direction<T> where
    T: RefUnwindSafe

impl<T> Send for Direction<T> where
    T: Send

impl<T> Sync for Direction<T> where
    T: Sync

impl<T> Unpin for Direction<T> where
    T: Unpin

impl<T> UnwindSafe for Direction<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

Model a game piece by its team and strength (normal or kinged)

+

+ Fields

team: Teamstrength: Strength

Implementations

impl Piece[src]

pub fn new(team: Team, strength: Strength) -> Piece[src]

Trait Implementations

impl Clone for Piece[src]

impl Copy for Piece[src]

impl Debug for Piece[src]

impl Eq for Piece[src]

impl From<Piece> for JsValue[src]

impl FromWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the +

impl Copy for Piece[src]

impl Debug for Piece[src]

impl Eq for Piece[src]

impl From<Piece> for JsValue[src]

impl FromWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

-

impl IntoWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI +

impl IntoWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

-

impl OptionFromWasmAbi for Piece[src]

impl OptionFromWasmAbi for Piece[src]

impl OptionIntoWasmAbi for Piece[src]

impl OptionIntoWasmAbi for Piece[src]

impl PartialEq<Piece> for Piece[src]

impl PartialEq<Piece> for Piece[src]

impl RefFromWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

+

impl RefFromWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, Piece>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous. Read more

-

impl RefMutFromWasmAbi for Piece[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

+

impl RefMutFromWasmAbi for Piece[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, Piece>

Same as RefFromWasmAbi::Anchor

-

impl StructuralEq for Piece[src]

impl StructuralPartialEq for Piece[src]

impl WasmDescribe for Piece[src]

Auto Trait Implementations

impl RefUnwindSafe for Piece

impl Send for Piece

impl Sync for Piece

impl Unpin for Piece

impl UnwindSafe for Piece

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl StructuralEq for Piece[src]

impl StructuralPartialEq for Piece[src]

impl WasmDescribe for Piece[src]

Auto Trait Implementations

impl RefUnwindSafe for Piece

impl Send for Piece

impl Sync for Piece

impl Unpin for Piece

impl UnwindSafe for Piece

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]