This commit is contained in:
Sarsoo 2021-06-26 21:59:31 +00:00
parent 09a76ed9f1
commit 6d57a15a29
28 changed files with 616 additions and 144 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `STD_HEIGHT` constant in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, STD_HEIGHT"><title>draught::board::STD_HEIGHT - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Standard height of a checkers board is 8 squares"><meta name="keywords" content="rust, rustlang, rust-lang, STD_HEIGHT"><title>draught::board::STD_HEIGHT - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">board</a></p><div id="sidebar-vars" data-name="STD_HEIGHT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">board</a></p><div id="sidebar-vars" data-name="STD_HEIGHT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">draught</a>::<wbr><a href="index.html">board</a>::<wbr><a class="constant" href="">STD_HEIGHT</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#15" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const STD_HEIGHT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 8;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div> <a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">draught</a>::<wbr><a href="index.html">board</a>::<wbr><a class="constant" href="">STD_HEIGHT</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#18" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const STD_HEIGHT: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 8;</pre><div class="docblock"><p>Standard height of a checkers board is 8 squares</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div>
<script src="../../main.js"></script></body></html> <script src="../../main.js"></script></body></html>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `STD_WIDTH` constant in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, STD_WIDTH"><title>draught::board::STD_WIDTH - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Standard width of a checkers board is 8 squares"><meta name="keywords" content="rust, rustlang, rust-lang, STD_WIDTH"><title>draught::board::STD_WIDTH - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">board</a></p><div id="sidebar-vars" data-name="STD_WIDTH" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">board</a></p><div id="sidebar-vars" data-name="STD_WIDTH" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">draught</a>::<wbr><a href="index.html">board</a>::<wbr><a class="constant" href="">STD_WIDTH</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#14" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const STD_WIDTH: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 8;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div> <a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../index.html">draught</a>::<wbr><a href="index.html">board</a>::<wbr><a class="constant" href="">STD_WIDTH</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#16" title="goto source code">[src]</a></span></h1><pre class="rust const">pub const STD_WIDTH: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a> = 8;</pre><div class="docblock"><p>Standard width of a checkers board is 8 squares</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div>
<script src="../../main.js"></script></body></html> <script src="../../main.js"></script></body></html>

View File

@ -1,13 +1,17 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Moveable` enum in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, Moveable"><title>draught::board::enums::Moveable - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Moveable` enum in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, Moveable"><title>draught::board::enums::Moveable - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../draught/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum Moveable</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Allowed">Allowed</a><a href="#variant.Occupied">Occupied</a><a href="#variant.OutOfBounds">OutOfBounds</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-FromWasmAbi">FromWasmAbi</a><a href="#impl-IntoWasmAbi">IntoWasmAbi</a><a href="#impl-OptionFromWasmAbi">OptionFromWasmAbi</a><a href="#impl-OptionIntoWasmAbi">OptionIntoWasmAbi</a><a href="#impl-PartialEq%3CMoveable%3E">PartialEq&lt;Moveable&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-WasmDescribe">WasmDescribe</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ReturnWasmAbi">ReturnWasmAbi</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><p class="location"><a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a href="index.html">enums</a></p><div id="sidebar-vars" data-name="Moveable" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../draught/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Enum Moveable</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Allowed">Allowed</a><a href="#variant.IllegalTrajectory">IllegalTrajectory</a><a href="#variant.OccupiedDest">OccupiedDest</a><a href="#variant.OutOfBounds">OutOfBounds</a><a href="#variant.UnoccupiedSrc">UnoccupiedSrc</a><a href="#variant.Unplayable">Unplayable</a><a href="#variant.WrongTeamSrc">WrongTeamSrc</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Eq">Eq</a><a href="#impl-FromWasmAbi">FromWasmAbi</a><a href="#impl-IntoWasmAbi">IntoWasmAbi</a><a href="#impl-OptionFromWasmAbi">OptionFromWasmAbi</a><a href="#impl-OptionIntoWasmAbi">OptionIntoWasmAbi</a><a href="#impl-PartialEq%3CMoveable%3E">PartialEq&lt;Moveable&gt;</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a><a href="#impl-WasmDescribe">WasmDescribe</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ReturnWasmAbi">ReturnWasmAbi</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><p class="location"><a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a href="index.html">enums</a></p><div id="sidebar-vars" data-name="Moveable" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a href="index.html">enums</a>::<wbr><a class="enum" href="">Moveable</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/draught/board/enums.rs.html#53-57" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum"><span class="docblock attributes top-attr">#[repr(u8)]</span>pub enum Moveable { <a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a href="index.html">enums</a>::<wbr><a class="enum" href="">Moveable</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/draught/board/enums.rs.html#53-61" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum"><span class="docblock attributes top-attr">#[repr(u8)]</span>pub enum Moveable {
Allowed, Allowed,
Occupied, UnoccupiedSrc,
OccupiedDest,
OutOfBounds, OutOfBounds,
Unplayable,
WrongTeamSrc,
IllegalTrajectory,
}</pre></div><h2 id="variants" class="variants small-section-header"> }</pre></div><h2 id="variants" class="variants small-section-header">
Variants<a href="#variants" class="anchor"></a></h2> Variants<a href="#variants" class="anchor"></a></h2>
<div id="variant.Allowed" class="variant small-section-header"><a href="#variant.Allowed" class="anchor field"></a><code>Allowed</code></div><div id="variant.Occupied" class="variant small-section-header"><a href="#variant.Occupied" class="anchor field"></a><code>Occupied</code></div><div id="variant.OutOfBounds" class="variant small-section-header"><a href="#variant.OutOfBounds" class="anchor field"></a><code>OutOfBounds</code></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> <div id="variant.Allowed" class="variant small-section-header"><a href="#variant.Allowed" class="anchor field"></a><code>Allowed</code></div><div id="variant.UnoccupiedSrc" class="variant small-section-header"><a href="#variant.UnoccupiedSrc" class="anchor field"></a><code>UnoccupiedSrc</code></div><div id="variant.OccupiedDest" class="variant small-section-header"><a href="#variant.OccupiedDest" class="anchor field"></a><code>OccupiedDest</code></div><div id="variant.OutOfBounds" class="variant small-section-header"><a href="#variant.OutOfBounds" class="anchor field"></a><code>OutOfBounds</code></div><div id="variant.Unplayable" class="variant small-section-header"><a href="#variant.Unplayable" class="anchor field"></a><code>Unplayable</code></div><div id="variant.WrongTeamSrc" class="variant small-section-header"><a href="#variant.WrongTeamSrc" class="anchor field"></a><code>WrongTeamSrc</code></div><div id="variant.IllegalTrajectory" class="variant small-section-header"><a href="#variant.IllegalTrajectory" class="anchor field"></a><code>IllegalTrajectory</code></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Clone" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Clone" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.clone" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div><h4 id="method.clone_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#130" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id="impl-Copy" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Copy" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html" title="trait wasm_bindgen::convert::traits::FromWasmAbi">FromWasmAbi</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-FromWasmAbi" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#50" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts from when coming back out from the </div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#52" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-FromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html" title="trait wasm_bindgen::convert::traits::FromWasmAbi">FromWasmAbi</a> for <a class="enum" href="../../../draught/board/enums/enum.Moveable.html" title="enum draught::board::enums::Moveable">Moveable</a></code><a href="#impl-FromWasmAbi" class="anchor"></a><a class="srclink" href="../../../src/draught/board/enums.rs.html#50" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts from when coming back out from the

View File

@ -1,6 +1,6 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `enums` mod in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, enums"><title>draught::board::enums - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `enums` mod in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, enums"><title>draught::board::enums - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../draught/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module enums</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li></ul></div><p class="location"><a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a></p><div id="sidebar-vars" data-name="enums" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../../draught/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module enums</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li></ul></div><p class="location"><a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a></p><div id="sidebar-vars" data-name="enums" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a class="mod" href="">enums</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/draught/board/enums.rs.html#1-57" title="goto source code">[src]</a></span></h1><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2> <a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">draught</a>::<wbr><a href="../index.html">board</a>::<wbr><a class="mod" href="">enums</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/draught/board/enums.rs.html#1-61" title="goto source code">[src]</a></span></h1><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
<table><tr class="module-item"><td><a class="enum" href="enum.Moveable.html" title="draught::board::enums::Moveable enum">Moveable</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.SquareState.html" title="draught::board::enums::SquareState enum">SquareState</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.Strength.html" title="draught::board::enums::Strength enum">Strength</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.Team.html" title="draught::board::enums::Team enum">Team</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="draught" data-search-js="../../../search-index.js"></div> <table><tr class="module-item"><td><a class="enum" href="enum.Moveable.html" title="draught::board::enums::Moveable enum">Moveable</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.SquareState.html" title="draught::board::enums::SquareState enum">SquareState</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.Strength.html" title="draught::board::enums::Strength enum">Strength</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="enum" href="enum.Team.html" title="draught::board::enums::Team enum">Team</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="draught" data-search-js="../../../search-index.js"></div>
<script src="../../../main.js"></script></body></html> <script src="../../../main.js"></script></body></html>

View File

@ -1,9 +1,16 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `board` mod in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, board"><title>draught::board - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Board module for components related to the checkers board and game structure"><meta name="keywords" content="rust, rustlang, rust-lang, board"><title>draught::board - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module board</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class="location"><a href="../index.html">draught</a></p><div id="sidebar-vars" data-name="board" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module board</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class="location"><a href="../index.html">draught</a></p><div id="sidebar-vars" data-name="board" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">draught</a>::<wbr><a class="mod" href="">board</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#2-544" title="goto source code">[src]</a></span></h1><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2> <a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">draught</a>::<wbr><a class="mod" href="">board</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/board/mod.rs.html#1-732" title="goto source code">[src]</a></span></h1><div class="docblock"><p>Board module for components related to the checkers board and game structure</p>
</div><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="enums/index.html" title="draught::board::enums mod">enums</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="iter/index.html" title="draught::board::iter mod">iter</a></td><td class="docblock-short"></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> <table><tr class="module-item"><td><a class="mod" href="enums/index.html" title="draught::board::enums mod">enums</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="iter/index.html" title="draught::board::iter mod">iter</a></td><td class="docblock-short"></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Board.html" title="draught::board::Board struct">Board</a></td><td class="docblock-short"><p>Models a single state for a checkers board</p> <table><tr class="module-item"><td><a class="struct" href="struct.Board.html" title="draught::board::Board struct">Board</a></td><td class="docblock-short"><p>Models a single state for a checkers board</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.BrdIdx.html" title="draught::board::BrdIdx struct">BrdIdx</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Direction.html" title="draught::board::Direction struct">Direction</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Piece.html" title="draught::board::Piece struct">Piece</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Square.html" title="draught::board::Square struct">Square</a></td><td class="docblock-short"></td></tr></table><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2> </td></tr><tr class="module-item"><td><a class="struct" href="struct.BrdIdx.html" title="draught::board::BrdIdx struct">BrdIdx</a></td><td class="docblock-short"><p>Model a rank 2 tensor index to identify a board square by row and column</p>
<table><tr class="module-item"><td><a class="constant" href="constant.STD_HEIGHT.html" title="draught::board::STD_HEIGHT constant">STD_HEIGHT</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="constant" href="constant.STD_WIDTH.html" title="draught::board::STD_WIDTH constant">STD_WIDTH</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div> </td></tr><tr class="module-item"><td><a class="struct" href="struct.Direction.html" title="draught::board::Direction struct">Direction</a></td><td class="docblock-short"><p>Model the standard diagonal movements by north west/east etc</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Piece.html" title="draught::board::Piece struct">Piece</a></td><td class="docblock-short"><p>Model a game piece by its team and strength (normal or kinged)</p>
</td></tr><tr class="module-item"><td><a class="struct" href="struct.Square.html" title="draught::board::Square struct">Square</a></td><td class="docblock-short"><p>Model board squares by a state and a possible occupying game piece</p>
</td></tr></table><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
<table><tr class="module-item"><td><a class="constant" href="constant.STD_HEIGHT.html" title="draught::board::STD_HEIGHT constant">STD_HEIGHT</a></td><td class="docblock-short"><p>Standard height of a checkers board is 8 squares</p>
</td></tr><tr class="module-item"><td><a class="constant" href="constant.STD_WIDTH.html" title="draught::board::STD_WIDTH constant">STD_WIDTH</a></td><td class="docblock-short"><p>Standard width of a checkers board is 8 squares</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div>
<script src="../../main.js"></script></body></html> <script src="../../main.js"></script></body></html>

View File

@ -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",""]]}); 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"]]});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `__wasm_bindgen_generated_init_game` fn in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, __wasm_bindgen_generated_init_game"><title>draught::__wasm_bindgen_generated_init_game - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `__wasm_bindgen_generated_init_game` fn in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, __wasm_bindgen_generated_init_game"><title>draught::__wasm_bindgen_generated_init_game - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="__wasm_bindgen_generated_init_game" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="__wasm_bindgen_generated_init_game" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">draught</a>::<wbr><a class="fn" href="">__wasm_bindgen_generated_init_game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#21" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub extern &quot;C&quot; fn __wasm_bindgen_generated_init_game(<br>) -&gt; &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a> as <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.ReturnWasmAbi.html" title="trait wasm_bindgen::convert::traits::ReturnWasmAbi">ReturnWasmAbi</a>&gt;::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.ReturnWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::ReturnWasmAbi::Abi">Abi</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">draught</a>::<wbr><a class="fn" href="">__wasm_bindgen_generated_init_game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#29" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub extern &quot;C&quot; fn __wasm_bindgen_generated_init_game(<br>) -&gt; &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a> as <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.ReturnWasmAbi.html" title="trait wasm_bindgen::convert::traits::ReturnWasmAbi">ReturnWasmAbi</a>&gt;::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.ReturnWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::ReturnWasmAbi::Abi">Abi</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html> <script src="../main.js"></script></body></html>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `init_game` fn in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, init_game"><title>draught::init_game - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `init_game` fn in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, init_game"><title>draught::init_game - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="init_game" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="init_game" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">draught</a>::<wbr><a class="fn" href="">init_game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#22-28" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub fn init_game()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="index.html">draught</a>::<wbr><a class="fn" href="">init_game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#30-36" title="goto source code">[src]</a></span></h1><pre class="rust fn">pub fn init_game()</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html> <script src="../main.js"></script></body></html>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `game` mod in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, game"><title>draught::game - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `game` mod in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, game"><title>draught::game - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module game</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../index.html">draught</a></p><div id="sidebar-vars" data-name="game" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module game</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../index.html">draught</a></p><div id="sidebar-vars" data-name="game" data-ty="mod" data-relpath="../"></div><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">draught</a>::<wbr><a class="mod" href="">game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/game.rs.html#1-12" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> <a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">draught</a>::<wbr><a class="mod" href="">game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/game.rs.html#1-13" title="goto source code">[src]</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
<table><tr class="module-item"><td><a class="struct" href="struct.Game.html" title="draught::game::Game struct">Game</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div> <table><tr class="module-item"><td><a class="struct" href="struct.Game.html" title="draught::game::Game struct">Game</a></td><td class="docblock-short"><p>Root-level structure for managing the game as a collection of board states</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="draught" data-search-js="../../search-index.js"></div>
<script src="../../main.js"></script></body></html> <script src="../../main.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"struct":[["Game",""]]}); initSidebarItems({"struct":[["Game","Root-level structure for managing the game as a collection of board states"]]});

View File

@ -1,34 +1,35 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Game` struct in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, Game"><title>draught::game::Game - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Root-level structure for managing the game as a collection of board states"><meta name="keywords" content="rust, rustlang, rust-lang, Game"><title>draught::game::Game - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><script src="../../crates.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Game</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.current">current</a><a href="#structfield.previous_boards">previous_boards</a><a href="#structfield.tree">tree</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-From%3CGame%3E">From&lt;Game&gt;</a><a href="#impl-FromWasmAbi">FromWasmAbi</a><a href="#impl-IntoWasmAbi">IntoWasmAbi</a><a href="#impl-OptionFromWasmAbi">OptionFromWasmAbi</a><a href="#impl-OptionIntoWasmAbi">OptionIntoWasmAbi</a><a href="#impl-RefFromWasmAbi">RefFromWasmAbi</a><a href="#impl-RefMutFromWasmAbi">RefMutFromWasmAbi</a><a href="#impl-WasmDescribe">WasmDescribe</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ReturnWasmAbi">ReturnWasmAbi</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">game</a></p><div id="sidebar-vars" data-name="Game" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../../draught/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Game</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.current">current</a><a href="#structfield.previous_boards">previous_boards</a><a href="#structfield.tree">tree</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-From%3CGame%3E">From&lt;Game&gt;</a><a href="#impl-FromWasmAbi">FromWasmAbi</a><a href="#impl-IntoWasmAbi">IntoWasmAbi</a><a href="#impl-OptionFromWasmAbi">OptionFromWasmAbi</a><a href="#impl-OptionIntoWasmAbi">OptionIntoWasmAbi</a><a href="#impl-RefFromWasmAbi">RefFromWasmAbi</a><a href="#impl-RefMutFromWasmAbi">RefMutFromWasmAbi</a><a href="#impl-WasmDescribe">WasmDescribe</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-ReturnWasmAbi">ReturnWasmAbi</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a><a href="#impl-VZip%3CV%3E">VZip&lt;V&gt;</a></div></div><p class="location"><a href="../index.html">draught</a>::<wbr><a href="index.html">game</a></p><div id="sidebar-vars" data-name="Game" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">draught</a>::<wbr><a href="index.html">game</a>::<wbr><a class="struct" href="">Game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/game.rs.html#8-12" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Game { <a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">draught</a>::<wbr><a href="index.html">game</a>::<wbr><a class="struct" href="">Game</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../src/draught/game.rs.html#9-13" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Game {
current: <a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>, current: <a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>,
previous_boards: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;, previous_boards: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;,
tree: Arena&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;, tree: Arena&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;,
}</pre></div><h2 id="fields" class="fields small-section-header"> }</pre></div><div class="docblock"><p>Root-level structure for managing the game as a collection of board states</p>
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.current" class="structfield small-section-header"><a href="#structfield.current" class="anchor field"></a><code>current: <a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a></code></span><span id="structfield.previous_boards" class="structfield small-section-header"><a href="#structfield.previous_boards" class="anchor field"></a><code>previous_boards: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;</code></span><span id="structfield.tree" class="structfield small-section-header"><a href="#structfield.tree" class="anchor field"></a><code>tree: Arena&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;</code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-From%3CGame%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt; for <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/struct.JsValue.html" title="struct wasm_bindgen::JsValue">JsValue</a></code><a href="#impl-From%3CGame%3E" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(value: <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>) -&gt; Self</code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p> </div><h2 id="fields" class="fields small-section-header">
</div></div><h3 id="impl-FromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html" title="trait wasm_bindgen::convert::traits::FromWasmAbi">FromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-FromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-1" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts from when coming back out from the Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.current" class="structfield small-section-header"><a href="#structfield.current" class="anchor field"></a><code>current: <a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a></code></span><span id="structfield.previous_boards" class="structfield small-section-header"><a href="#structfield.previous_boards" class="anchor field"></a><code>previous_boards: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;</code></span><span id="structfield.tree" class="structfield small-section-header"><a href="#structfield.tree" class="anchor field"></a><code>tree: Arena&lt;<a class="struct" href="../../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>&gt;</code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-From%3CGame%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt; for <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/struct.JsValue.html" title="struct wasm_bindgen::JsValue">JsValue</a></code><a href="#impl-From%3CGame%3E" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(value: <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>) -&gt; Self</code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id="impl-FromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html" title="trait wasm_bindgen::convert::traits::FromWasmAbi">FromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-FromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-1" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts from when coming back out from the
ABI boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi">Read more</a></p> ABI boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi">Read more</a></p>
</div><h4 id="method.from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#tymethod.from_abi" class="fnname">from_abi</a>(js: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; Self</code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Recover a <code>Self</code> from <code>Self::Abi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#tymethod.from_abi">Read more</a></p> </div><h4 id="method.from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#tymethod.from_abi" class="fnname">from_abi</a>(js: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; Self</code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Recover a <code>Self</code> from <code>Self::Abi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#tymethod.from_abi">Read more</a></p>
</div></div><h3 id="impl-IntoWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html" title="trait wasm_bindgen::convert::traits::IntoWasmAbi">IntoWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-IntoWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-2" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts into when crossing the ABI </div></div><h3 id="impl-IntoWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html" title="trait wasm_bindgen::convert::traits::IntoWasmAbi">IntoWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-IntoWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-2" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type that this converts into when crossing the ABI
boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi">Read more</a></p> boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi">Read more</a></p>
</div><h4 id="method.into_abi" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#tymethod.into_abi" class="fnname">into_abi</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert <code>self</code> into <code>Self::Abi</code> so that it can be sent across the wasm </div><h4 id="method.into_abi" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#tymethod.into_abi" class="fnname">into_abi</a>(self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert <code>self</code> into <code>Self::Abi</code> so that it can be sent across the wasm
ABI boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#tymethod.into_abi">Read more</a></p> ABI boundary. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#tymethod.into_abi">Read more</a></p>
</div></div><h3 id="impl-OptionFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::OptionFromWasmAbi">OptionFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-OptionFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.is_none" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html#tymethod.is_none" class="fnname">is_none</a>(abi: &amp;Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::FromWasmAbi::Abi">Abi</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Tests whether the argument is a “none” instance. If so it will be </div></div><h3 id="impl-OptionFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::OptionFromWasmAbi">OptionFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-OptionFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.is_none" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html#tymethod.is_none" class="fnname">is_none</a>(abi: &amp;Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.FromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::FromWasmAbi::Abi">Abi</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Tests whether the argument is a “none” instance. If so it will be
deserialized as <code>None</code>, and otherwise it will be passed to deserialized as <code>None</code>, and otherwise it will be passed to
<code>FromWasmAbi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html#tymethod.is_none">Read more</a></p> <code>FromWasmAbi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionFromWasmAbi.html#tymethod.is_none">Read more</a></p>
</div></div><h3 id="impl-OptionIntoWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html" title="trait wasm_bindgen::convert::traits::OptionIntoWasmAbi">OptionIntoWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-OptionIntoWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.none" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html#tymethod.none" class="fnname">none</a>() -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::IntoWasmAbi::Abi">Abi</a></code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns an ABI instance indicating “none”, which JS will interpret as </div></div><h3 id="impl-OptionIntoWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html" title="trait wasm_bindgen::convert::traits::OptionIntoWasmAbi">OptionIntoWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-OptionIntoWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.none" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html#tymethod.none" class="fnname">none</a>() -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.IntoWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::IntoWasmAbi::Abi">Abi</a></code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Returns an ABI instance indicating “none”, which JS will interpret as
the <code>None</code> branch of this option. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html#tymethod.none">Read more</a></p> the <code>None</code> branch of this option. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.OptionIntoWasmAbi.html#tymethod.none">Read more</a></p>
</div></div><h3 id="impl-RefFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::RefFromWasmAbi">RefFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type references to <code>Self</code> are recovered from.</p> </div></div><h3 id="impl-RefFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::RefFromWasmAbi">RefFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>The wasm ABI type references to <code>Self</code> are recovered from.</p>
</div><h4 id="associatedtype.Anchor" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor" class="type">Anchor</a> = <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/__rt/struct.Ref.html" title="struct wasm_bindgen::__rt::Ref">Ref</a>&lt;'static, <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt;</code></h4><div class='docblock'><p>The type that holds the reference to <code>Self</code> for the duration of the </div><h4 id="associatedtype.Anchor" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor" class="type">Anchor</a> = <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/__rt/struct.Ref.html" title="struct wasm_bindgen::__rt::Ref">Ref</a>&lt;'static, <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt;</code></h4><div class='docblock'><p>The type that holds the reference to <code>Self</code> for the duration of the
invocation of the function that has an <code>&amp;Self</code> parameter. This is invocation of the function that has an <code>&amp;Self</code> parameter. This is
required to ensure that the lifetimes dont persist beyond one function required to ensure that the lifetimes dont persist beyond one function
call, and so that they remain anonymous. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor">Read more</a></p> call, and so that they remain anonymous. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor">Read more</a></p>
</div><h4 id="method.ref_from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#tymethod.ref_from_abi" class="fnname">ref_from_abi</a>(js: Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::RefFromWasmAbi::Abi">Abi</a>) -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor" title="type wasm_bindgen::convert::traits::RefFromWasmAbi::Anchor">Anchor</a></code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Recover a <code>Self::Anchor</code> from <code>Self::Abi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#tymethod.ref_from_abi">Read more</a></p> </div><h4 id="method.ref_from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#tymethod.ref_from_abi" class="fnname">ref_from_abi</a>(js: Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::RefFromWasmAbi::Abi">Abi</a>) -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#associatedtype.Anchor" title="type wasm_bindgen::convert::traits::RefFromWasmAbi::Anchor">Anchor</a></code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Recover a <code>Self::Anchor</code> from <code>Self::Abi</code>. <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefFromWasmAbi.html#tymethod.ref_from_abi">Read more</a></p>
</div></div><h3 id="impl-RefMutFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::RefMutFromWasmAbi">RefMutFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefMutFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-3" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>Same as <code>RefFromWasmAbi::Abi</code></p> </div></div><h3 id="impl-RefMutFromWasmAbi" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html" title="trait wasm_bindgen::convert::traits::RefMutFromWasmAbi">RefMutFromWasmAbi</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefMutFromWasmAbi" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Abi-3" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Abi" class="type">Abi</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code></h4><div class='docblock'><p>Same as <code>RefFromWasmAbi::Abi</code></p>
</div><h4 id="associatedtype.Anchor-1" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Anchor" class="type">Anchor</a> = <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/__rt/struct.RefMut.html" title="struct wasm_bindgen::__rt::RefMut">RefMut</a>&lt;'static, <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt;</code></h4><div class='docblock'><p>Same as <code>RefFromWasmAbi::Anchor</code></p> </div><h4 id="associatedtype.Anchor-1" class="type"><code>type <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Anchor" class="type">Anchor</a> = <a class="struct" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/__rt/struct.RefMut.html" title="struct wasm_bindgen::__rt::RefMut">RefMut</a>&lt;'static, <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>&gt;</code></h4><div class='docblock'><p>Same as <code>RefFromWasmAbi::Anchor</code></p>
</div><h4 id="method.ref_mut_from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#tymethod.ref_mut_from_abi" class="fnname">ref_mut_from_abi</a>(js: Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::RefMutFromWasmAbi::Abi">Abi</a>) -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Anchor" title="type wasm_bindgen::convert::traits::RefMutFromWasmAbi::Anchor">Anchor</a></code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Same as <code>RefFromWasmAbi::ref_from_abi</code></p> </div><h4 id="method.ref_mut_from_abi" class="method hidden"><code>unsafe fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#tymethod.ref_mut_from_abi" class="fnname">ref_mut_from_abi</a>(js: Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Abi" title="type wasm_bindgen::convert::traits::RefMutFromWasmAbi::Abi">Abi</a>) -&gt; Self::<a class="type" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/convert/traits/trait.RefMutFromWasmAbi.html#associatedtype.Anchor" title="type wasm_bindgen::convert::traits::RefMutFromWasmAbi::Anchor">Anchor</a></code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Same as <code>RefFromWasmAbi::ref_from_abi</code></p>
</div></div><h3 id="impl-WasmDescribe" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/describe/trait.WasmDescribe.html" title="trait wasm_bindgen::describe::WasmDescribe">WasmDescribe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-WasmDescribe" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.describe" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/describe/trait.WasmDescribe.html#tymethod.describe" class="fnname">describe</a>()</code><a class="srclink" href="../../src/draught/game.rs.html#7" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p> </div></div><h3 id="impl-WasmDescribe" class="impl"><code class="in-band">impl <a class="trait" href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/describe/trait.WasmDescribe.html" title="trait wasm_bindgen::describe::WasmDescribe">WasmDescribe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-WasmDescribe" class="anchor"></a><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.describe" class="method hidden"><code>fn <a href="https://docs.rs/wasm-bindgen/0.2/wasm_bindgen/describe/trait.WasmDescribe.html#tymethod.describe" class="fnname">describe</a>()</code><a class="srclink" href="../../src/draught/game.rs.html#8" title="goto source code">[src]</a></h4></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p> </div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p> </div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p> </div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#544-548" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>

View File

@ -1,8 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `draught` crate."><meta name="keywords" content="rust, rustlang, rust-lang, draught"><title>draught - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draught"><meta name="keywords" content="rust, rustlang, rust-lang, draught"><title>draught - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate draught</p><div class="block version"><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all draught's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="draught" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Crate draught</p><div class="block version"><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all draught's items</p></a><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"></p><div id="sidebar-vars" data-name="draught" data-ty="mod" data-relpath="../"></div></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">draught</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#1-28" title="goto source code">[src]</a></span></h1><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="">draught</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#1-36" title="goto source code">[src]</a></span></h1><div class="docblock"><p>Draught</p>
<table><tr class="module-item"><td><a class="mod" href="board/index.html" title="draught::board mod">board</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="game/index.html" title="draught::game mod">game</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="utils/index.html" title="draught::utils mod">utils</a></td><td class="docblock-short"></td></tr></table><h2 id="macros" class="section-header"><a href="#macros">Macros</a></h2> <p>An implementation of checkers/draughts in Rust WebAssembly with a minimax AI player</p>
<table><tr class="module-item"><td><a class="macro" href="macro.log.html" title="draught::log macro">log</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2> </div><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2>
<table><tr><td><code>pub use board::<a class="struct" href="../draught/board/struct.Board.html" title="struct draught::board::Board">Board</a>;</code></td></tr><tr><td><code>pub use game::<a class="struct" href="../draught/game/struct.Game.html" title="struct draught::game::Game">Game</a>;</code></td></tr></table><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
<table><tr class="module-item"><td><a class="mod" href="board/index.html" title="draught::board mod">board</a></td><td class="docblock-short"><p>Board module for components related to the checkers board and game structure</p>
</td></tr><tr class="module-item"><td><a class="mod" href="game/index.html" title="draught::game mod">game</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="utils/index.html" title="draught::utils mod">utils</a></td><td class="docblock-short"></td></tr></table><h2 id="macros" class="section-header"><a href="#macros">Macros</a></h2>
<table><tr class="module-item"><td><a class="macro" href="macro.log.html" title="draught::log macro">log</a></td><td class="docblock-short"><p>Wrap the <a href="https://docs.rs/web-sys/0.3/web_sys/index.html" title="web_sys"><code>web_sys</code></a> access to the browser console in a macro for easy logging</p>
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
<table><tr class="module-item"><td><a class="fn" href="fn.__wasm_bindgen_generated_init_game.html" title="draught::__wasm_bindgen_generated_init_game fn">__wasm_bindgen_generated_init_game</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.init_game.html" title="draught::init_game fn">init_game</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div> <table><tr class="module-item"><td><a class="fn" href="fn.__wasm_bindgen_generated_init_game.html" title="draught::__wasm_bindgen_generated_init_game fn">__wasm_bindgen_generated_init_game</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="fn" href="fn.init_game.html" title="draught::init_game fn">init_game</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html> <script src="../main.js"></script></body></html>

View File

@ -1,9 +1,10 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `log` macro in crate `draught`."><meta name="keywords" content="rust, rustlang, rust-lang, log"><title>draught::log - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg"> <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Wrap the [`web_sys`] access to the browser console in a macro for easy logging"><meta name="keywords" content="rust, rustlang, rust-lang, log"><title>draught::log - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><script src="../crates.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png"> <link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="log" data-ty="macro" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button> <link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc macro"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a href='../draught/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">draught</a></p><div id="sidebar-vars" data-name="log" data-ty="macro" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../brush.svg" width="18" height="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" class="help-button">?</button>
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Macro <a href="index.html">draught</a>::<wbr><a class="macro" href="">log</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#15-19" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><div class="example-wrap"><pre class="rust macro"> <a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" height="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Macro <a href="index.html">draught</a>::<wbr><a class="macro" href="">log</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/draught/lib.rs.html#23-27" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><div class="example-wrap"><pre class="rust macro">
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">log</span> { <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">log</span> {
( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">&gt;</span> { ... }; ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">&gt;</span> { ... };
}</pre></div> }</pre></div>
</div><div class="docblock"><p>Wrap the <a href="https://docs.rs/web-sys/0.3/web_sys/index.html" title="web_sys"><code>web_sys</code></a> access to the browser console in a macro for easy logging</p>
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div> </div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="draught" data-search-js="../search-index.js"></div>
<script src="../main.js"></script></body></html> <script src="../main.js"></script></body></html>

View File

@ -1 +1 @@
initSidebarItems({"fn":[["__wasm_bindgen_generated_init_game",""],["init_game",""]],"macro":[["log",""]],"mod":[["board",""],["game",""],["utils",""]]}); initSidebarItems({"fn":[["__wasm_bindgen_generated_init_game",""],["init_game",""]],"macro":[["log","Wrap the [`web_sys`] access to the browser console in a macro for easy logging"]],"mod":[["board","Board module for components related to the checkers board and game structure"],["game",""],["utils",""]]});

View File

@ -1,3 +1,3 @@
(function() {var implementors = {}; (function() {var implementors = {};
implementors["draught"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"draught/board/enums/enum.Team.html\" title=\"enum draught::board::enums::Team\">Team</a>","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"draught/board/enums/enum.SquareState.html\" title=\"enum draught::board::enums::SquareState\">SquareState</a>","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"struct\" href=\"draught/board/struct.Board.html\" title=\"struct draught::board::Board\">Board</a>","synthetic":false,"types":["draught::board::Board"]}]; implementors["draught"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"draught/board/enums/enum.Team.html\" title=\"enum draught::board::enums::Team\">Team</a>","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"draught/board/enums/enum.SquareState.html\" title=\"enum draught::board::enums::SquareState\">SquareState</a>","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"struct\" href=\"draught/board/struct.BrdIdx.html\" title=\"struct draught::board::BrdIdx\">BrdIdx</a>","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"struct\" href=\"draught/board/struct.Board.html\" title=\"struct draught::board::Board\">Board</a>","synthetic":false,"types":["draught::board::Board"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

File diff suppressed because one or more lines are too long

View File

@ -58,6 +58,10 @@
<span id="55">55</span> <span id="55">55</span>
<span id="56">56</span> <span id="56">56</span>
<span id="57">57</span> <span id="57">57</span>
<span id="58">58</span>
<span id="59">59</span>
<span id="60">60</span>
<span id="61">61</span>
</pre><div class="example-wrap"><pre class="rust "> </pre><div class="example-wrap"><pre class="rust ">
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>; <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>;
<span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
@ -113,8 +117,12 @@
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Moveable</span> { <span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">Moveable</span> {
<span class="ident">Allowed</span> <span class="op">=</span> <span class="number">0</span>, <span class="ident">Allowed</span> <span class="op">=</span> <span class="number">0</span>,
<span class="ident">Occupied</span> <span class="op">=</span> <span class="number">1</span>, <span class="ident">UnoccupiedSrc</span> <span class="op">=</span> <span class="number">1</span>,
<span class="ident">OutOfBounds</span> <span class="op">=</span> <span class="number">2</span>, <span class="ident">OccupiedDest</span> <span class="op">=</span> <span class="number">2</span>,
<span class="ident">OutOfBounds</span> <span class="op">=</span> <span class="number">3</span>,
<span class="ident">Unplayable</span> <span class="op">=</span> <span class="number">4</span>,
<span class="ident">WrongTeamSrc</span> <span class="op">=</span> <span class="number">5</span>,
<span class="ident">IllegalTrajectory</span> <span class="op">=</span> <span class="number">6</span>,
}</pre></div> }</pre></div>
</section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="draught" data-search-js="../../../search-index.js"></div> </section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="draught" data-search-js="../../../search-index.js"></div>
<script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script></body></html> <script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script></body></html>

View File

@ -545,7 +545,196 @@
<span id="542">542</span> <span id="542">542</span>
<span id="543">543</span> <span id="543">543</span>
<span id="544">544</span> <span id="544">544</span>
<span id="545">545</span>
<span id="546">546</span>
<span id="547">547</span>
<span id="548">548</span>
<span id="549">549</span>
<span id="550">550</span>
<span id="551">551</span>
<span id="552">552</span>
<span id="553">553</span>
<span id="554">554</span>
<span id="555">555</span>
<span id="556">556</span>
<span id="557">557</span>
<span id="558">558</span>
<span id="559">559</span>
<span id="560">560</span>
<span id="561">561</span>
<span id="562">562</span>
<span id="563">563</span>
<span id="564">564</span>
<span id="565">565</span>
<span id="566">566</span>
<span id="567">567</span>
<span id="568">568</span>
<span id="569">569</span>
<span id="570">570</span>
<span id="571">571</span>
<span id="572">572</span>
<span id="573">573</span>
<span id="574">574</span>
<span id="575">575</span>
<span id="576">576</span>
<span id="577">577</span>
<span id="578">578</span>
<span id="579">579</span>
<span id="580">580</span>
<span id="581">581</span>
<span id="582">582</span>
<span id="583">583</span>
<span id="584">584</span>
<span id="585">585</span>
<span id="586">586</span>
<span id="587">587</span>
<span id="588">588</span>
<span id="589">589</span>
<span id="590">590</span>
<span id="591">591</span>
<span id="592">592</span>
<span id="593">593</span>
<span id="594">594</span>
<span id="595">595</span>
<span id="596">596</span>
<span id="597">597</span>
<span id="598">598</span>
<span id="599">599</span>
<span id="600">600</span>
<span id="601">601</span>
<span id="602">602</span>
<span id="603">603</span>
<span id="604">604</span>
<span id="605">605</span>
<span id="606">606</span>
<span id="607">607</span>
<span id="608">608</span>
<span id="609">609</span>
<span id="610">610</span>
<span id="611">611</span>
<span id="612">612</span>
<span id="613">613</span>
<span id="614">614</span>
<span id="615">615</span>
<span id="616">616</span>
<span id="617">617</span>
<span id="618">618</span>
<span id="619">619</span>
<span id="620">620</span>
<span id="621">621</span>
<span id="622">622</span>
<span id="623">623</span>
<span id="624">624</span>
<span id="625">625</span>
<span id="626">626</span>
<span id="627">627</span>
<span id="628">628</span>
<span id="629">629</span>
<span id="630">630</span>
<span id="631">631</span>
<span id="632">632</span>
<span id="633">633</span>
<span id="634">634</span>
<span id="635">635</span>
<span id="636">636</span>
<span id="637">637</span>
<span id="638">638</span>
<span id="639">639</span>
<span id="640">640</span>
<span id="641">641</span>
<span id="642">642</span>
<span id="643">643</span>
<span id="644">644</span>
<span id="645">645</span>
<span id="646">646</span>
<span id="647">647</span>
<span id="648">648</span>
<span id="649">649</span>
<span id="650">650</span>
<span id="651">651</span>
<span id="652">652</span>
<span id="653">653</span>
<span id="654">654</span>
<span id="655">655</span>
<span id="656">656</span>
<span id="657">657</span>
<span id="658">658</span>
<span id="659">659</span>
<span id="660">660</span>
<span id="661">661</span>
<span id="662">662</span>
<span id="663">663</span>
<span id="664">664</span>
<span id="665">665</span>
<span id="666">666</span>
<span id="667">667</span>
<span id="668">668</span>
<span id="669">669</span>
<span id="670">670</span>
<span id="671">671</span>
<span id="672">672</span>
<span id="673">673</span>
<span id="674">674</span>
<span id="675">675</span>
<span id="676">676</span>
<span id="677">677</span>
<span id="678">678</span>
<span id="679">679</span>
<span id="680">680</span>
<span id="681">681</span>
<span id="682">682</span>
<span id="683">683</span>
<span id="684">684</span>
<span id="685">685</span>
<span id="686">686</span>
<span id="687">687</span>
<span id="688">688</span>
<span id="689">689</span>
<span id="690">690</span>
<span id="691">691</span>
<span id="692">692</span>
<span id="693">693</span>
<span id="694">694</span>
<span id="695">695</span>
<span id="696">696</span>
<span id="697">697</span>
<span id="698">698</span>
<span id="699">699</span>
<span id="700">700</span>
<span id="701">701</span>
<span id="702">702</span>
<span id="703">703</span>
<span id="704">704</span>
<span id="705">705</span>
<span id="706">706</span>
<span id="707">707</span>
<span id="708">708</span>
<span id="709">709</span>
<span id="710">710</span>
<span id="711">711</span>
<span id="712">712</span>
<span id="713">713</span>
<span id="714">714</span>
<span id="715">715</span>
<span id="716">716</span>
<span id="717">717</span>
<span id="718">718</span>
<span id="719">719</span>
<span id="720">720</span>
<span id="721">721</span>
<span id="722">722</span>
<span id="723">723</span>
<span id="724">724</span>
<span id="725">725</span>
<span id="726">726</span>
<span id="727">727</span>
<span id="728">728</span>
<span id="729">729</span>
<span id="730">730</span>
<span id="731">731</span>
<span id="732">732</span>
</pre><div class="example-wrap"><pre class="rust "> </pre><div class="example-wrap"><pre class="rust ">
<span class="doccomment">//! Board module for components related to the checkers board and game structure</span>
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">enums</span>; <span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">enums</span>;
<span class="kw">use</span> <span class="ident">enums</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">enums</span>::<span class="kw-2">*</span>;
@ -559,9 +748,12 @@
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>; <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>;
<span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="doccomment">/// Standard width of a checkers board is 8 squares</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">STD_WIDTH</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">8</span>; <span class="kw">pub</span> <span class="kw">const</span> <span class="ident">STD_WIDTH</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">8</span>;
<span class="doccomment">/// Standard height of a checkers board is 8 squares</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">STD_HEIGHT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">8</span>; <span class="kw">pub</span> <span class="kw">const</span> <span class="ident">STD_HEIGHT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">8</span>;
<span class="doccomment">/// Model a game piece by its team and strength (normal or kinged)</span>
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Piece</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Piece</span> {
@ -577,15 +769,25 @@
} }
} }
<span class="doccomment">/// Model the standard diagonal movements by north west/east etc</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Used as an absolute measure, i.e. not relative to the team making a move</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Use options for when movements are blocked/unallowed contextually</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Clone</span> <span class="op">+</span> <span class="ident">Copy</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Clone</span> <span class="op">+</span> <span class="ident">Copy</span><span class="op">&gt;</span> {
<span class="doccomment">/// North West </span>
<span class="ident">nw</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>, <span class="ident">nw</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
<span class="doccomment">/// North East</span>
<span class="ident">ne</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>, <span class="ident">ne</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
<span class="doccomment">/// South East</span>
<span class="ident">se</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>, <span class="ident">se</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
<span class="doccomment">/// South West</span>
<span class="ident">sw</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>, <span class="ident">sw</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>,
} }
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Clone</span> <span class="op">+</span> <span class="ident">Copy</span><span class="op">&gt;</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> { <span class="kw">impl</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="ident">Clone</span> <span class="op">+</span> <span class="ident">Copy</span><span class="op">&gt;</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> {
<span class="doccomment">/// Create an empty direction full of [`Option::None`]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">empty</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">empty</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span> {
<span class="ident">Direction</span> { <span class="ident">Direction</span> {
<span class="ident">nw</span>: <span class="prelude-ty">Option</span>::<span class="prelude-val">None</span>, <span class="ident">nw</span>: <span class="prelude-ty">Option</span>::<span class="prelude-val">None</span>,
@ -596,10 +798,13 @@
} }
} }
<span class="doccomment">/// Model board squares by a state and a possible occupying game piece</span>
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Square</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Square</span> {
<span class="doccomment">/// Game piece if square is occupied</span>
<span class="ident">occupant</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Piece</span><span class="op">&gt;</span>, <span class="ident">occupant</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Piece</span><span class="op">&gt;</span>,
<span class="doccomment">/// Description of whether the square is occupied or an unplayable, i.e. off-lattice square</span>
<span class="ident">state</span>: <span class="ident">SquareState</span> <span class="ident">state</span>: <span class="ident">SquareState</span>
} }
@ -612,6 +817,7 @@
} }
} }
<span class="doccomment">/// Model a rank 2 tensor index to identify a board square by row and column</span>
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>, <span class="ident">Copy</span>, <span class="ident">Debug</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>)]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BrdIdx</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BrdIdx</span> {
@ -628,6 +834,12 @@
} }
} }
<span class="kw">impl</span> <span class="ident">Display</span> <span class="kw">for</span> <span class="ident">BrdIdx</span> {
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">std</span>::<span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
<span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;({}, {})&quot;</span>, <span class="self">self</span>.<span class="ident">row</span>, <span class="self">self</span>.<span class="ident">col</span>)
}
}
<span class="comment">///////////////</span> <span class="comment">///////////////</span>
<span class="comment">// BOARD</span> <span class="comment">// BOARD</span>
<span class="comment">///////////////</span> <span class="comment">///////////////</span>
@ -636,6 +848,7 @@
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span> <span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Board</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Board</span> {
<span class="doccomment">/// 1D backing array of board squares for the 2D game board</span>
<span class="ident">cells</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">Square</span><span class="op">&gt;</span>, <span class="ident">cells</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">Square</span><span class="op">&gt;</span>,
<span class="ident">width</span>: <span class="ident">usize</span>, <span class="ident">width</span>: <span class="ident">usize</span>,
<span class="ident">height</span>: <span class="ident">usize</span>, <span class="ident">height</span>: <span class="ident">usize</span>,
@ -644,10 +857,18 @@
} }
<span class="kw">impl</span> <span class="ident">Board</span> { <span class="kw">impl</span> <span class="ident">Board</span> {
<span class="doccomment">/// Get a mutable reference to a board square by 1D array index</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_mut</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Square</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_mut</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Square</span> {
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">cells</span>[<span class="ident">idx</span>] <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">cells</span>[<span class="ident">idx</span>]
} }
<span class="doccomment">/// Get the 1D array indices for the diagonally adjacent squares of a given board square</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// # Returns</span>
<span class="doccomment">/// [`None`]: If the given square is unplayable</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Some(Vec&lt;usize&gt;): A variable length vector of 1D indices for diagonally adjacent squares. </span>
<span class="doccomment">/// Vector may be between 1 and 4 items long depending on the location of the given square</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">diagonal_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">diagonal_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> { <span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> {
<span class="kw">return</span> <span class="prelude-val">None</span>; <span class="kw">return</span> <span class="prelude-val">None</span>;
@ -657,21 +878,18 @@
<span class="kw">let</span> <span class="ident">width_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">width</span> <span class="op">-</span> <span class="number">1</span>; <span class="kw">let</span> <span class="ident">width_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">width</span> <span class="op">-</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cells</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">4</span>); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cells</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">with_capacity</span>(<span class="number">4</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dir</span> <span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">empty</span>();
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&gt;</span> <span class="number">0</span> { <span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&gt;</span> <span class="number">0</span> {
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">0</span> { <span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">0</span> {
<span class="ident">cells</span>.<span class="ident">push</span>( <span class="ident">cells</span>.<span class="ident">push</span>(
<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>) <span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)
); );
<span class="ident">dir</span>.<span class="ident">nw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)));
} }
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> { <span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> {
<span class="ident">cells</span>.<span class="ident">push</span>( <span class="ident">cells</span>.<span class="ident">push</span>(
<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>) <span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)
); );
<span class="ident">dir</span>.<span class="ident">ne</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)));
} }
} }
@ -680,22 +898,61 @@
<span class="ident">cells</span>.<span class="ident">push</span>( <span class="ident">cells</span>.<span class="ident">push</span>(
<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>) <span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)
); );
<span class="ident">dir</span>.<span class="ident">sw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)));
} }
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> { <span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> {
<span class="ident">cells</span>.<span class="ident">push</span>( <span class="ident">cells</span>.<span class="ident">push</span>(
<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>) <span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)
); );
<span class="ident">dir</span>.<span class="ident">se</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)));
} }
} }
<span class="ident">cells</span>.<span class="ident">shrink_to_fit</span>(); <span class="ident">cells</span>.<span class="ident">shrink_to_fit</span>();
<span class="prelude-val">Some</span>(<span class="ident">cells</span>) <span class="prelude-val">Some</span>(<span class="ident">cells</span>)
<span class="comment">// Some(dir)</span>
} }
<span class="doccomment">/// Get a [`Direction`] structure for the diagonally adjacent squares of a given board square</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Similar to the [`Board::diagonal_indices`] function with differently formatted results</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// # Returns</span>
<span class="doccomment">/// [`None`]: If the given square is unplayable</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Some(Direction&lt;Square&gt;): A [`Direction`] structure for the diagonally adjacent squares.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">adjacent_dir</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">Square</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> {
<span class="kw">return</span> <span class="prelude-val">None</span>;
}
<span class="kw">let</span> <span class="ident">height_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">height</span> <span class="op">-</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="ident">width_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">width</span> <span class="op">-</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dir</span> <span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">empty</span>();
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&gt;</span> <span class="number">0</span> {
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">0</span> {
<span class="ident">dir</span>.<span class="ident">nw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)));
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> {
<span class="ident">dir</span>.<span class="ident">ne</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)));
}
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&lt;</span> <span class="ident">height_idx</span> {
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">0</span> {
<span class="ident">dir</span>.<span class="ident">sw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">1</span>)));
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> {
<span class="ident">dir</span>.<span class="ident">se</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">1</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">1</span>)));
}
}
<span class="prelude-val">Some</span>(<span class="ident">dir</span>)
}
<span class="doccomment">/// Filter an array of diagonal indices (Like those from [`Board::diagonal_indices`], [`Board::jumpable_indices`]) for those that are legal for a team&#39;s man, i.e. solely up or down the board</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">filter_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>, <span class="ident">player</span>: <span class="ident">Team</span>, <span class="ident">indices</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">filter_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>, <span class="ident">player</span>: <span class="ident">Team</span>, <span class="ident">indices</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> {
<span class="ident">indices</span>.<span class="ident">into_iter</span>().<span class="ident">filter</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> { <span class="ident">indices</span>.<span class="ident">into_iter</span>().<span class="ident">filter</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> {
<span class="kw">match</span> <span class="ident">player</span> { <span class="kw">match</span> <span class="ident">player</span> {
@ -712,6 +969,13 @@
} }
} }
<span class="doccomment">/// Get the 1D array indices for the diagonally jumpable squares of a given board square</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// # Returns</span>
<span class="doccomment">/// [`None`]: If the given square is unplayable</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Some(Vec&lt;usize&gt;): A variable length vector of 1D indices for diagonally jumpable squares. </span>
<span class="doccomment">/// Vector may be between 1 and 4 items long depending on the location of the given square</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">jumpable_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">jumpable_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> { <span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> {
<span class="kw">return</span> <span class="prelude-val">None</span>; <span class="kw">return</span> <span class="prelude-val">None</span>;
@ -754,6 +1018,47 @@
<span class="prelude-val">Some</span>(<span class="ident">cells</span>) <span class="prelude-val">Some</span>(<span class="ident">cells</span>)
} }
<span class="doccomment">/// Get a [`Direction`] structure for the diagonally jumpable squares of a given board square</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Similar to the [`Board::jumpable_indices`] function with differently formatted results</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// # Returns</span>
<span class="doccomment">/// [`None`]: If the given square is unplayable</span>
<span class="doccomment">/// </span>
<span class="doccomment">/// Some(Direction&lt;Square&gt;): A [`Direction`] structure for the diagonally jumpable squares.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">jumpable_dir</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Direction</span><span class="op">&lt;</span><span class="ident">Square</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">cell_state</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="op">=</span><span class="op">=</span> <span class="ident">SquareState</span>::<span class="ident">Unplayable</span> {
<span class="kw">return</span> <span class="prelude-val">None</span>;
}
<span class="kw">let</span> <span class="ident">height_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">height</span> <span class="op">-</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="ident">width_idx</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">width</span> <span class="op">-</span> <span class="number">1</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dir</span> <span class="op">=</span> <span class="ident">Direction</span>::<span class="ident">empty</span>();
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&gt;</span> <span class="number">1</span> {
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">1</span> {
<span class="ident">dir</span>.<span class="ident">nw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">2</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">2</span>)));
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> <span class="op">-</span> <span class="number">1</span> {
<span class="ident">dir</span>.<span class="ident">ne</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">-</span> <span class="number">2</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">2</span>)));
}
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">row</span> <span class="op">&lt;</span> <span class="ident">height_idx</span> <span class="op">-</span> <span class="number">1</span> {
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="number">1</span> {
<span class="ident">dir</span>.<span class="ident">sw</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">2</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">-</span> <span class="number">2</span>)));
}
<span class="kw">if</span> <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">&lt;</span> <span class="ident">width_idx</span> <span class="op">-</span> <span class="number">1</span> {
<span class="ident">dir</span>.<span class="ident">se</span> <span class="op">=</span> <span class="prelude-ty">Option</span>::<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span> <span class="op">+</span> <span class="number">2</span>, <span class="ident">idx</span>.<span class="ident">col</span> <span class="op">+</span> <span class="number">2</span>)));
}
}
<span class="prelude-val">Some</span>(<span class="ident">dir</span>)
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">player_jumpable_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>, <span class="ident">player</span>: <span class="ident">Team</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">player_jumpable_indices</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>, <span class="ident">player</span>: <span class="ident">Team</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">jumpable_indices</span>(<span class="ident">idx</span>) { <span class="kw">match</span> <span class="self">self</span>.<span class="ident">jumpable_indices</span>(<span class="ident">idx</span>) {
<span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">filter_indices</span>(<span class="ident">idx</span>, <span class="ident">player</span>, <span class="ident">x</span>)), <span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">&gt;</span> <span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">filter_indices</span>(<span class="ident">idx</span>, <span class="ident">player</span>, <span class="ident">x</span>)),
@ -764,32 +1069,98 @@
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="kw">impl</span> <span class="ident">Board</span> { <span class="kw">impl</span> <span class="ident">Board</span> {
<span class="doccomment">/// Get a copy of a board square by 1D array index</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Square</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Square</span> {
<span class="self">self</span>.<span class="ident">cells</span>[<span class="ident">idx</span>] <span class="self">self</span>.<span class="ident">cells</span>[<span class="ident">idx</span>]
} }
<span class="doccomment">/// Get a copy of a board square by 2D [`BrdIdx`] index</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">grid_cell</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Square</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">grid_cell</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Square</span> {
<span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>)) <span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">idx</span>))
} }
<span class="doccomment">/// Transform a 2D row/column board index into a single 1D index for use with [`Board::cells`]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_index</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">row</span>: <span class="ident">usize</span>, <span class="ident">col</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_index</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">row</span>: <span class="ident">usize</span>, <span class="ident">col</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> {
(<span class="ident">row</span> <span class="op">*</span> <span class="self">self</span>.<span class="ident">width</span>) <span class="op">+</span> <span class="ident">col</span> (<span class="ident">row</span> <span class="op">*</span> <span class="self">self</span>.<span class="ident">width</span>) <span class="op">+</span> <span class="ident">col</span>
} }
<span class="doccomment">/// Similar to [`Board::cell_index`] but with a [`BrdIdx`] instead of separate indices. Transform a 2D row/column board index into a single 1D index for use with [`Board::cells`]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_idx</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_idx</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> {
<span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span>, <span class="ident">idx</span>.<span class="ident">col</span>) <span class="self">self</span>.<span class="ident">cell_index</span>(<span class="ident">idx</span>.<span class="ident">row</span>, <span class="ident">idx</span>.<span class="ident">col</span>)
} }
<span class="doccomment">/// Transform a 1D array index (for [`Board::cells`]) into a 2D game board index (by row/col)</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">board_index</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">BrdIdx</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">board_index</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">BrdIdx</span> {
<span class="kw">let</span> <span class="ident">row</span> <span class="op">=</span> <span class="ident">idx</span> <span class="op">/</span> <span class="self">self</span>.<span class="ident">width</span>; <span class="kw">let</span> <span class="ident">row</span> <span class="op">=</span> <span class="ident">idx</span> <span class="op">/</span> <span class="self">self</span>.<span class="ident">width</span>;
<span class="kw">let</span> <span class="ident">col</span> <span class="op">=</span> <span class="ident">idx</span> <span class="op">-</span> (<span class="ident">row</span> <span class="op">*</span> <span class="self">self</span>.<span class="ident">width</span>); <span class="kw">let</span> <span class="ident">col</span> <span class="op">=</span> <span class="ident">idx</span> <span class="op">-</span> (<span class="ident">row</span> <span class="op">*</span> <span class="self">self</span>.<span class="ident">width</span>);
<span class="ident">BrdIdx</span>::<span class="ident">from</span>(<span class="ident">row</span>, <span class="ident">col</span>) <span class="ident">BrdIdx</span>::<span class="ident">from</span>(<span class="ident">row</span>, <span class="ident">col</span>)
} }
<span class="comment">// pub fn can_move(&amp;self, from: BrdIdx, to: BrdIdx) -&gt; bool {</span> <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">can_move</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">from</span>: <span class="ident">BrdIdx</span>, <span class="ident">to</span>: <span class="ident">BrdIdx</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Moveable</span> {
<span class="comment">// let diagonals = self.diagonal_indices(from);</span>
<span class="comment">// }</span>
<span class="kw">if</span> <span class="ident">from</span>.<span class="ident">row</span> <span class="op">&gt;</span> <span class="self">self</span>.<span class="ident">height</span> <span class="op">-</span> <span class="number">1</span> <span class="op">|</span><span class="op">|</span> <span class="ident">from</span>.<span class="ident">col</span> <span class="op">&gt;</span> <span class="self">self</span>.<span class="ident">width</span> <span class="op">-</span> <span class="number">1</span> {
<span class="kw">return</span> <span class="ident">Moveable</span>::<span class="ident">OutOfBounds</span>;
}
<span class="kw">let</span> <span class="ident">from_square</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cell</span>(<span class="self">self</span>.<span class="ident">cell_idx</span>(<span class="ident">from</span>));
<span class="kw">match</span> <span class="ident">from_square</span>.<span class="ident">state</span> {
<span class="ident">Empty</span> <span class="op">=</span><span class="op">&gt;</span> <span class="kw">return</span> <span class="ident">Moveable</span>::<span class="ident">UnoccupiedSrc</span>,
<span class="ident">Unplayable</span> <span class="op">=</span><span class="op">&gt;</span> <span class="kw">return</span> <span class="ident">Moveable</span>::<span class="ident">Unplayable</span>,
<span class="ident">Occupied</span> <span class="op">=</span><span class="op">&gt;</span> {
<span class="comment">// if its not the current teams piece then error</span>
<span class="kw">match</span> <span class="ident">from_square</span>.<span class="ident">occupant</span> {
<span class="prelude-val">None</span> <span class="op">=</span><span class="op">&gt;</span> <span class="macro">panic</span><span class="macro">!</span>(<span class="string">&quot;Square is apparently occupied, but no occupant was found from: {}, to: {}, square: {:?}&quot;</span>, <span class="ident">from</span>, <span class="ident">to</span>, <span class="ident">from_square</span>),
<span class="prelude-val">Some</span>(<span class="ident">x</span>) <span class="op">=</span><span class="op">&gt;</span> {
<span class="comment">// piece in the source square is not for the current turn&#39;s player</span>
<span class="kw">if</span> <span class="ident">x</span>.<span class="ident">team</span> <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">current_turn</span> {
<span class="kw">return</span> <span class="ident">Moveable</span>::<span class="ident">WrongTeamSrc</span>;
}
<span class="comment">// TODO: refactor to a IsMove()/IsJump() to check whether the move has a legal trajectory</span>
<span class="kw">match</span> <span class="ident">x</span>.<span class="ident">strength</span> {
<span class="ident">Man</span> <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">current_turn</span> {
<span class="ident">Black</span> <span class="op">=</span><span class="op">&gt;</span> {
},
<span class="ident">White</span> <span class="op">=</span><span class="op">&gt;</span> {
},
};
},
<span class="ident">King</span> <span class="op">=</span><span class="op">&gt;</span> {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">current_turn</span> {
<span class="ident">Black</span> <span class="op">=</span><span class="op">&gt;</span> {
},
<span class="ident">White</span> <span class="op">=</span><span class="op">&gt;</span> {
},
};
},
};
<span class="comment">// let diagonal = self.adjacent_dir(from);</span>
<span class="comment">// let allowable_squares = Vec::with_capacity(4);</span>
<span class="kw">let</span> <span class="ident">jumpable</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">jumpable_dir</span>(<span class="ident">from</span>);
}
}
},
}
<span class="comment">// let is_adjacent = match self.current_turn {</span>
<span class="comment">// Team::Black =&gt; diagonal.nw,</span>
<span class="comment">// Team::White =&gt; {},</span>
<span class="comment">// }</span>
<span class="ident">Moveable</span>::<span class="ident">Allowed</span>
}
<span class="doccomment">/// Iniitalise a game board without game pieces</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">width</span>: <span class="ident">usize</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Board</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">width</span>: <span class="ident">usize</span>, <span class="ident">height</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Board</span> {
<span class="kw">let</span> <span class="ident">total_cells</span> <span class="op">=</span> <span class="ident">width</span> <span class="op">*</span> <span class="ident">height</span>; <span class="kw">let</span> <span class="ident">total_cells</span> <span class="op">=</span> <span class="ident">width</span> <span class="op">*</span> <span class="ident">height</span>;
@ -818,6 +1189,7 @@
} }
} }
<span class="doccomment">/// Reset the given board to a starting layout with 3 rows of opposing pieces</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">init_game</span>(<span class="ident">board</span>: <span class="ident">Board</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Board</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">init_game</span>(<span class="ident">board</span>: <span class="ident">Board</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Board</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_board</span> <span class="op">=</span> <span class="ident">board</span>.<span class="ident">clone</span>(); <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_board</span> <span class="op">=</span> <span class="ident">board</span>.<span class="ident">clone</span>();
<span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">row</span>) <span class="kw">in</span> <span class="ident">RowSquareIterator</span>::<span class="ident">new</span>(<span class="kw-2">&amp;</span><span class="ident">board</span>).<span class="ident">enumerate</span>() { <span class="kw">for</span> (<span class="ident">idx</span>, <span class="ident">row</span>) <span class="kw">in</span> <span class="ident">RowSquareIterator</span>::<span class="ident">new</span>(<span class="kw-2">&amp;</span><span class="ident">board</span>).<span class="ident">enumerate</span>() {
@ -850,18 +1222,22 @@
<span class="ident">new_board</span> <span class="ident">new_board</span>
} }
<span class="doccomment">/// Get the [`Board::current_turn`] parameter</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">current_turn</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Team</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">current_turn</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">Team</span> {
<span class="self">self</span>.<span class="ident">current_turn</span> <span class="self">self</span>.<span class="ident">current_turn</span>
} }
<span class="doccomment">/// Get a pointer to the backing array of board squares, [`Board::cells`]</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cells</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="kw-2">*</span><span class="kw">const</span> <span class="ident">Square</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cells</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="kw-2">*</span><span class="kw">const</span> <span class="ident">Square</span> {
<span class="self">self</span>.<span class="ident">cells</span>.<span class="ident">as_ptr</span>() <span class="self">self</span>.<span class="ident">cells</span>.<span class="ident">as_ptr</span>()
} }
<span class="doccomment">/// Get the number of board squares</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">num_cells</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">num_cells</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">usize</span> {
<span class="self">self</span>.<span class="ident">cells</span>.<span class="ident">len</span>() <span class="self">self</span>.<span class="ident">cells</span>.<span class="ident">len</span>()
} }
<span class="doccomment">/// Get the state of a board square by 1D array index</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_state</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">SquareState</span> { <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">cell_state</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">idx</span>: <span class="ident">usize</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">SquareState</span> {
<span class="self">self</span>.<span class="ident">cell</span>(<span class="ident">idx</span>).<span class="ident">state</span> <span class="self">self</span>.<span class="ident">cell</span>(<span class="ident">idx</span>).<span class="ident">state</span>
} }
@ -1072,11 +1448,11 @@
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">42</span>]), <span class="ident">board</span>.<span class="ident">jumpable_indices</span>(<span class="ident">BrdIdx</span>::<span class="ident">from</span>(<span class="number">7</span>, <span class="number">0</span>))); <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="prelude-val">Some</span>(<span class="macro">vec</span><span class="macro">!</span>[<span class="number">42</span>]), <span class="ident">board</span>.<span class="ident">jumpable_indices</span>(<span class="ident">BrdIdx</span>::<span class="ident">from</span>(<span class="number">7</span>, <span class="number">0</span>)));
} }
<span class="attribute">#[<span class="ident">wasm_bindgen_test</span>]</span> <span class="comment">// #[wasm_bindgen_test]</span>
<span class="kw">fn</span> <span class="ident">init_game</span>() { <span class="comment">// fn init_game() {</span>
<span class="kw">let</span> <span class="ident">board</span> <span class="op">=</span> <span class="ident">Board</span>::<span class="ident">init_game</span>(<span class="ident">Board</span>::<span class="ident">new</span>(<span class="number">8</span>, <span class="number">8</span>)); <span class="comment">// let board = Board::init_game(Board::new(8, 8));</span>
<span class="macro">log</span><span class="macro">!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">board</span>); <span class="comment">// log!(&quot;{}&quot;, board);</span>
} <span class="comment">// }</span>
<span class="attribute">#[<span class="ident">wasm_bindgen_test</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen_test</span>]</span>
<span class="kw">fn</span> <span class="ident">black_diagonal_indices</span>() { <span class="kw">fn</span> <span class="ident">black_diagonal_indices</span>() {

View File

@ -13,6 +13,7 @@
<span id="10">10</span> <span id="10">10</span>
<span id="11">11</span> <span id="11">11</span>
<span id="12">12</span> <span id="12">12</span>
<span id="13">13</span>
</pre><div class="example-wrap"><pre class="rust "> </pre><div class="example-wrap"><pre class="rust ">
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">board</span>::<span class="ident">Board</span>; <span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">board</span>::<span class="ident">Board</span>;
<span class="kw">use</span> <span class="ident">indextree</span>::<span class="ident">Arena</span>; <span class="kw">use</span> <span class="ident">indextree</span>::<span class="ident">Arena</span>;
@ -20,6 +21,7 @@
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>; <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>;
<span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="doccomment">/// Root-level structure for managing the game as a collection of board states</span>
<span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span> <span class="attribute">#[<span class="ident">wasm_bindgen</span>]</span>
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Game</span> { <span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Game</span> {
<span class="ident">current</span>: <span class="ident">Board</span>, <span class="ident">current</span>: <span class="ident">Board</span>,

View File

@ -29,7 +29,19 @@
<span id="26">26</span> <span id="26">26</span>
<span id="27">27</span> <span id="27">27</span>
<span id="28">28</span> <span id="28">28</span>
<span id="29">29</span>
<span id="30">30</span>
<span id="31">31</span>
<span id="32">32</span>
<span id="33">33</span>
<span id="34">34</span>
<span id="35">35</span>
<span id="36">36</span>
</pre><div class="example-wrap"><pre class="rust "> </pre><div class="example-wrap"><pre class="rust ">
<span class="doccomment">//! Draught</span>
<span class="doccomment">//! </span>
<span class="doccomment">//! An implementation of checkers/draughts in Rust WebAssembly with a minimax AI player</span>
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">board</span>; <span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">board</span>;
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">utils</span>; <span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">utils</span>;
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">game</span>; <span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">game</span>;
@ -37,12 +49,16 @@
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>; <span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">wasm_bindgen</span>;
<span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>; <span class="kw">use</span> <span class="ident">wasm_bindgen</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">board</span>::<span class="ident">Board</span>;
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">game</span>::<span class="ident">Game</span>;
<span class="comment">// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global</span> <span class="comment">// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global</span>
<span class="comment">// allocator.</span> <span class="comment">// allocator.</span>
<span class="comment">// #[cfg(feature = &quot;wee_alloc&quot;)]</span> <span class="comment">// #[cfg(feature = &quot;wee_alloc&quot;)]</span>
<span class="comment">// #[global_allocator]</span> <span class="comment">// #[global_allocator]</span>
<span class="comment">// static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;</span> <span class="comment">// static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;</span>
<span class="doccomment">/// Wrap the [`web_sys`] access to the browser console in a macro for easy logging</span>
<span class="attribute">#[<span class="ident">macro_export</span>]</span> <span class="attribute">#[<span class="ident">macro_export</span>]</span>
<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">log</span> { <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">log</span> {
( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">&gt;</span> { ( $( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span> )<span class="op">*</span> ) <span class="op">=</span><span class="op">&gt;</span> {

File diff suppressed because one or more lines are too long