diff --git a/10.bootstrap.js b/10.bootstrap.js index 5ba9a7c..5393613 100644 --- a/10.bootstrap.js +++ b/10.bootstrap.js @@ -1,2 +1,2 @@ -(self.webpackChunkdraught=self.webpackChunkdraught||[]).push([[10],{171:(t,e,r)=>{"use strict";r.a(t,(async n=>{r.d(e,{wc:()=>x,SZ:()=>I,i0:()=>E,Tt:()=>S,rh:()=>j,lA:()=>O,Ck:()=>q,ug:()=>C,h4:()=>U,h9:()=>R,Dz:()=>$,kF:()=>D,U5:()=>M,r2:()=>P,iY:()=>z,mS:()=>F,XP:()=>J,yX:()=>Y,ae:()=>Z,Os:()=>L,DA:()=>N,s8:()=>Q,WB:()=>V,cP:()=>H,ck:()=>X,a:()=>K,l_:()=>G,U_:()=>tt,EN:()=>et,qu:()=>rt,Wg:()=>nt,B3:()=>_t,I6:()=>at,Qb:()=>ct,cI:()=>ot,QK:()=>it,Md:()=>st,ox:()=>ut,ES:()=>lt,Ae:()=>pt,UL:()=>dt,qw:()=>gt,tS:()=>bt,R$:()=>ht,md:()=>ft,IF:()=>wt,zP:()=>mt,td:()=>vt,Ct:()=>yt,uQ:()=>kt,RV:()=>xt,sy:()=>Tt,m_:()=>It,fY:()=>Et,Or:()=>St,oH:()=>Bt});var _=r(813);t=r.hmd(t);var a=n([_]);_=(a.then?await a:a)[0];const c=new Array(32).fill(void 0);function o(t){return c[t]}c.push(void 0,null,!0,!1);let i=c.length;let s=new("undefined"==typeof TextDecoder?(0,t.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});s.decode();let u=null;function l(){return null!==u&&u.buffer===_.memory.buffer||(u=new Uint8Array(_.memory.buffer)),u}function p(t,e){return s.decode(l().subarray(t,t+e))}function d(t){i===c.length&&c.push(c.length+1);const e=i;return i=c[e],c[e]=t,e}function g(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let r="[";e>0&&(r+=g(t[0]));for(let n=1;n1))return toString.call(t);if(n=r[1],"Object"==n)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:n}let b=0,h=new("undefined"==typeof TextEncoder?(0,t.require)("util").TextEncoder:TextEncoder)("utf-8");const f="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const r=h.encode(t);return e.set(r),{read:t.length,written:r.length}};function w(t,e,r){if(void 0===r){const r=h.encode(t),n=e(r.length);return l().subarray(n,n+r.length).set(r),b=r.length,n}let n=t.length,_=e(n);const a=l();let c=0;for(;c127)break;a[_+c]=e}if(c!==n){0!==c&&(t=t.slice(c)),_=r(_,n,n=c+3*t.length);const e=l().subarray(_+c,_+n);c+=f(t,e).written}return b=c,_}let m=null;function v(){return null!==m&&m.buffer===_.memory.buffer||(m=new Int32Array(_.memory.buffer)),m}function y(t){return null==t}function k(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function x(){_.init_wasm()}function T(t,e){try{return t.apply(this,e)}catch(t){_.__wbindgen_exn_store(d(t))}}Object.freeze({Move:0,0:"Move",Jump:1,1:"Jump"});const I=Object.freeze({Black:0,0:"Black",White:1,1:"White"}),E=(Object.freeze({Man:0,0:"Man",King:1,1:"King"}),Object.freeze({Empty:0,0:"Empty",Occupied:1,1:"Occupied",Unplayable:2,2:"Unplayable"})),S=Object.freeze({Allowed:0,0:"Allowed",UnoccupiedSrc:1,1:"UnoccupiedSrc",OccupiedDest:2,2:"OccupiedDest",OutOfBounds:3,3:"OutOfBounds",Unplayable:4,4:"Unplayable",WrongTeamSrc:5,5:"WrongTeamSrc",IllegalTrajectory:6,6:"IllegalTrajectory",NoJumpablePiece:7,7:"NoJumpablePiece",JumpingSameTeam:8,8:"JumpingSameTeam"});class B{static __wrap(t){const e=Object.create(B.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_board_free(t)}get width(){return _.__wbg_get_board_width(this.ptr)>>>0}set width(t){_.__wbg_set_board_width(this.ptr,t)}get height(){return _.__wbg_get_board_height(this.ptr)>>>0}set height(t){_.__wbg_set_board_height(this.ptr,t)}get current_turn(){return _.__wbg_get_board_current_turn(this.ptr)>>>0}set current_turn(t){_.__wbg_set_board_current_turn(this.ptr,t)}cell(t){var e=_.board_cell(this.ptr,t);return A.__wrap(e)}set_cell(t,e){k(e,A);var r=e.ptr;e.ptr=0,_.board_set_cell(this.ptr,t,r)}grid_cell(t){k(t,j);var e=t.ptr;t.ptr=0;var r=_.board_grid_cell(this.ptr,e);return A.__wrap(r)}cell_index(t,e){return _.board_cell_index(this.ptr,t,e)>>>0}cell_idx(t){k(t,j);var e=t.ptr;return t.ptr=0,_.board_cell_idx(this.ptr,e)>>>0}board_index(t){var e=_.board_board_index(this.ptr,t);return j.__wrap(e)}can_move(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;return e.ptr=0,_.board_can_move(this.ptr,r,n)>>>0}validate_man_move(t,e,r){k(t,j);var n=t.ptr;t.ptr=0,k(e,j);var a=e.ptr;e.ptr=0,k(r,W);var c=r.ptr;return r.ptr=0,_.board_validate_man_move(this.ptr,n,a,c)>>>0}validate_king_move(t,e,r){k(t,j);var n=t.ptr;t.ptr=0,k(e,j);var a=e.ptr;e.ptr=0,k(r,W);var c=r.ptr;return r.ptr=0,_.board_validate_king_move(this.ptr,n,a,c)>>>0}jumpee_idx(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;return e.ptr=0,_.board_jumpee_idx(this.ptr,r,n)>>>0}cells(){return _.board_cells(this.ptr)}num_cells(){return _.board_num_cells(this.ptr)>>>0}num_pieces(){return _.board_num_pieces(this.ptr)>>>0}num_player(t){return _.board_num_player(this.ptr,t)>>>0}score(){return _.board_score(this.ptr)}cell_state(t){return _.board_cell_state(this.ptr,t)>>>0}apply_move(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;e.ptr=0;var a=_.board_apply_move(this.ptr,r,n);return B.__wrap(a)}apply_jump(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;e.ptr=0;var a=_.board_apply_jump(this.ptr,r,n);return B.__wrap(a)}king_row_idx(){return _.board_king_row_idx(this.ptr)>>>0}static validate_jumpee(t,e){k(t,A);var r=t.ptr;t.ptr=0,k(e,W);var n=e.ptr;return e.ptr=0,_.board_validate_jumpee(r,n)>>>0}static check_jumpee_team(t,e){k(t,W);var r=t.ptr;t.ptr=0,k(e,W);var n=e.ptr;return e.ptr=0,0!==_.board_check_jumpee_team(r,n)}constructor(t,e,r){var n=_.board_new(t,e,r);return B.__wrap(n)}static init_game(t,e){k(t,B);var r=t.ptr;t.ptr=0;var n=_.board_init_game(r,e);return B.__wrap(n)}}class j{static __wrap(t){const e=Object.create(j.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_brdidx_free(t)}get row(){return _.__wbg_get_brdidx_row(this.ptr)>>>0}set row(t){_.__wbg_set_brdidx_row(this.ptr,t)}get col(){return _.__wbg_get_brdidx_col(this.ptr)>>>0}set col(t){_.__wbg_set_brdidx_col(this.ptr,t)}constructor(t,e){var r=_.brdidx_from(t,e);return j.__wrap(r)}eq(t){return k(t,j),0!==_.brdidx_eq(this.ptr,t.ptr)}}class O{static __wrap(t){const e=Object.create(O.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_game_free(t)}get last_node_count(){return _.__wbg_get_game_last_node_count(this.ptr)>>>0}set last_node_count(t){_.__wbg_set_game_last_node_count(this.ptr,t)}get perfect_chance(){return _.__wbg_get_game_perfect_chance(this.ptr)}set perfect_chance(t){_.__wbg_set_game_perfect_chance(this.ptr,t)}current_board_cells(){return _.game_current_board_cells(this.ptr)}current_board_len(){return _.game_current_board_len(this.ptr)>>>0}current_turn(){return _.game_current_turn(this.ptr)>>>0}score(){return _.game_score(this.ptr)}winning(){var t=_.game_winning(this.ptr);return 2===t?void 0:t}has_won(){var t=_.game_has_won(this.ptr);return 2===t?void 0:t}current_cell_state(t){k(t,j);var e=_.game_current_cell_state(this.ptr,t.ptr);return A.__wrap(e)}set_search_depth(t){_.game_set_search_depth(this.ptr,t)}set_selected(t){k(t,j),_.game_set_selected(this.ptr,t.ptr)}set_perfect_chance(t){_.game_set_perfect_chance(this.ptr,t)}clear_selected(){_.game_clear_selected(this.ptr)}make_move(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;return e.ptr=0,_.game_make_move(this.ptr,r,n)>>>0}execute_move(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;e.ptr=0,_.game_execute_move(this.ptr,r,n)}execute_jump(t,e){k(t,j);var r=t.ptr;t.ptr=0,k(e,j);var n=e.ptr;e.ptr=0,_.game_execute_jump(this.ptr,r,n)}push_new_board(t){k(t,B);var e=t.ptr;t.ptr=0,_.game_push_new_board(this.ptr,e)}set_current(t){k(t,B);var e=t.ptr;t.ptr=0,_.game_set_current(this.ptr,e)}constructor(t,e,r,n,a){var c=_.game_new(t,e,r,n,a);return O.__wrap(c)}static new_with_canvas(t,e,r,n,a,c,o,i){var s=w(c,_.__wbindgen_malloc,_.__wbindgen_realloc),u=b,l=_.game_new_with_canvas(t,e,r,n,a,s,u,o,i);return O.__wrap(l)}set_painter(t){k(t,q);var e=t.ptr;t.ptr=0,_.game_set_painter(this.ptr,e)}draw(){_.game_draw(this.ptr)}ai_move(){_.game_ai_move(this.ptr)}}class q{static __wrap(t){const e=Object.create(q.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_painter_free(t)}constructor(t,e,r){var n=w(r,_.__wbindgen_malloc,_.__wbindgen_realloc),a=b,c=_.painter_new(t,e,n,a);return q.__wrap(c)}static new_with_canvas(t,e,r){var n=_.painter_new_with_canvas(t,e,d(r));return q.__wrap(n)}set_square_outline(t){_.painter_set_square_outline(this.ptr,d(t))}set_outline_width(t){_.painter_set_outline_width(this.ptr,t)}set_draw_outline(t){_.painter_set_draw_outline(this.ptr,t)}reset_dimensions(){_.painter_reset_dimensions(this.ptr)}validate_board_dim(t){return k(t,B),0!==_.painter_validate_board_dim(this.ptr,t.ptr)}draw(t){k(t,B),_.painter_draw(this.ptr,t.ptr)}}class W{static __wrap(t){const e=Object.create(W.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_piece_free(t)}get team(){return _.__wbg_get_piece_team(this.ptr)>>>0}set team(t){_.__wbg_set_piece_team(this.ptr,t)}get strength(){return _.__wbg_get_piece_strength(this.ptr)>>>0}set strength(t){_.__wbg_set_piece_strength(this.ptr,t)}constructor(t,e){var r=_.piece_new(t,e);return W.__wrap(r)}}class A{static __wrap(t){const e=Object.create(A.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_square_free(t)}get occupant(){var t=_.__wbg_get_square_occupant(this.ptr);return 0===t?void 0:W.__wrap(t)}set occupant(t){let e=0;y(t)||(k(t,W),e=t.ptr,t.ptr=0),_.__wbg_set_square_occupant(this.ptr,e)}get state(){return _.__wbg_get_square_state(this.ptr)>>>0}set state(t){_.__wbg_set_square_state(this.ptr,t)}constructor(t,e){let r=0;y(e)||(k(e,W),r=e.ptr,e.ptr=0);var n=_.square_new(t,r);return A.__wrap(n)}static pc(t,e){var r=_.square_pc(t,e);return A.__wrap(r)}static empty(){var t=_.square_empty();return A.__wrap(t)}static unplay(){var t=_.square_unplay();return A.__wrap(t)}}function C(t){!function(t){const e=o(t);(function(t){t<36||(c[t]=i,i=t)})(t)}(t)}function U(t,e){return d(p(t,e))}function R(){return d(new Error)}function $(t,e){var r=w(o(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),n=b;v()[t/4+1]=n,v()[t/4+0]=r}function D(t,e){try{console.error(p(t,e))}finally{_.__wbindgen_free(t,e)}}function M(){return T((function(){return d(self.self)}),arguments)}function P(t,e,r){return d(o(t).require(p(e,r)))}function z(t){return d(o(t).crypto)}function F(t){return d(o(t).msCrypto)}function J(t){return void 0===o(t)}function Y(t){return d(o(t).getRandomValues)}function Z(t,e){o(t).getRandomValues(o(e))}function L(t,e,r){var n,_;o(t).randomFillSync((n=e,_=r,l().subarray(n/1,n/1+_)))}function N(){return d(t)}function Q(t){return o(t)instanceof Window}function V(t){var e=o(t).document;return y(e)?0:d(e)}function H(t,e,r){var n=o(t).getElementById(p(e,r));return y(n)?0:d(n)}function X(t){console.error(o(t))}function K(t){console.log(o(t))}function G(t){return o(t)instanceof CanvasRenderingContext2D}function tt(t,e){o(t).strokeStyle=o(e)}function et(t,e){o(t).fillStyle=o(e)}function rt(t,e){o(t).lineWidth=e}function nt(t){o(t).beginPath()}function _t(t){o(t).fill()}function at(t){o(t).stroke()}function ct(){return T((function(t,e,r,n,_,a){o(t).arc(e,r,n,_,a)}),arguments)}function ot(t,e,r,n,_){o(t).fillRect(e,r,n,_)}function it(t,e,r,n,_){o(t).strokeRect(e,r,n,_)}function st(t){return o(t)instanceof HTMLCanvasElement}function ut(t,e){o(t).width=e>>>0}function lt(t,e){o(t).height=e>>>0}function pt(){return T((function(t,e,r){var n=o(t).getContext(p(e,r));return y(n)?0:d(n)}),arguments)}function dt(t,e){return d(new Function(p(t,e)))}function gt(){return T((function(t,e){return d(o(t).call(o(e)))}),arguments)}function bt(){return T((function(){return d(self.self)}),arguments)}function ht(){return T((function(){return d(window.window)}),arguments)}function ft(){return T((function(){return d(globalThis.globalThis)}),arguments)}function wt(){return T((function(){return d(r.g.global)}),arguments)}function mt(t){return d(o(t).buffer)}function vt(t){return d(new Uint8Array(o(t)))}function yt(t,e,r){o(t).set(o(e),r>>>0)}function kt(t){return o(t).length}function xt(t){return d(new Uint8Array(t>>>0))}function Tt(t,e,r){return d(o(t).subarray(e>>>0,r>>>0))}function It(t){return d(o(t))}function Et(t,e){var r=w(g(o(e)),_.__wbindgen_malloc,_.__wbindgen_realloc),n=b;v()[t/4+1]=n,v()[t/4+0]=r}function St(t,e){throw new Error(p(t,e))}function Bt(){return d(_.memory)}}))},813:(t,e,r)=>{"use strict";var n=([n])=>r.v(e,t.id,"1f6adaf6c2dc4c9caead",{"./draught_bg.js":{__wbindgen_object_drop_ref:n.ug,__wbindgen_string_new:n.h4,__wbg_new_59cb74e423758ede:n.h9,__wbg_stack_558ba5917b466edd:n.Dz,__wbg_error_4bb6c2a97407129a:n.kF,__wbg_self_86b4b13392c7af56:n.U5,__wbg_require_f5521a5b85ad2542:n.r2,__wbg_crypto_b8c92eaac23d0d80:n.iY,__wbg_msCrypto_9ad6677321a08dd8:n.mS,__wbindgen_is_undefined:n.XP,__wbg_getRandomValues_dd27e6b0652b3236:n.yX,__wbg_getRandomValues_e57c9b75ddead065:n.ae,__wbg_randomFillSync_d2ba53160aec6aba:n.Os,__wbg_static_accessor_MODULE_452b4680e8614c81:n.DA,__wbg_instanceof_Window_11e25482011fc506:n.s8,__wbg_document_5aff8cd83ef968f5:n.WB,__wbg_getElementById_b180ea4ada06a837:n.cP,__wbg_error_d95afd6217cfd219:n.ck,__wbg_log_9a99fb1af846153b:n.a,__wbg_instanceof_CanvasRenderingContext2d_779e79c4121aa91b:n.l_,__wbg_setstrokeStyle_2939ee453716e462:n.U_,__wbg_setfillStyle_af790b5baf4d3210:n.EN,__wbg_setlineWidth_3e6b1837ae38d099:n.qu,__wbg_beginPath_2378575e37027ad3:n.Wg,__wbg_fill_558339447ed6ad43:n.B3,__wbg_stroke_c1e0313c58997dcf:n.I6,__wbg_arc_fffd87d9113dce32:n.Qb,__wbg_fillRect_46ffc8d2cef7e298:n.cI,__wbg_strokeRect_7ea34fad8a7f0fe2:n.QK,__wbg_instanceof_HtmlCanvasElement_fd3cbbe3906d7792:n.Md,__wbg_setwidth_f3c88eb520ba8d47:n.ox,__wbg_setheight_5a1abba41e35c42a:n.ES,__wbg_getContext_813df131fcbd6e91:n.Ae,__wbg_newnoargs_9fdd8f3961dd1bee:n.UL,__wbg_call_ba36642bd901572b:n.qw,__wbg_self_bb69a836a72ec6e9:n.tS,__wbg_window_3304fc4b414c9693:n.R$,__wbg_globalThis_e0d21cabc6630763:n.md,__wbg_global_8463719227271676:n.IF,__wbg_buffer_9e184d6f785de5ed:n.zP,__wbg_new_e8101319e4cf95fc:n.td,__wbg_set_e8ae7b27314e8b98:n.Ct,__wbg_length_2d56cb37075fcfb1:n.uQ,__wbg_newwithlength_a8d1dbcbe703a5c6:n.RV,__wbg_subarray_901ede8318da52a6:n.sy,__wbindgen_object_clone_ref:n.m_,__wbindgen_debug_string:n.fY,__wbindgen_throw:n.Or,__wbindgen_memory:n.oH}});r.a(t,(t=>{var e=t([r(171)]);return e.then?e.then(n):n(e)}),1)},10:(t,e,r)=>{"use strict";r.a(t,(async t=>{r.r(e);var n=r(171),_=t([n]);n=(_.then?await _:_)[0];var a=8,c=8,o=3,i=4,s=.5;const u="human_turn.thinking",l="human_turn.from_selected";(0,n.wc)(),document.getElementById("status-p");const p=document.getElementById("status-d"),d=document.getElementById("team-p"),g=document.getElementById("node-count"),b=document.getElementById("winning-p");document.getElementById("startBtn").onclick=T;let h=null,f=null,w=function(t,e="danger",r=!0){null!=f&&clearInterval(f),p.className=`alert alert-${e}`,p.innerText=t,p.hidden=!1,r&&(f=setTimeout((()=>{p.hidden=!0}),3e3))},m=u,v=null,y=null,k=[];T();const x=document.getElementById("game-canvas");function T(){v=new n.lA(a,c,o,n.SZ.Black,i),y=new n.Ck(720,720,"game-canvas"),v.set_painter(y),v.draw(),clearInterval(h),I(),E(),k=[],m=u}function I(){switch(v.current_turn()){case n.SZ.White:d.innerText="⚪ White ⚪";break;case n.SZ.Black:d.innerText="🔴 Black 🔴"}}function E(){switch(v.winning()){case void 0:b.innerText="";break;case n.SZ.White:b.innerText="👑 White 👑";break;case n.SZ.Black:b.innerText="👑 Black 👑"}}x.addEventListener("click",(t=>{var e=function(t,e){var r=t.getBoundingClientRect();return{x:e.clientX-r.left,y:e.clientY-r.top}}(x,t);!function(t){switch(m){case u:if(v.current_cell_state(t).state!=n.i0.Occupied)return;if(v.current_cell_state(t).occupant.team!=v.current_turn())return;k.push(t),m=l,v.set_selected(t),v.draw();break;case l:if(!k[0].eq(t)){if(v.current_cell_state(t).state!=n.i0.Empty)return;if(k.push(t),2!=k.length)return w(`Error: wrong number of clicks to process ${k.length}`),void console.error(`Error: wrong number of clicks to process ${k.length}`);switch(v.make_move(k[0],k[1])){case n.Tt.Allowed:q.checked&&void 0===v.has_won()&&(v.ai_move(),g.innerText=`searched ${v.last_node_count.toLocaleString("en-GB")} possible moves`);break;case n.Tt.IllegalTrajectory:w("You can't move like that!");break;case n.Tt.JumpingSameTeam:w("You can't jump your own piece!");break;case n.Tt.NoJumpablePiece:w("There's nothing to jump!");break;case n.Tt.OccupiedDest:w("There's a piece there!");break;case n.Tt.OutOfBounds:w("That square's not on the board! (how have you managed that?)");break;case n.Tt.UnoccupiedSrc:w("There's no piece to move!");break;case n.Tt.Unplayable:w("That's not a playable square!");break;case n.Tt.WrongTeamSrc:w("That's not your piece!")}}v.clear_selected(),v.draw(),k=[],m=u;break;case"ai_turn":console.log("It's the AI's turn!")}I(),E(),function(){switch(v.has_won()){case void 0:break;case n.SZ.White:w("You Lost!"),h=setInterval((()=>{T()}),3e3);break;case n.SZ.Black:w("You Won!","success"),h=setInterval((()=>{T()}),3e3)}}()}(new n.rh(Math.floor(e.y/x.clientHeight*c),Math.floor(e.x/x.clientWidth*a)))}));const S=document.getElementById("width");S.onchange=()=>{a=parseInt(S.value),T()},S.value=8;const B=document.getElementById("height");B.onchange=()=>{c=parseInt(B.value),j.max=c/2-1,T()},B.value=8;const j=document.getElementById("play_rows");j.onchange=()=>{o=parseInt(j.value),T()},j.value=3;const O=document.getElementById("ai_search_depth");O.onchange=()=>{i=parseInt(O.value),v.set_search_depth(i),i>4&&w("This increases thinking time exponentially, be careful (probably don't go past 6)","warning")},O.value=4;const q=document.getElementById("ai-checkbox");q.onchange=()=>{};const W=document.getElementById("ai_difficulty");W.onchange=()=>{s=parseInt(W.value)/100,v.set_perfect_chance(s)},W.value=50}))}}]); +(self.webpackChunkdraught=self.webpackChunkdraught||[]).push([[10],{171:(t,e,r)=>{"use strict";r.a(t,(async n=>{r.d(e,{wc:()=>x,SZ:()=>O,i0:()=>S,Tt:()=>I,rh:()=>E,lA:()=>B,Ck:()=>q,ug:()=>U,h4:()=>W,Ih:()=>R,yq:()=>Z,gk:()=>$,Os:()=>Y,ae:()=>M,U5:()=>D,iY:()=>z,mS:()=>J,XP:()=>P,K0:()=>F,yX:()=>G,DA:()=>L,xA:()=>N,p$:()=>H,zG:()=>X,q5:()=>K,r2:()=>V,pv:()=>Q,cF:()=>tt,N_:()=>et,S2:()=>rt,on:()=>nt,CZ:()=>_t,Ox:()=>at,kP:()=>ct,GR:()=>ot,Yl:()=>it,CU:()=>st,RA:()=>ut,Si:()=>lt,c7:()=>pt,bf:()=>dt,Z4:()=>gt,tL:()=>bt,Qu:()=>ht,EB:()=>ft,Yc:()=>wt,rf:()=>mt,Ts:()=>vt,Mz:()=>yt,Zu:()=>kt,_G:()=>xt,kC:()=>Tt,m_:()=>Ot,fY:()=>St,Or:()=>It,oH:()=>jt});var _=r(813);t=r.hmd(t);var a=n([_]);_=(a.then?await a:a)[0];const c=new Array(32).fill(void 0);function o(t){return c[t]}c.push(void 0,null,!0,!1);let i=c.length;let s=new("undefined"==typeof TextDecoder?(0,t.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});s.decode();let u=null;function l(){return null!==u&&u.buffer===_.memory.buffer||(u=new Uint8Array(_.memory.buffer)),u}function p(t,e){return s.decode(l().subarray(t,t+e))}function d(t){i===c.length&&c.push(c.length+1);const e=i;return i=c[e],c[e]=t,e}function g(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let r="[";e>0&&(r+=g(t[0]));for(let n=1;n1))return toString.call(t);if(n=r[1],"Object"==n)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:n}let b=0,h=new("undefined"==typeof TextEncoder?(0,t.require)("util").TextEncoder:TextEncoder)("utf-8");const f="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const r=h.encode(t);return e.set(r),{read:t.length,written:r.length}};function w(t,e,r){if(void 0===r){const r=h.encode(t),n=e(r.length);return l().subarray(n,n+r.length).set(r),b=r.length,n}let n=t.length,_=e(n);const a=l();let c=0;for(;c127)break;a[_+c]=e}if(c!==n){0!==c&&(t=t.slice(c)),_=r(_,n,n=c+3*t.length);const e=l().subarray(_+c,_+n);c+=f(t,e).written}return b=c,_}let m=null;function v(){return null!==m&&m.buffer===_.memory.buffer||(m=new Int32Array(_.memory.buffer)),m}function y(t){return null==t}function k(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function x(){_.init_wasm()}function T(t,e){try{return t.apply(this,e)}catch(t){_.__wbindgen_exn_store(d(t))}}Object.freeze({Move:0,0:"Move",Jump:1,1:"Jump"});const O=Object.freeze({Black:0,0:"Black",White:1,1:"White"}),S=(Object.freeze({Man:0,0:"Man",King:1,1:"King"}),Object.freeze({Empty:0,0:"Empty",Occupied:1,1:"Occupied",Unplayable:2,2:"Unplayable"})),I=Object.freeze({Allowed:0,0:"Allowed",UnoccupiedSrc:1,1:"UnoccupiedSrc",OccupiedDest:2,2:"OccupiedDest",OutOfBounds:3,3:"OutOfBounds",Unplayable:4,4:"Unplayable",WrongTeamSrc:5,5:"WrongTeamSrc",IllegalTrajectory:6,6:"IllegalTrajectory",NoJumpablePiece:7,7:"NoJumpablePiece",JumpingSameTeam:8,8:"JumpingSameTeam"});class j{static __wrap(t){const e=Object.create(j.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_board_free(t)}get width(){return _.__wbg_get_board_width(this.ptr)>>>0}set width(t){_.__wbg_set_board_width(this.ptr,t)}get height(){return _.__wbg_get_board_height(this.ptr)>>>0}set height(t){_.__wbg_set_board_height(this.ptr,t)}get current_turn(){return _.__wbg_get_board_current_turn(this.ptr)>>>0}set current_turn(t){_.__wbg_set_board_current_turn(this.ptr,t)}cell(t){var e=_.board_cell(this.ptr,t);return A.__wrap(e)}set_cell(t,e){k(e,A);var r=e.ptr;e.ptr=0,_.board_set_cell(this.ptr,t,r)}grid_cell(t){k(t,E);var e=t.ptr;t.ptr=0;var r=_.board_grid_cell(this.ptr,e);return A.__wrap(r)}cell_index(t,e){return _.board_cell_index(this.ptr,t,e)>>>0}cell_idx(t){k(t,E);var e=t.ptr;return t.ptr=0,_.board_cell_idx(this.ptr,e)>>>0}board_index(t){var e=_.board_board_index(this.ptr,t);return E.__wrap(e)}can_move(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;return e.ptr=0,_.board_can_move(this.ptr,r,n)>>>0}validate_man_move(t,e,r){k(t,E);var n=t.ptr;t.ptr=0,k(e,E);var a=e.ptr;e.ptr=0,k(r,C);var c=r.ptr;return r.ptr=0,_.board_validate_man_move(this.ptr,n,a,c)>>>0}validate_king_move(t,e,r){k(t,E);var n=t.ptr;t.ptr=0,k(e,E);var a=e.ptr;e.ptr=0,k(r,C);var c=r.ptr;return r.ptr=0,_.board_validate_king_move(this.ptr,n,a,c)>>>0}jumpee_idx(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;return e.ptr=0,_.board_jumpee_idx(this.ptr,r,n)>>>0}cells(){return _.board_cells(this.ptr)}num_cells(){return _.board_num_cells(this.ptr)>>>0}num_pieces(){return _.board_num_pieces(this.ptr)>>>0}num_player(t){return _.board_num_player(this.ptr,t)>>>0}score(){return _.board_score(this.ptr)}cell_state(t){return _.board_cell_state(this.ptr,t)>>>0}apply_move(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;e.ptr=0;var a=_.board_apply_move(this.ptr,r,n);return j.__wrap(a)}apply_jump(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;e.ptr=0;var a=_.board_apply_jump(this.ptr,r,n);return j.__wrap(a)}king_row_idx(){return _.board_king_row_idx(this.ptr)>>>0}static validate_jumpee(t,e){k(t,A);var r=t.ptr;t.ptr=0,k(e,C);var n=e.ptr;return e.ptr=0,_.board_validate_jumpee(r,n)>>>0}static check_jumpee_team(t,e){k(t,C);var r=t.ptr;t.ptr=0,k(e,C);var n=e.ptr;return e.ptr=0,0!==_.board_check_jumpee_team(r,n)}constructor(t,e,r){var n=_.board_new(t,e,r);return j.__wrap(n)}static init_game(t,e){k(t,j);var r=t.ptr;t.ptr=0;var n=_.board_init_game(r,e);return j.__wrap(n)}}class E{static __wrap(t){const e=Object.create(E.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_brdidx_free(t)}get row(){return _.__wbg_get_brdidx_row(this.ptr)>>>0}set row(t){_.__wbg_set_brdidx_row(this.ptr,t)}get col(){return _.__wbg_get_brdidx_col(this.ptr)>>>0}set col(t){_.__wbg_set_brdidx_col(this.ptr,t)}constructor(t,e){var r=_.brdidx_from(t,e);return E.__wrap(r)}eq(t){return k(t,E),0!==_.brdidx_eq(this.ptr,t.ptr)}}class B{static __wrap(t){const e=Object.create(B.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_game_free(t)}get last_node_count(){return _.__wbg_get_game_last_node_count(this.ptr)>>>0}set last_node_count(t){_.__wbg_set_game_last_node_count(this.ptr,t)}get perfect_chance(){return _.__wbg_get_game_perfect_chance(this.ptr)}set perfect_chance(t){_.__wbg_set_game_perfect_chance(this.ptr,t)}current_board_cells(){return _.game_current_board_cells(this.ptr)}current_board_len(){return _.game_current_board_len(this.ptr)>>>0}current_turn(){return _.game_current_turn(this.ptr)>>>0}score(){return _.game_score(this.ptr)}winning(){var t=_.game_winning(this.ptr);return 2===t?void 0:t}has_won(){var t=_.game_has_won(this.ptr);return 2===t?void 0:t}current_cell_state(t){k(t,E);var e=_.game_current_cell_state(this.ptr,t.ptr);return A.__wrap(e)}set_search_depth(t){_.game_set_search_depth(this.ptr,t)}set_selected(t){k(t,E),_.game_set_selected(this.ptr,t.ptr)}set_perfect_chance(t){_.game_set_perfect_chance(this.ptr,t)}clear_selected(){_.game_clear_selected(this.ptr)}make_move(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;return e.ptr=0,_.game_make_move(this.ptr,r,n)>>>0}execute_move(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;e.ptr=0,_.game_execute_move(this.ptr,r,n)}execute_jump(t,e){k(t,E);var r=t.ptr;t.ptr=0,k(e,E);var n=e.ptr;e.ptr=0,_.game_execute_jump(this.ptr,r,n)}push_new_board(t){k(t,j);var e=t.ptr;t.ptr=0,_.game_push_new_board(this.ptr,e)}set_current(t){k(t,j);var e=t.ptr;t.ptr=0,_.game_set_current(this.ptr,e)}constructor(t,e,r,n,a){var c=_.game_new(t,e,r,n,a);return B.__wrap(c)}static new_with_canvas(t,e,r,n,a,c,o,i){var s=w(c,_.__wbindgen_malloc,_.__wbindgen_realloc),u=b,l=_.game_new_with_canvas(t,e,r,n,a,s,u,o,i);return B.__wrap(l)}set_painter(t){k(t,q);var e=t.ptr;t.ptr=0,_.game_set_painter(this.ptr,e)}draw(){_.game_draw(this.ptr)}ai_move(){_.game_ai_move(this.ptr)}}class q{static __wrap(t){const e=Object.create(q.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_painter_free(t)}constructor(t,e,r){var n=w(r,_.__wbindgen_malloc,_.__wbindgen_realloc),a=b,c=_.painter_new(t,e,n,a);return q.__wrap(c)}static new_with_canvas(t,e,r){var n=_.painter_new_with_canvas(t,e,d(r));return q.__wrap(n)}set_square_outline(t){_.painter_set_square_outline(this.ptr,d(t))}set_outline_width(t){_.painter_set_outline_width(this.ptr,t)}set_draw_outline(t){_.painter_set_draw_outline(this.ptr,t)}reset_dimensions(){_.painter_reset_dimensions(this.ptr)}validate_board_dim(t){return k(t,j),0!==_.painter_validate_board_dim(this.ptr,t.ptr)}draw(t){k(t,j),_.painter_draw(this.ptr,t.ptr)}}class C{static __wrap(t){const e=Object.create(C.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_piece_free(t)}get team(){return _.__wbg_get_piece_team(this.ptr)>>>0}set team(t){_.__wbg_set_piece_team(this.ptr,t)}get strength(){return _.__wbg_get_piece_strength(this.ptr)>>>0}set strength(t){_.__wbg_set_piece_strength(this.ptr,t)}constructor(t,e){var r=_.piece_new(t,e);return C.__wrap(r)}}class A{static __wrap(t){const e=Object.create(A.prototype);return e.ptr=t,e}__destroy_into_raw(){const t=this.ptr;return this.ptr=0,t}free(){const t=this.__destroy_into_raw();_.__wbg_square_free(t)}get occupant(){var t=_.__wbg_get_square_occupant(this.ptr);return 0===t?void 0:C.__wrap(t)}set occupant(t){let e=0;y(t)||(k(t,C),e=t.ptr,t.ptr=0),_.__wbg_set_square_occupant(this.ptr,e)}get state(){return _.__wbg_get_square_state(this.ptr)>>>0}set state(t){_.__wbg_set_square_state(this.ptr,t)}constructor(t,e){let r=0;y(e)||(k(e,C),r=e.ptr,e.ptr=0);var n=_.square_new(t,r);return A.__wrap(n)}static pc(t,e){var r=_.square_pc(t,e);return A.__wrap(r)}static empty(){var t=_.square_empty();return A.__wrap(t)}static unplay(){var t=_.square_unplay();return A.__wrap(t)}}function U(t){!function(t){const e=o(t);(function(t){t<36||(c[t]=i,i=t)})(t)}(t)}function W(t,e){return d(p(t,e))}function R(){return d(new Error)}function Z(t,e){var r=w(o(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),n=b;v()[t/4+1]=n,v()[t/4+0]=r}function $(t,e){try{console.error(p(t,e))}finally{_.__wbindgen_free(t,e)}}function Y(t,e,r){var n,_;o(t).randomFillSync((n=e,_=r,l().subarray(n/1,n/1+_)))}function M(t,e){o(t).getRandomValues(o(e))}function D(){return T((function(){return d(self.self)}),arguments)}function z(t){return d(o(t).crypto)}function J(t){return d(o(t).msCrypto)}function P(t){return void 0===o(t)}function F(t,e,r){return d(o(t).require(p(e,r)))}function G(t){return d(o(t).getRandomValues)}function L(){return d(t)}function N(t){return o(t)instanceof Window}function H(t){var e=o(t).document;return y(e)?0:d(e)}function X(t,e,r){var n=o(t).getElementById(p(e,r));return y(n)?0:d(n)}function K(t){console.error(o(t))}function V(t){console.log(o(t))}function Q(t){return o(t)instanceof CanvasRenderingContext2D}function tt(t,e){o(t).strokeStyle=o(e)}function et(t,e){o(t).fillStyle=o(e)}function rt(t,e){o(t).lineWidth=e}function nt(t){o(t).beginPath()}function _t(t){o(t).fill()}function at(t){o(t).stroke()}function ct(){return T((function(t,e,r,n,_,a){o(t).arc(e,r,n,_,a)}),arguments)}function ot(t,e,r,n,_){o(t).fillRect(e,r,n,_)}function it(t,e,r,n,_){o(t).strokeRect(e,r,n,_)}function st(t){return o(t)instanceof HTMLCanvasElement}function ut(t,e){o(t).width=e>>>0}function lt(t,e){o(t).height=e>>>0}function pt(){return T((function(t,e,r){var n=o(t).getContext(p(e,r));return y(n)?0:d(n)}),arguments)}function dt(t,e){return d(new Function(p(t,e)))}function gt(){return T((function(t,e){return d(o(t).call(o(e)))}),arguments)}function bt(){return T((function(){return d(self.self)}),arguments)}function ht(){return T((function(){return d(window.window)}),arguments)}function ft(){return T((function(){return d(globalThis.globalThis)}),arguments)}function wt(){return T((function(){return d(r.g.global)}),arguments)}function mt(t){return d(o(t).buffer)}function vt(t){return d(new Uint8Array(o(t)))}function yt(t,e,r){o(t).set(o(e),r>>>0)}function kt(t){return o(t).length}function xt(t){return d(new Uint8Array(t>>>0))}function Tt(t,e,r){return d(o(t).subarray(e>>>0,r>>>0))}function Ot(t){return d(o(t))}function St(t,e){var r=w(g(o(e)),_.__wbindgen_malloc,_.__wbindgen_realloc),n=b;v()[t/4+1]=n,v()[t/4+0]=r}function It(t,e){throw new Error(p(t,e))}function jt(){return d(_.memory)}}))},813:(t,e,r)=>{"use strict";var n=([n])=>r.v(e,t.id,"5834d1c20fa287719232",{"./draught_bg.js":{__wbindgen_object_drop_ref:n.ug,__wbindgen_string_new:n.h4,__wbg_new_693216e109162396:n.Ih,__wbg_stack_0ddaca5d1abfb52f:n.yq,__wbg_error_09919627ac0992f5:n.gk,__wbg_randomFillSync_d2ba53160aec6aba:n.Os,__wbg_getRandomValues_e57c9b75ddead065:n.ae,__wbg_self_86b4b13392c7af56:n.U5,__wbg_crypto_b8c92eaac23d0d80:n.iY,__wbg_msCrypto_9ad6677321a08dd8:n.mS,__wbindgen_is_undefined:n.XP,__wbg_require_f5521a5b85ad2542:n.K0,__wbg_getRandomValues_dd27e6b0652b3236:n.yX,__wbg_static_accessor_MODULE_452b4680e8614c81:n.DA,__wbg_instanceof_Window_434ce1849eb4e0fc:n.xA,__wbg_document_5edd43643d1060d9:n.p$,__wbg_getElementById_b30e88aff96f66a1:n.zG,__wbg_error_ca520cb687b085a1:n.q5,__wbg_log_fbd13631356d44e4:n.r2,__wbg_instanceof_CanvasRenderingContext2d_e8b3a478a1b32d55:n.pv,__wbg_setstrokeStyle_4c9ff9ea0c0c4092:n.cF,__wbg_setfillStyle_680401a47926faa5:n.N_,__wbg_setlineWidth_4819b1bc5c54719b:n.S2,__wbg_beginPath_5a6fcb370b5b8eb3:n.on,__wbg_fill_0ced47ff22561640:n.CZ,__wbg_stroke_46c6315e5e1f35db:n.Ox,__wbg_arc_b3cb1027882c81bb:n.kP,__wbg_fillRect_7ad775936c1881ce:n.GR,__wbg_strokeRect_a3f2f571f1ad9730:n.Yl,__wbg_instanceof_HtmlCanvasElement_a6157e470d06b638:n.CU,__wbg_setwidth_362e8db8cbadbe96:n.RA,__wbg_setheight_28f53831182cc410:n.Si,__wbg_getContext_bd4e9445094eda84:n.c7,__wbg_newnoargs_f579424187aa1717:n.bf,__wbg_call_89558c3e96703ca1:n.Z4,__wbg_self_e23d74ae45fb17d1:n.tL,__wbg_window_b4be7f48b24ac56e:n.Qu,__wbg_globalThis_d61b1f48a57191ae:n.EB,__wbg_global_e7669da72fd7f239:n.Yc,__wbg_buffer_5e74a88a1424a2e0:n.rf,__wbg_new_e3b800e570795b3c:n.Ts,__wbg_set_5b8081e9d002f0df:n.Mz,__wbg_length_30803400a8f15c59:n.Zu,__wbg_newwithlength_5f4ce114a24dfe1e:n._G,__wbg_subarray_a68f835ca2af506f:n.kC,__wbindgen_object_clone_ref:n.m_,__wbindgen_debug_string:n.fY,__wbindgen_throw:n.Or,__wbindgen_memory:n.oH}});r.a(t,(t=>{var e=t([r(171)]);return e.then?e.then(n):n(e)}),1)},10:(t,e,r)=>{"use strict";r.a(t,(async t=>{r.r(e);var n=r(171),_=t([n]);n=(_.then?await _:_)[0];var a=8,c=8,o=3,i=4,s=.5;const u="human_turn.thinking",l="human_turn.from_selected";(0,n.wc)(),document.getElementById("status-p");const p=document.getElementById("status-d"),d=document.getElementById("team-p"),g=document.getElementById("node-count"),b=document.getElementById("winning-p");document.getElementById("startBtn").onclick=T;let h=null,f=null,w=function(t,e="danger",r=!0){null!=f&&clearInterval(f),p.className=`alert alert-${e}`,p.innerText=t,p.hidden=!1,r&&(f=setTimeout((()=>{p.hidden=!0}),3e3))},m=u,v=null,y=null,k=[];T();const x=document.getElementById("game-canvas");function T(){v=new n.lA(a,c,o,n.SZ.Black,i),y=new n.Ck(720,720,"game-canvas"),v.set_painter(y),v.draw(),clearInterval(h),O(),S(),k=[],m=u}function O(){switch(v.current_turn()){case n.SZ.White:d.innerText="⚪ White ⚪";break;case n.SZ.Black:d.innerText="🔴 Black 🔴"}}function S(){switch(v.winning()){case void 0:b.innerText="";break;case n.SZ.White:b.innerText="👑 White 👑";break;case n.SZ.Black:b.innerText="👑 Black 👑"}}x.addEventListener("click",(t=>{var e=function(t,e){var r=t.getBoundingClientRect();return{x:e.clientX-r.left,y:e.clientY-r.top}}(x,t);!function(t){switch(m){case u:if(v.current_cell_state(t).state!=n.i0.Occupied)return;if(v.current_cell_state(t).occupant.team!=v.current_turn())return;k.push(t),m=l,v.set_selected(t),v.draw();break;case l:if(!k[0].eq(t)){if(v.current_cell_state(t).state!=n.i0.Empty)return;if(k.push(t),2!=k.length)return w(`Error: wrong number of clicks to process ${k.length}`),void console.error(`Error: wrong number of clicks to process ${k.length}`);switch(v.make_move(k[0],k[1])){case n.Tt.Allowed:q.checked&&void 0===v.has_won()&&(v.ai_move(),g.innerText=`searched ${v.last_node_count.toLocaleString("en-GB")} possible moves`);break;case n.Tt.IllegalTrajectory:w("You can't move like that!");break;case n.Tt.JumpingSameTeam:w("You can't jump your own piece!");break;case n.Tt.NoJumpablePiece:w("There's nothing to jump!");break;case n.Tt.OccupiedDest:w("There's a piece there!");break;case n.Tt.OutOfBounds:w("That square's not on the board! (how have you managed that?)");break;case n.Tt.UnoccupiedSrc:w("There's no piece to move!");break;case n.Tt.Unplayable:w("That's not a playable square!");break;case n.Tt.WrongTeamSrc:w("That's not your piece!")}}v.clear_selected(),v.draw(),k=[],m=u;break;case"ai_turn":console.log("It's the AI's turn!")}O(),S(),function(){switch(v.has_won()){case void 0:break;case n.SZ.White:w("You Lost!"),h=setInterval((()=>{T()}),3e3);break;case n.SZ.Black:w("You Won!","success"),h=setInterval((()=>{T()}),3e3)}}()}(new n.rh(Math.floor(e.y/x.clientHeight*c),Math.floor(e.x/x.clientWidth*a)))}));const I=document.getElementById("width");I.onchange=()=>{a=parseInt(I.value),T()},I.value=8;const j=document.getElementById("height");j.onchange=()=>{c=parseInt(j.value),E.max=c/2-1,T()},j.value=8;const E=document.getElementById("play_rows");E.onchange=()=>{o=parseInt(E.value),T()},E.value=3;const B=document.getElementById("ai_search_depth");B.onchange=()=>{i=parseInt(B.value),v.set_search_depth(i),i>4&&w("This increases thinking time exponentially, be careful (probably don't go past 6)","warning")},B.value=4;const q=document.getElementById("ai-checkbox");q.onchange=()=>{};const C=document.getElementById("ai_difficulty");C.onchange=()=>{s=parseInt(C.value)/100,v.set_perfect_chance(s)},C.value=50}))}}]); //# sourceMappingURL=10.bootstrap.js.map \ No newline at end of file diff --git a/10.bootstrap.js.map b/10.bootstrap.js.map index 2804a00..2fdc52a 100644 --- a/10.bootstrap.js.map +++ b/10.bootstrap.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://draught/../pkg/draught_bg.js","webpack://draught/./index.js"],"names":["heap","Array","fill","undefined","getObject","idx","push","heap_next","length","cachedTextDecoder","TextDecoder","module","require","ignoreBOM","fatal","decode","cachegetUint8Memory0","getUint8Memory0","buffer","Uint8Array","getStringFromWasm0","ptr","len","subarray","addHeapObject","obj","debugString","val","type","description","name","isArray","debug","i","builtInMatches","exec","toString","call","className","JSON","stringify","_","Error","message","stack","WASM_VECTOR_LEN","cachedTextEncoder","TextEncoder","encodeString","encodeInto","arg","view","buf","encode","set","read","written","passStringToWasm0","malloc","realloc","mem","offset","code","charCodeAt","slice","cachegetInt32Memory0","getInt32Memory0","Int32Array","isLikeNone","x","_assertClass","instance","klass","init_wasm","handleError","f","args","apply","this","e","Object","freeze","Move","Jump","Team","Black","White","SquareState","Man","King","Empty","Occupied","Unplayable","Moveable","Allowed","UnoccupiedSrc","OccupiedDest","OutOfBounds","WrongTeamSrc","IllegalTrajectory","NoJumpablePiece","JumpingSameTeam","Board","create","prototype","__destroy_into_raw","arg0","ret","Square","__wrap","square","ptr0","BrdIdx","row","col","from","to","ptr1","from_square_occupant","Piece","ptr2","team","jumpee","from_occ","width","height","current_turn","board","piece_rows","other","Game","search_depth","new_chance","first_turn","canvas_id","canvas_width","canvas_height","len0","value","Painter","canvas","strength","state","occupant","__wbindgen_object_drop_ref","dropObject","takeObject","__wbindgen_string_new","arg1","__wbg_new_59cb74e423758ede","__wbg_stack_558ba5917b466edd","__wbg_error_4bb6c2a97407129a","console","error","__wbg_self_86b4b13392c7af56","self","arguments","__wbg_require_f5521a5b85ad2542","arg2","__wbg_crypto_b8c92eaac23d0d80","crypto","__wbg_msCrypto_9ad6677321a08dd8","msCrypto","__wbindgen_is_undefined","__wbg_getRandomValues_dd27e6b0652b3236","getRandomValues","__wbg_getRandomValues_e57c9b75ddead065","__wbg_randomFillSync_d2ba53160aec6aba","randomFillSync","__wbg_static_accessor_MODULE_452b4680e8614c81","__wbg_instanceof_Window_11e25482011fc506","Window","__wbg_document_5aff8cd83ef968f5","document","__wbg_getElementById_b180ea4ada06a837","getElementById","__wbg_error_d95afd6217cfd219","__wbg_log_9a99fb1af846153b","log","__wbg_instanceof_CanvasRenderingContext2d_779e79c4121aa91b","CanvasRenderingContext2D","__wbg_setstrokeStyle_2939ee453716e462","strokeStyle","__wbg_setfillStyle_af790b5baf4d3210","fillStyle","__wbg_setlineWidth_3e6b1837ae38d099","lineWidth","__wbg_beginPath_2378575e37027ad3","beginPath","__wbg_fill_558339447ed6ad43","__wbg_stroke_c1e0313c58997dcf","stroke","__wbg_arc_fffd87d9113dce32","arg3","arg4","arg5","arc","__wbg_fillRect_46ffc8d2cef7e298","fillRect","__wbg_strokeRect_7ea34fad8a7f0fe2","strokeRect","__wbg_instanceof_HtmlCanvasElement_fd3cbbe3906d7792","HTMLCanvasElement","__wbg_setwidth_f3c88eb520ba8d47","__wbg_setheight_5a1abba41e35c42a","__wbg_getContext_813df131fcbd6e91","getContext","__wbg_newnoargs_9fdd8f3961dd1bee","Function","__wbg_call_ba36642bd901572b","__wbg_self_bb69a836a72ec6e9","__wbg_window_3304fc4b414c9693","window","__wbg_globalThis_e0d21cabc6630763","globalThis","__wbg_global_8463719227271676","g","global","__wbg_buffer_9e184d6f785de5ed","__wbg_new_e8101319e4cf95fc","__wbg_set_e8ae7b27314e8b98","__wbg_length_2d56cb37075fcfb1","__wbg_newwithlength_a8d1dbcbe703a5c6","__wbg_subarray_901ede8318da52a6","__wbindgen_object_clone_ref","__wbindgen_debug_string","__wbindgen_throw","__wbindgen_memory","BOARD_WIDTH","BOARD_HEIGHT","PIECE_ROWS","SEARCH_DEPTH","PERFECT_CHANCE","GameState","statusAlert","teamText","nodeCountText","winningText","onclick","start_game","wonTimeout","statusTimeout","setStatus","txt","alertType","hide","clearInterval","innerText","hidden","setTimeout","current_state","game","painter","clicks","set_painter","draw","updateTeamText","updateWinningText","winning","addEventListener","event","mousepos","evt","rect","getBoundingClientRect","clientX","left","y","clientY","top","getMousePos","cell_coord","current_cell_state","set_selected","eq","make_move","aiCheckBox","checked","has_won","ai_move","last_node_count","toLocaleString","clear_selected","setInterval","checkWon","process_canvas_click","Math","floor","clientHeight","clientWidth","widthBox","onchange","parseInt","heightBox","pieceRowsBox","max","aiSearchDepthBox","set_search_depth","aiPerfectChance","set_perfect_chance"],"mappings":"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","file":"10.bootstrap.js","sourcesContent":["import * as wasm from './draught_bg.wasm';\n\nconst heap = new Array(32).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length);\n getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len);\n\n const mem = getUint8Memory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachegetInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n/**\n*/\nexport function init_wasm() {\n wasm.init_wasm();\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* Move/Jump, for use in Move\n*/\nexport const MoveType = Object.freeze({ Move:0,\"0\":\"Move\",Jump:1,\"1\":\"Jump\", });\n/**\n* Black/White\n*/\nexport const Team = Object.freeze({ Black:0,\"0\":\"Black\",White:1,\"1\":\"White\", });\n/**\n* Man/King\n*/\nexport const Strength = Object.freeze({ Man:0,\"0\":\"Man\",King:1,\"1\":\"King\", });\n/**\n* Model board square as Empty/Occupied/Unplayable\n*/\nexport const SquareState = Object.freeze({ Empty:0,\"0\":\"Empty\",Occupied:1,\"1\":\"Occupied\",Unplayable:2,\"2\":\"Unplayable\", });\n/**\n* Possible outcomes of trying to move\n*/\nexport const Moveable = Object.freeze({ Allowed:0,\"0\":\"Allowed\",UnoccupiedSrc:1,\"1\":\"UnoccupiedSrc\",OccupiedDest:2,\"2\":\"OccupiedDest\",OutOfBounds:3,\"3\":\"OutOfBounds\",Unplayable:4,\"4\":\"Unplayable\",WrongTeamSrc:5,\"5\":\"WrongTeamSrc\",IllegalTrajectory:6,\"6\":\"IllegalTrajectory\",NoJumpablePiece:7,\"7\":\"NoJumpablePiece\",JumpingSameTeam:8,\"8\":\"JumpingSameTeam\", });\n/**\n* Single state of a checkers board\n*/\nexport class Board {\n\n static __wrap(ptr) {\n const obj = Object.create(Board.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_board_free(ptr);\n }\n /**\n * @returns {number}\n */\n get width() {\n var ret = wasm.__wbg_get_board_width(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set width(arg0) {\n wasm.__wbg_set_board_width(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get height() {\n var ret = wasm.__wbg_get_board_height(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set height(arg0) {\n wasm.__wbg_set_board_height(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get current_turn() {\n var ret = wasm.__wbg_get_board_current_turn(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set current_turn(arg0) {\n wasm.__wbg_set_board_current_turn(this.ptr, arg0);\n }\n /**\n * Get a copy of a board square by 1D array index\n * @param {number} idx\n * @returns {Square}\n */\n cell(idx) {\n var ret = wasm.board_cell(this.ptr, idx);\n return Square.__wrap(ret);\n }\n /**\n * Get a copy of a board square by 1D array index\n * @param {number} idx\n * @param {Square} square\n */\n set_cell(idx, square) {\n _assertClass(square, Square);\n var ptr0 = square.ptr;\n square.ptr = 0;\n wasm.board_set_cell(this.ptr, idx, ptr0);\n }\n /**\n * Get a copy of a board square by 2D [`BrdIdx`] index\n * @param {BrdIdx} idx\n * @returns {Square}\n */\n grid_cell(idx) {\n _assertClass(idx, BrdIdx);\n var ptr0 = idx.ptr;\n idx.ptr = 0;\n var ret = wasm.board_grid_cell(this.ptr, ptr0);\n return Square.__wrap(ret);\n }\n /**\n * Transform a 2D row/column board index into a single 1D index for use with [`Board::cells`]\n * @param {number} row\n * @param {number} col\n * @returns {number}\n */\n cell_index(row, col) {\n var ret = wasm.board_cell_index(this.ptr, row, col);\n return ret >>> 0;\n }\n /**\n * 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`]\n * @param {BrdIdx} idx\n * @returns {number}\n */\n cell_idx(idx) {\n _assertClass(idx, BrdIdx);\n var ptr0 = idx.ptr;\n idx.ptr = 0;\n var ret = wasm.board_cell_idx(this.ptr, ptr0);\n return ret >>> 0;\n }\n /**\n * Transform a 1D array index (for [`Board::cells`]) into a 2D game board index (by row/col)\n * @param {number} idx\n * @returns {BrdIdx}\n */\n board_index(idx) {\n var ret = wasm.board_board_index(this.ptr, idx);\n return BrdIdx.__wrap(ret);\n }\n /**\n * Check whether a move given by source and destination indices is legal\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n can_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_can_move(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Check that given move trajectory is valid for a man piece\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @param {Piece} from_square_occupant\n * @returns {number}\n */\n validate_man_move(from, to, from_square_occupant) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n _assertClass(from_square_occupant, Piece);\n var ptr2 = from_square_occupant.ptr;\n from_square_occupant.ptr = 0;\n var ret = wasm.board_validate_man_move(this.ptr, ptr0, ptr1, ptr2);\n return ret >>> 0;\n }\n /**\n * Check that given move trajectory is valid for a king piece\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @param {Piece} from_square_occupant\n * @returns {number}\n */\n validate_king_move(from, to, from_square_occupant) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n _assertClass(from_square_occupant, Piece);\n var ptr2 = from_square_occupant.ptr;\n from_square_occupant.ptr = 0;\n var ret = wasm.board_validate_king_move(this.ptr, ptr0, ptr1, ptr2);\n return ret >>> 0;\n }\n /**\n * Get cell index of jumpee square given from and to locations\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n jumpee_idx(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_jumpee_idx(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Get a pointer to the backing array of board squares, [`Board::cells`]\n * @returns {number}\n */\n cells() {\n var ret = wasm.board_cells(this.ptr);\n return ret;\n }\n /**\n * Get the number of board squares\n * @returns {number}\n */\n num_cells() {\n var ret = wasm.board_num_cells(this.ptr);\n return ret >>> 0;\n }\n /**\n * Get the number of remaining pieces\n * @returns {number}\n */\n num_pieces() {\n var ret = wasm.board_num_pieces(this.ptr);\n return ret >>> 0;\n }\n /**\n * Get the number of remaining pieces for a player\n * @param {number} team\n * @returns {number}\n */\n num_player(team) {\n var ret = wasm.board_num_player(this.ptr, team);\n return ret >>> 0;\n }\n /**\n * Get the score value, Black - White pieces\n * @returns {number}\n */\n score() {\n var ret = wasm.board_score(this.ptr);\n return ret;\n }\n /**\n * Get the state of a board square by 1D array index\n * @param {number} idx\n * @returns {number}\n */\n cell_state(idx) {\n var ret = wasm.board_cell_state(this.ptr, idx);\n return ret >>> 0;\n }\n /**\n * Get new board derived from current with given move applied\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {Board}\n */\n apply_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_apply_move(this.ptr, ptr0, ptr1);\n return Board.__wrap(ret);\n }\n /**\n * Get new board derived from current with given jump applied\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {Board}\n */\n apply_jump(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_apply_jump(this.ptr, ptr0, ptr1);\n return Board.__wrap(ret);\n }\n /**\n * Get row index for current team, top row for black, bottom row for white\n * @returns {number}\n */\n king_row_idx() {\n var ret = wasm.board_king_row_idx(this.ptr);\n return ret >>> 0;\n }\n /**\n * Unwrap the jumpee piece from the square and [`Board::check_jumpee_team`] with [`Moveable`] response\n * @param {Square} jumpee\n * @param {Piece} from_occ\n * @returns {number}\n */\n static validate_jumpee(jumpee, from_occ) {\n _assertClass(jumpee, Square);\n var ptr0 = jumpee.ptr;\n jumpee.ptr = 0;\n _assertClass(from_occ, Piece);\n var ptr1 = from_occ.ptr;\n from_occ.ptr = 0;\n var ret = wasm.board_validate_jumpee(ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Check that the source piece and the jumpee are of opposing teams\n * @param {Piece} from\n * @param {Piece} jumpee\n * @returns {boolean}\n */\n static check_jumpee_team(from, jumpee) {\n _assertClass(from, Piece);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(jumpee, Piece);\n var ptr1 = jumpee.ptr;\n jumpee.ptr = 0;\n var ret = wasm.board_check_jumpee_team(ptr0, ptr1);\n return ret !== 0;\n }\n /**\n * Initialise a game board without game pieces\n * @param {number} width\n * @param {number} height\n * @param {number} current_turn\n */\n constructor(width, height, current_turn) {\n var ret = wasm.board_new(width, height, current_turn);\n return Board.__wrap(ret);\n }\n /**\n * Reset the given board to a starting layout with 3 rows of opposing pieces\n * @param {Board} board\n * @param {number} piece_rows\n * @returns {Board}\n */\n static init_game(board, piece_rows) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n var ret = wasm.board_init_game(ptr0, piece_rows);\n return Board.__wrap(ret);\n }\n}\n/**\n* Rank 2 tensor index to identify a board square by row and column\n*/\nexport class BrdIdx {\n\n static __wrap(ptr) {\n const obj = Object.create(BrdIdx.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_brdidx_free(ptr);\n }\n /**\n * @returns {number}\n */\n get row() {\n var ret = wasm.__wbg_get_brdidx_row(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set row(arg0) {\n wasm.__wbg_set_brdidx_row(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get col() {\n var ret = wasm.__wbg_get_brdidx_col(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set col(arg0) {\n wasm.__wbg_set_brdidx_col(this.ptr, arg0);\n }\n /**\n * @param {number} row\n * @param {number} col\n */\n constructor(row, col) {\n var ret = wasm.brdidx_from(row, col);\n return BrdIdx.__wrap(ret);\n }\n /**\n * @param {BrdIdx} other\n * @returns {boolean}\n */\n eq(other) {\n _assertClass(other, BrdIdx);\n var ret = wasm.brdidx_eq(this.ptr, other.ptr);\n return ret !== 0;\n }\n}\n/**\n* Root-level structure for managing the game as a collection of board states\n*/\nexport class Game {\n\n static __wrap(ptr) {\n const obj = Object.create(Game.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_game_free(ptr);\n }\n /**\n * @returns {number}\n */\n get last_node_count() {\n var ret = wasm.__wbg_get_game_last_node_count(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set last_node_count(arg0) {\n wasm.__wbg_set_game_last_node_count(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get perfect_chance() {\n var ret = wasm.__wbg_get_game_perfect_chance(this.ptr);\n return ret;\n }\n /**\n * @param {number} arg0\n */\n set perfect_chance(arg0) {\n wasm.__wbg_set_game_perfect_chance(this.ptr, arg0);\n }\n /**\n * Get pointer to current board's squares\n * @returns {number}\n */\n current_board_cells() {\n var ret = wasm.game_current_board_cells(this.ptr);\n return ret;\n }\n /**\n * Get pointer to current board's squares\n * @returns {number}\n */\n current_board_len() {\n var ret = wasm.game_current_board_len(this.ptr);\n return ret >>> 0;\n }\n /**\n * Current turn's team\n * @returns {number}\n */\n current_turn() {\n var ret = wasm.game_current_turn(this.ptr);\n return ret >>> 0;\n }\n /**\n * Current board's score\n * @returns {number}\n */\n score() {\n var ret = wasm.game_score(this.ptr);\n return ret;\n }\n /**\n * Get currently winning player\n * @returns {number | undefined}\n */\n winning() {\n var ret = wasm.game_winning(this.ptr);\n return ret === 2 ? undefined : ret;\n }\n /**\n * Check if a player has won\n * @returns {number | undefined}\n */\n has_won() {\n var ret = wasm.game_has_won(this.ptr);\n return ret === 2 ? undefined : ret;\n }\n /**\n * Get square on current board for given index\n * @param {BrdIdx} idx\n * @returns {Square}\n */\n current_cell_state(idx) {\n _assertClass(idx, BrdIdx);\n var ret = wasm.game_current_cell_state(this.ptr, idx.ptr);\n return Square.__wrap(ret);\n }\n /**\n * Set tree depth for AI to search to\n * @param {number} search_depth\n */\n set_search_depth(search_depth) {\n wasm.game_set_search_depth(this.ptr, search_depth);\n }\n /**\n * Set given index as selected piece\n * TODO: Check whether valid square?\n * @param {BrdIdx} idx\n */\n set_selected(idx) {\n _assertClass(idx, BrdIdx);\n wasm.game_set_selected(this.ptr, idx.ptr);\n }\n /**\n * Set proportion of perfect moves from AI\n * @param {number} new_chance\n */\n set_perfect_chance(new_chance) {\n wasm.game_set_perfect_chance(this.ptr, new_chance);\n }\n /**\n * Clear currently selected piece\n */\n clear_selected() {\n wasm.game_clear_selected(this.ptr);\n }\n /**\n * Attempt to make a move given a source and destination index\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n make_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.game_make_move(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Update board state with given move and push new board into current state\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n */\n execute_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n wasm.game_execute_move(this.ptr, ptr0, ptr1);\n }\n /**\n * Update board state with given jump move and push new board into current state\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n */\n execute_jump(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n wasm.game_execute_jump(this.ptr, ptr0, ptr1);\n }\n /**\n * Push current board into the previous turns and set given board to current\n * @param {Board} board\n */\n push_new_board(board) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n wasm.game_push_new_board(this.ptr, ptr0);\n }\n /**\n * Set current board to given\n * @param {Board} board\n */\n set_current(board) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n wasm.game_set_current(this.ptr, ptr0);\n }\n /**\n * Get new game without board renderer\n * @param {number} width\n * @param {number} height\n * @param {number} piece_rows\n * @param {number} first_turn\n * @param {number} search_depth\n */\n constructor(width, height, piece_rows, first_turn, search_depth) {\n var ret = wasm.game_new(width, height, piece_rows, first_turn, search_depth);\n return Game.__wrap(ret);\n }\n /**\n * Get a new game with canvas ID and dimensions\n * @param {number} width\n * @param {number} height\n * @param {number} piece_rows\n * @param {number} first_turn\n * @param {number} search_depth\n * @param {string} canvas_id\n * @param {number} canvas_width\n * @param {number} canvas_height\n * @returns {Game}\n */\n static new_with_canvas(width, height, piece_rows, first_turn, search_depth, canvas_id, canvas_width, canvas_height) {\n var ptr0 = passStringToWasm0(canvas_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.game_new_with_canvas(width, height, piece_rows, first_turn, search_depth, ptr0, len0, canvas_width, canvas_height);\n return Game.__wrap(ret);\n }\n /**\n * Set painter for rendering boards\n * @param {Painter} value\n */\n set_painter(value) {\n _assertClass(value, Painter);\n var ptr0 = value.ptr;\n value.ptr = 0;\n wasm.game_set_painter(this.ptr, ptr0);\n }\n /**\n * Draw current board using painter if exists\n */\n draw() {\n wasm.game_draw(this.ptr);\n }\n /**\n * Create computer, get move from current board and update current board\n */\n ai_move() {\n wasm.game_ai_move(this.ptr);\n }\n}\n/**\n* Used to paint boards onto HTML canvases\n*/\nexport class Painter {\n\n static __wrap(ptr) {\n const obj = Object.create(Painter.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_painter_free(ptr);\n }\n /**\n * Default constructor which queries for canvas by ID\n * @param {number} width\n * @param {number} height\n * @param {string} canvas_id\n */\n constructor(width, height, canvas_id) {\n var ptr0 = passStringToWasm0(canvas_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.painter_new(width, height, ptr0, len0);\n return Painter.__wrap(ret);\n }\n /**\n * Constructor with given canvas element\n * @param {number} width\n * @param {number} height\n * @param {HTMLCanvasElement} canvas\n * @returns {Painter}\n */\n static new_with_canvas(width, height, canvas) {\n var ret = wasm.painter_new_with_canvas(width, height, addHeapObject(canvas));\n return Painter.__wrap(ret);\n }\n /**\n * Set new square outline colour value\n * @param {any} value\n */\n set_square_outline(value) {\n wasm.painter_set_square_outline(this.ptr, addHeapObject(value));\n }\n /**\n * Set new line width for outlining squares\n * @param {number} value\n */\n set_outline_width(value) {\n wasm.painter_set_outline_width(this.ptr, value);\n }\n /**\n * Set whether squares are outlined\n * @param {boolean} value\n */\n set_draw_outline(value) {\n wasm.painter_set_draw_outline(this.ptr, value);\n }\n /**\n * Reset the canvas dimensions to the given width and height\n */\n reset_dimensions() {\n wasm.painter_reset_dimensions(this.ptr);\n }\n /**\n * Check whether given canvas dimensions divide evenly by given board dimenions\n * @param {Board} board\n * @returns {boolean}\n */\n validate_board_dim(board) {\n _assertClass(board, Board);\n var ret = wasm.painter_validate_board_dim(this.ptr, board.ptr);\n return ret !== 0;\n }\n /**\n * Draw a board onto the canvas\n * @param {Board} board\n */\n draw(board) {\n _assertClass(board, Board);\n wasm.painter_draw(this.ptr, board.ptr);\n }\n}\n/**\n* Game piece given by its team and strength (normal or kinged)\n*/\nexport class Piece {\n\n static __wrap(ptr) {\n const obj = Object.create(Piece.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_piece_free(ptr);\n }\n /**\n * @returns {number}\n */\n get team() {\n var ret = wasm.__wbg_get_piece_team(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set team(arg0) {\n wasm.__wbg_set_piece_team(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get strength() {\n var ret = wasm.__wbg_get_piece_strength(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set strength(arg0) {\n wasm.__wbg_set_piece_strength(this.ptr, arg0);\n }\n /**\n * @param {number} team\n * @param {number} strength\n */\n constructor(team, strength) {\n var ret = wasm.piece_new(team, strength);\n return Piece.__wrap(ret);\n }\n}\n/**\n* Board squares given by a state and a possible occupying game piece\n*/\nexport class Square {\n\n static __wrap(ptr) {\n const obj = Object.create(Square.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_square_free(ptr);\n }\n /**\n * Game piece if square is occupied\n * @returns {Piece | undefined}\n */\n get occupant() {\n var ret = wasm.__wbg_get_square_occupant(this.ptr);\n return ret === 0 ? undefined : Piece.__wrap(ret);\n }\n /**\n * Game piece if square is occupied\n * @param {Piece | undefined} arg0\n */\n set occupant(arg0) {\n let ptr0 = 0;\n if (!isLikeNone(arg0)) {\n _assertClass(arg0, Piece);\n ptr0 = arg0.ptr;\n arg0.ptr = 0;\n }\n wasm.__wbg_set_square_occupant(this.ptr, ptr0);\n }\n /**\n * Description of whether the square is occupied or an unplayable, i.e. off-lattice square\n * @returns {number}\n */\n get state() {\n var ret = wasm.__wbg_get_square_state(this.ptr);\n return ret >>> 0;\n }\n /**\n * Description of whether the square is occupied or an unplayable, i.e. off-lattice square\n * @param {number} arg0\n */\n set state(arg0) {\n wasm.__wbg_set_square_state(this.ptr, arg0);\n }\n /**\n * Standard constructor function to form square from state and occupant\n * @param {number} state\n * @param {Piece | undefined} occupant\n */\n constructor(state, occupant) {\n let ptr0 = 0;\n if (!isLikeNone(occupant)) {\n _assertClass(occupant, Piece);\n ptr0 = occupant.ptr;\n occupant.ptr = 0;\n }\n var ret = wasm.square_new(state, ptr0);\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed piece square by team and strength\n * @param {number} team\n * @param {number} strength\n * @returns {Square}\n */\n static pc(team, strength) {\n var ret = wasm.square_pc(team, strength);\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed empty square\n * @returns {Square}\n */\n static empty() {\n var ret = wasm.square_empty();\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed unplayable square\n * @returns {Square}\n */\n static unplay() {\n var ret = wasm.square_unplay();\n return Square.__wrap(ret);\n }\n}\n\nexport function __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nexport function __wbindgen_string_new(arg0, arg1) {\n var ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nexport function __wbg_new_59cb74e423758ede() {\n var ret = new Error();\n return addHeapObject(ret);\n};\n\nexport function __wbg_stack_558ba5917b466edd(arg0, arg1) {\n var ret = getObject(arg1).stack;\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_error_4bb6c2a97407129a(arg0, arg1) {\n try {\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(arg0, arg1);\n }\n};\n\nexport function __wbg_self_86b4b13392c7af56() { return handleError(function () {\n var ret = self.self;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_require_f5521a5b85ad2542(arg0, arg1, arg2) {\n var ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));\n return addHeapObject(ret);\n};\n\nexport function __wbg_crypto_b8c92eaac23d0d80(arg0) {\n var ret = getObject(arg0).crypto;\n return addHeapObject(ret);\n};\n\nexport function __wbg_msCrypto_9ad6677321a08dd8(arg0) {\n var ret = getObject(arg0).msCrypto;\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_is_undefined(arg0) {\n var ret = getObject(arg0) === undefined;\n return ret;\n};\n\nexport function __wbg_getRandomValues_dd27e6b0652b3236(arg0) {\n var ret = getObject(arg0).getRandomValues;\n return addHeapObject(ret);\n};\n\nexport function __wbg_getRandomValues_e57c9b75ddead065(arg0, arg1) {\n getObject(arg0).getRandomValues(getObject(arg1));\n};\n\nexport function __wbg_randomFillSync_d2ba53160aec6aba(arg0, arg1, arg2) {\n getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));\n};\n\nexport function __wbg_static_accessor_MODULE_452b4680e8614c81() {\n var ret = module;\n return addHeapObject(ret);\n};\n\nexport function __wbg_instanceof_Window_11e25482011fc506(arg0) {\n var ret = getObject(arg0) instanceof Window;\n return ret;\n};\n\nexport function __wbg_document_5aff8cd83ef968f5(arg0) {\n var ret = getObject(arg0).document;\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n};\n\nexport function __wbg_getElementById_b180ea4ada06a837(arg0, arg1, arg2) {\n var ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n};\n\nexport function __wbg_error_d95afd6217cfd219(arg0) {\n console.error(getObject(arg0));\n};\n\nexport function __wbg_log_9a99fb1af846153b(arg0) {\n console.log(getObject(arg0));\n};\n\nexport function __wbg_instanceof_CanvasRenderingContext2d_779e79c4121aa91b(arg0) {\n var ret = getObject(arg0) instanceof CanvasRenderingContext2D;\n return ret;\n};\n\nexport function __wbg_setstrokeStyle_2939ee453716e462(arg0, arg1) {\n getObject(arg0).strokeStyle = getObject(arg1);\n};\n\nexport function __wbg_setfillStyle_af790b5baf4d3210(arg0, arg1) {\n getObject(arg0).fillStyle = getObject(arg1);\n};\n\nexport function __wbg_setlineWidth_3e6b1837ae38d099(arg0, arg1) {\n getObject(arg0).lineWidth = arg1;\n};\n\nexport function __wbg_beginPath_2378575e37027ad3(arg0) {\n getObject(arg0).beginPath();\n};\n\nexport function __wbg_fill_558339447ed6ad43(arg0) {\n getObject(arg0).fill();\n};\n\nexport function __wbg_stroke_c1e0313c58997dcf(arg0) {\n getObject(arg0).stroke();\n};\n\nexport function __wbg_arc_fffd87d9113dce32() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {\n getObject(arg0).arc(arg1, arg2, arg3, arg4, arg5);\n}, arguments) };\n\nexport function __wbg_fillRect_46ffc8d2cef7e298(arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).fillRect(arg1, arg2, arg3, arg4);\n};\n\nexport function __wbg_strokeRect_7ea34fad8a7f0fe2(arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).strokeRect(arg1, arg2, arg3, arg4);\n};\n\nexport function __wbg_instanceof_HtmlCanvasElement_fd3cbbe3906d7792(arg0) {\n var ret = getObject(arg0) instanceof HTMLCanvasElement;\n return ret;\n};\n\nexport function __wbg_setwidth_f3c88eb520ba8d47(arg0, arg1) {\n getObject(arg0).width = arg1 >>> 0;\n};\n\nexport function __wbg_setheight_5a1abba41e35c42a(arg0, arg1) {\n getObject(arg0).height = arg1 >>> 0;\n};\n\nexport function __wbg_getContext_813df131fcbd6e91() { return handleError(function (arg0, arg1, arg2) {\n var ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_newnoargs_9fdd8f3961dd1bee(arg0, arg1) {\n var ret = new Function(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n};\n\nexport function __wbg_call_ba36642bd901572b() { return handleError(function (arg0, arg1) {\n var ret = getObject(arg0).call(getObject(arg1));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_self_bb69a836a72ec6e9() { return handleError(function () {\n var ret = self.self;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_window_3304fc4b414c9693() { return handleError(function () {\n var ret = window.window;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_globalThis_e0d21cabc6630763() { return handleError(function () {\n var ret = globalThis.globalThis;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_global_8463719227271676() { return handleError(function () {\n var ret = global.global;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_buffer_9e184d6f785de5ed(arg0) {\n var ret = getObject(arg0).buffer;\n return addHeapObject(ret);\n};\n\nexport function __wbg_new_e8101319e4cf95fc(arg0) {\n var ret = new Uint8Array(getObject(arg0));\n return addHeapObject(ret);\n};\n\nexport function __wbg_set_e8ae7b27314e8b98(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n};\n\nexport function __wbg_length_2d56cb37075fcfb1(arg0) {\n var ret = getObject(arg0).length;\n return ret;\n};\n\nexport function __wbg_newwithlength_a8d1dbcbe703a5c6(arg0) {\n var ret = new Uint8Array(arg0 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_subarray_901ede8318da52a6(arg0, arg1, arg2) {\n var ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_object_clone_ref(arg0) {\n var ret = getObject(arg0);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_debug_string(arg0, arg1) {\n var ret = debugString(getObject(arg1));\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\nexport function __wbindgen_memory() {\n var ret = wasm.memory;\n return addHeapObject(ret);\n};\n\n","import { Game, Board, BrdIdx, Painter, Team, init_wasm, Moveable, SquareState, Square } from \"draught\";\n// import { memory } from \"draught/draught_bg.wasm\";\n\n///////////////////\n// CONSTS\n///////////////////\n\nconst CANVAS_WIDTH = 720;\nconst CANVAS_HEIGHT = 720;\n\nvar BOARD_WIDTH = 8;\nvar BOARD_HEIGHT = 8;\n\nvar PIECE_ROWS = 3;\nvar SEARCH_DEPTH = 4;\nvar PERFECT_CHANCE = 0.5;\n\nconst STATUS_TIMEOUT = 3000;\nconst WON_TIMEOUT = 3000;\n\nconst GameState = {\n HUMAN_TURN: {\n THINKING: \"human_turn.thinking\",\n FROM_SELECTED: \"human_turn.from_selected\"\n },\n AI_TURN: \"ai_turn\"\n}\n\n//////////////////\n// GAME STUFF\n//////////////////\n\ninit_wasm();\n\n// let board = new Board(BOARD_WIDTH, BOARD_HEIGHT, Team.Black);\n\nconst statusText = document.getElementById(\"status-p\");\nconst statusAlert = document.getElementById(\"status-d\");\nconst teamText = document.getElementById(\"team-p\");\nconst nodeCountText = document.getElementById(\"node-count\");\nconst winningText = document.getElementById(\"winning-p\");\n\nconst startBtn = document.getElementById(\"startBtn\");\nstartBtn.onclick = start_game;\n\nlet wonTimeout = null;\nlet statusTimeout = null;\nlet setStatus = setStatusAlert;\n\nlet current_state = GameState.HUMAN_TURN.THINKING;\n\nlet game = null;\nlet painter = null;\n\nlet clicks = [];\n\nstart_game();\n\n/////////////////\n// CANVAS\n/////////////////\n\nconst canvas = document.getElementById(\"game-canvas\");\ncanvas.addEventListener(\"click\", (event) => {\n var mousepos = getMousePos(canvas, event);\n // console.log(mousepos);\n var cell = new BrdIdx(\n Math.floor((mousepos.y / canvas.clientHeight) * BOARD_HEIGHT),\n Math.floor((mousepos.x / canvas.clientWidth) * BOARD_WIDTH),\n );\n // console.log(cell);\n process_canvas_click(cell);\n});\n\n////////////////\n// FUNCS\n////////////////\n\nfunction start_game() {\n game = new Game(BOARD_WIDTH, BOARD_HEIGHT, PIECE_ROWS, Team.Black, SEARCH_DEPTH);\n painter = new Painter(CANVAS_WIDTH, CANVAS_HEIGHT, \"game-canvas\");\n game.set_painter(painter);\n game.draw();\n\n clearInterval(wonTimeout);\n updateTeamText();\n updateWinningText();\n clicks = [];\n current_state = GameState.HUMAN_TURN.THINKING;\n}\n\nfunction process_canvas_click(cell_coord) {\n\n switch(current_state) {\n // first click of a move\n case GameState.HUMAN_TURN.THINKING:\n if (game.current_cell_state(cell_coord).state != SquareState.Occupied ) {\n return;\n }\n\n if (game.current_cell_state(cell_coord).occupant.team != game.current_turn() ) {\n return;\n }\n\n // console.log(\"Your turn, first piece picked\");\n\n clicks.push(cell_coord);\n current_state = GameState.HUMAN_TURN.FROM_SELECTED;\n game.set_selected(cell_coord);\n game.draw();\n \n break;\n \n // second click of a move\n case GameState.HUMAN_TURN.FROM_SELECTED:\n\n // second click is different to first, process as move\n // otherwise, will skip straight to clean up (clear selected and clicks) \n if (!clicks[0].eq(cell_coord)) {\n\n if (game.current_cell_state(cell_coord).state != SquareState.Empty ) {\n return;\n }\n \n // console.log(\"Your turn, first piece already picked, picking second\");\n \n clicks.push(cell_coord);\n \n if (clicks.length != 2) {\n setStatus(`Error: wrong number of clicks to process ${clicks.length}`);\n console.error(`Error: wrong number of clicks to process ${clicks.length}`);\n \n return;\n }\n\n let status = game.make_move(clicks[0], clicks[1]);\n\n switch(status) {\n case Moveable.Allowed:\n\n if (aiCheckBox.checked && game.has_won() === undefined) {\n game.ai_move();\n nodeCountText.innerText = `searched ${game.last_node_count.toLocaleString(\"en-GB\")} possible moves`;\n }\n\n break;\n case Moveable.IllegalTrajectory:\n setStatus(\"You can't move like that!\");\n break;\n case Moveable.JumpingSameTeam:\n setStatus(\"You can't jump your own piece!\");\n break;\n case Moveable.NoJumpablePiece:\n setStatus(\"There's nothing to jump!\");\n break;\n case Moveable.OccupiedDest:\n setStatus(\"There's a piece there!\");\n break;\n case Moveable.OutOfBounds:\n setStatus(\"That square's not on the board! (how have you managed that?)\");\n break;\n case Moveable.UnoccupiedSrc:\n setStatus(\"There's no piece to move!\");\n break;\n case Moveable.Unplayable:\n setStatus(\"That's not a playable square!\");\n break;\n case Moveable.WrongTeamSrc:\n setStatus(\"That's not your piece!\");\n break;\n }\n \n }\n\n game.clear_selected();\n game.draw();\n clicks = [];\n current_state = GameState.HUMAN_TURN.THINKING;\n \n break;\n case GameState.AI_TURN:\n console.log(\"It's the AI's turn!\");\n break;\n }\n\n updateTeamText();\n updateWinningText();\n checkWon();\n}\n\nfunction getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}\n\nfunction setStatusText(txt, hide = true) {\n if(statusTimeout != null) {\n clearInterval(statusTimeout);\n }\n\n statusText.innerText = txt;\n\n if(hide) {\n statusTimeout = setTimeout(() => {\n statusText.innerText = \"\";\n }, STATUS_TIMEOUT);\n }\n}\n\nfunction setStatusAlert(txt, alertType = \"danger\", hide = true) {\n if(statusTimeout != null) {\n clearInterval(statusTimeout);\n }\n\n statusAlert.className = `alert alert-${alertType}`;\n statusAlert.innerText = txt;\n statusAlert.hidden = false;\n\n if(hide) {\n statusTimeout = setTimeout(() => {\n statusAlert.hidden = true;\n }, STATUS_TIMEOUT);\n }\n}\n\nfunction updateTeamText(){\n let team = game.current_turn();\n switch(team) {\n case Team.White:\n teamText.innerText = \"⚪ White ⚪\";\n break;\n case Team.Black:\n teamText.innerText = \"🔴 Black 🔴\";\n break;\n }\n}\n\nfunction updateWinningText(){\n \n switch(game.winning()) {\n case undefined:\n winningText.innerText = \"\";\n break;\n case Team.White:\n winningText.innerText = \"👑 White 👑\";\n break;\n case Team.Black:\n winningText.innerText = \"👑 Black 👑\";\n break;\n }\n}\n\nfunction checkWon() {\n\n switch(game.has_won()) {\n case undefined:\n break;\n case Team.White:\n setStatus(\"You Lost!\");\n wonTimeout = setInterval(() => {\n start_game();\n }, WON_TIMEOUT);\n break;\n case Team.Black:\n setStatus(\"You Won!\", \"success\");\n wonTimeout = setInterval(() => {\n start_game();\n }, WON_TIMEOUT);\n break;\n }\n}\n\n////////////////\n// UI\n////////////////\n\nconst widthBox = document.getElementById(\"width\");\n/**\n * Handler for width input box change, start a new game\n */\nconst onWidth = () => {\n\n BOARD_WIDTH = parseInt(widthBox.value);\n start_game();\n}\nwidthBox.onchange = onWidth;\nwidthBox.value = 8;\n\nconst heightBox = document.getElementById(\"height\");\n/**\n * Handler for height input box change, start a new game\n */\nconst onHeight = () => {\n\n BOARD_HEIGHT = parseInt(heightBox.value);\n pieceRowsBox.max = (BOARD_HEIGHT / 2) - 1;\n start_game();\n}\nheightBox.onchange = onHeight;\nheightBox.value = 8;\n\nconst pieceRowsBox = document.getElementById(\"play_rows\");\n/**\n * Handler for piece rows input box change, start a new game\n */\nconst onPieceRows = () => {\n\n PIECE_ROWS = parseInt(pieceRowsBox.value);\n start_game();\n}\npieceRowsBox.onchange = onPieceRows;\npieceRowsBox.value = 3;\n\nconst aiSearchDepthBox = document.getElementById(\"ai_search_depth\");\n/**\n * Handler for AI search depth input box change, start a new game\n */\nconst onAISearchDepth = () => {\n\n SEARCH_DEPTH = parseInt(aiSearchDepthBox.value);\n game.set_search_depth(SEARCH_DEPTH);\n\n if(SEARCH_DEPTH > 4) {\n setStatus(\"This increases thinking time exponentially, be careful (probably don't go past 6)\", \"warning\");\n }\n}\naiSearchDepthBox.onchange = onAISearchDepth;\naiSearchDepthBox.value = 4;\n\nconst aiCheckBox = document.getElementById(\"ai-checkbox\");\n/**\n * Handler for height input box change, get a new universe of given size\n */\nconst onAICheck = () => {\n \n}\naiCheckBox.onchange = onAICheck;\n// aiCheckBox.checked = true;\n\nconst aiPerfectChance = document.getElementById(\"ai_difficulty\");\n/**\n * Handler for piece rows input box change, start a new game\n */\nconst onPerfectChance = () => {\n\n PERFECT_CHANCE = parseInt(aiPerfectChance.value) / 100;\n game.set_perfect_chance(PERFECT_CHANCE);\n}\naiPerfectChance.onchange = onPerfectChance;\naiPerfectChance.value = 50;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://draught/../pkg/draught_bg.js","webpack://draught/./index.js"],"names":["heap","Array","fill","undefined","getObject","idx","push","heap_next","length","cachedTextDecoder","TextDecoder","module","require","ignoreBOM","fatal","decode","cachegetUint8Memory0","getUint8Memory0","buffer","Uint8Array","getStringFromWasm0","ptr","len","subarray","addHeapObject","obj","debugString","val","type","description","name","isArray","debug","i","builtInMatches","exec","toString","call","className","JSON","stringify","_","Error","message","stack","WASM_VECTOR_LEN","cachedTextEncoder","TextEncoder","encodeString","encodeInto","arg","view","buf","encode","set","read","written","passStringToWasm0","malloc","realloc","mem","offset","code","charCodeAt","slice","cachegetInt32Memory0","getInt32Memory0","Int32Array","isLikeNone","x","_assertClass","instance","klass","init_wasm","handleError","f","args","apply","this","e","Object","freeze","Move","Jump","Team","Black","White","SquareState","Man","King","Empty","Occupied","Unplayable","Moveable","Allowed","UnoccupiedSrc","OccupiedDest","OutOfBounds","WrongTeamSrc","IllegalTrajectory","NoJumpablePiece","JumpingSameTeam","Board","create","prototype","__destroy_into_raw","arg0","ret","Square","__wrap","square","ptr0","BrdIdx","row","col","from","to","ptr1","from_square_occupant","Piece","ptr2","team","jumpee","from_occ","width","height","current_turn","board","piece_rows","other","Game","search_depth","new_chance","first_turn","canvas_id","canvas_width","canvas_height","len0","value","Painter","canvas","strength","state","occupant","__wbindgen_object_drop_ref","dropObject","takeObject","__wbindgen_string_new","arg1","__wbg_new_693216e109162396","__wbg_stack_0ddaca5d1abfb52f","__wbg_error_09919627ac0992f5","console","error","__wbg_randomFillSync_d2ba53160aec6aba","arg2","randomFillSync","__wbg_getRandomValues_e57c9b75ddead065","getRandomValues","__wbg_self_86b4b13392c7af56","self","arguments","__wbg_crypto_b8c92eaac23d0d80","crypto","__wbg_msCrypto_9ad6677321a08dd8","msCrypto","__wbindgen_is_undefined","__wbg_require_f5521a5b85ad2542","__wbg_getRandomValues_dd27e6b0652b3236","__wbg_static_accessor_MODULE_452b4680e8614c81","__wbg_instanceof_Window_434ce1849eb4e0fc","Window","__wbg_document_5edd43643d1060d9","document","__wbg_getElementById_b30e88aff96f66a1","getElementById","__wbg_error_ca520cb687b085a1","__wbg_log_fbd13631356d44e4","log","__wbg_instanceof_CanvasRenderingContext2d_e8b3a478a1b32d55","CanvasRenderingContext2D","__wbg_setstrokeStyle_4c9ff9ea0c0c4092","strokeStyle","__wbg_setfillStyle_680401a47926faa5","fillStyle","__wbg_setlineWidth_4819b1bc5c54719b","lineWidth","__wbg_beginPath_5a6fcb370b5b8eb3","beginPath","__wbg_fill_0ced47ff22561640","__wbg_stroke_46c6315e5e1f35db","stroke","__wbg_arc_b3cb1027882c81bb","arg3","arg4","arg5","arc","__wbg_fillRect_7ad775936c1881ce","fillRect","__wbg_strokeRect_a3f2f571f1ad9730","strokeRect","__wbg_instanceof_HtmlCanvasElement_a6157e470d06b638","HTMLCanvasElement","__wbg_setwidth_362e8db8cbadbe96","__wbg_setheight_28f53831182cc410","__wbg_getContext_bd4e9445094eda84","getContext","__wbg_newnoargs_f579424187aa1717","Function","__wbg_call_89558c3e96703ca1","__wbg_self_e23d74ae45fb17d1","__wbg_window_b4be7f48b24ac56e","window","__wbg_globalThis_d61b1f48a57191ae","globalThis","__wbg_global_e7669da72fd7f239","g","global","__wbg_buffer_5e74a88a1424a2e0","__wbg_new_e3b800e570795b3c","__wbg_set_5b8081e9d002f0df","__wbg_length_30803400a8f15c59","__wbg_newwithlength_5f4ce114a24dfe1e","__wbg_subarray_a68f835ca2af506f","__wbindgen_object_clone_ref","__wbindgen_debug_string","__wbindgen_throw","__wbindgen_memory","BOARD_WIDTH","BOARD_HEIGHT","PIECE_ROWS","SEARCH_DEPTH","PERFECT_CHANCE","GameState","statusAlert","teamText","nodeCountText","winningText","onclick","start_game","wonTimeout","statusTimeout","setStatus","txt","alertType","hide","clearInterval","innerText","hidden","setTimeout","current_state","game","painter","clicks","set_painter","draw","updateTeamText","updateWinningText","winning","addEventListener","event","mousepos","evt","rect","getBoundingClientRect","clientX","left","y","clientY","top","getMousePos","cell_coord","current_cell_state","set_selected","eq","make_move","aiCheckBox","checked","has_won","ai_move","last_node_count","toLocaleString","clear_selected","setInterval","checkWon","process_canvas_click","Math","floor","clientHeight","clientWidth","widthBox","onchange","parseInt","heightBox","pieceRowsBox","max","aiSearchDepthBox","set_search_depth","aiPerfectChance","set_perfect_chance"],"mappings":"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","file":"10.bootstrap.js","sourcesContent":["import * as wasm from './draught_bg.wasm';\n\nconst heap = new Array(32).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length);\n getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len);\n\n const mem = getUint8Memory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachegetInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n/**\n*/\nexport function init_wasm() {\n wasm.init_wasm();\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n* Move/Jump, for use in Move\n*/\nexport const MoveType = Object.freeze({ Move:0,\"0\":\"Move\",Jump:1,\"1\":\"Jump\", });\n/**\n* Black/White\n*/\nexport const Team = Object.freeze({ Black:0,\"0\":\"Black\",White:1,\"1\":\"White\", });\n/**\n* Man/King\n*/\nexport const Strength = Object.freeze({ Man:0,\"0\":\"Man\",King:1,\"1\":\"King\", });\n/**\n* Model board square as Empty/Occupied/Unplayable\n*/\nexport const SquareState = Object.freeze({ Empty:0,\"0\":\"Empty\",Occupied:1,\"1\":\"Occupied\",Unplayable:2,\"2\":\"Unplayable\", });\n/**\n* Possible outcomes of trying to move\n*/\nexport const Moveable = Object.freeze({ Allowed:0,\"0\":\"Allowed\",UnoccupiedSrc:1,\"1\":\"UnoccupiedSrc\",OccupiedDest:2,\"2\":\"OccupiedDest\",OutOfBounds:3,\"3\":\"OutOfBounds\",Unplayable:4,\"4\":\"Unplayable\",WrongTeamSrc:5,\"5\":\"WrongTeamSrc\",IllegalTrajectory:6,\"6\":\"IllegalTrajectory\",NoJumpablePiece:7,\"7\":\"NoJumpablePiece\",JumpingSameTeam:8,\"8\":\"JumpingSameTeam\", });\n/**\n* Single state of a checkers board\n*/\nexport class Board {\n\n static __wrap(ptr) {\n const obj = Object.create(Board.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_board_free(ptr);\n }\n /**\n */\n get width() {\n var ret = wasm.__wbg_get_board_width(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set width(arg0) {\n wasm.__wbg_set_board_width(this.ptr, arg0);\n }\n /**\n */\n get height() {\n var ret = wasm.__wbg_get_board_height(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set height(arg0) {\n wasm.__wbg_set_board_height(this.ptr, arg0);\n }\n /**\n */\n get current_turn() {\n var ret = wasm.__wbg_get_board_current_turn(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set current_turn(arg0) {\n wasm.__wbg_set_board_current_turn(this.ptr, arg0);\n }\n /**\n * Get a copy of a board square by 1D array index\n * @param {number} idx\n * @returns {Square}\n */\n cell(idx) {\n var ret = wasm.board_cell(this.ptr, idx);\n return Square.__wrap(ret);\n }\n /**\n * Get a copy of a board square by 1D array index\n * @param {number} idx\n * @param {Square} square\n */\n set_cell(idx, square) {\n _assertClass(square, Square);\n var ptr0 = square.ptr;\n square.ptr = 0;\n wasm.board_set_cell(this.ptr, idx, ptr0);\n }\n /**\n * Get a copy of a board square by 2D [`BrdIdx`] index\n * @param {BrdIdx} idx\n * @returns {Square}\n */\n grid_cell(idx) {\n _assertClass(idx, BrdIdx);\n var ptr0 = idx.ptr;\n idx.ptr = 0;\n var ret = wasm.board_grid_cell(this.ptr, ptr0);\n return Square.__wrap(ret);\n }\n /**\n * Transform a 2D row/column board index into a single 1D index for use with [`Board::cells`]\n * @param {number} row\n * @param {number} col\n * @returns {number}\n */\n cell_index(row, col) {\n var ret = wasm.board_cell_index(this.ptr, row, col);\n return ret >>> 0;\n }\n /**\n * 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`]\n * @param {BrdIdx} idx\n * @returns {number}\n */\n cell_idx(idx) {\n _assertClass(idx, BrdIdx);\n var ptr0 = idx.ptr;\n idx.ptr = 0;\n var ret = wasm.board_cell_idx(this.ptr, ptr0);\n return ret >>> 0;\n }\n /**\n * Transform a 1D array index (for [`Board::cells`]) into a 2D game board index (by row/col)\n * @param {number} idx\n * @returns {BrdIdx}\n */\n board_index(idx) {\n var ret = wasm.board_board_index(this.ptr, idx);\n return BrdIdx.__wrap(ret);\n }\n /**\n * Check whether a move given by source and destination indices is legal\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n can_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_can_move(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Check that given move trajectory is valid for a man piece\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @param {Piece} from_square_occupant\n * @returns {number}\n */\n validate_man_move(from, to, from_square_occupant) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n _assertClass(from_square_occupant, Piece);\n var ptr2 = from_square_occupant.ptr;\n from_square_occupant.ptr = 0;\n var ret = wasm.board_validate_man_move(this.ptr, ptr0, ptr1, ptr2);\n return ret >>> 0;\n }\n /**\n * Check that given move trajectory is valid for a king piece\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @param {Piece} from_square_occupant\n * @returns {number}\n */\n validate_king_move(from, to, from_square_occupant) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n _assertClass(from_square_occupant, Piece);\n var ptr2 = from_square_occupant.ptr;\n from_square_occupant.ptr = 0;\n var ret = wasm.board_validate_king_move(this.ptr, ptr0, ptr1, ptr2);\n return ret >>> 0;\n }\n /**\n * Get cell index of jumpee square given from and to locations\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n jumpee_idx(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_jumpee_idx(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Get a pointer to the backing array of board squares, [`Board::cells`]\n * @returns {number}\n */\n cells() {\n var ret = wasm.board_cells(this.ptr);\n return ret;\n }\n /**\n * Get the number of board squares\n * @returns {number}\n */\n num_cells() {\n var ret = wasm.board_num_cells(this.ptr);\n return ret >>> 0;\n }\n /**\n * Get the number of remaining pieces\n * @returns {number}\n */\n num_pieces() {\n var ret = wasm.board_num_pieces(this.ptr);\n return ret >>> 0;\n }\n /**\n * Get the number of remaining pieces for a player\n * @param {number} team\n * @returns {number}\n */\n num_player(team) {\n var ret = wasm.board_num_player(this.ptr, team);\n return ret >>> 0;\n }\n /**\n * Get the score value, Black - White pieces\n * @returns {number}\n */\n score() {\n var ret = wasm.board_score(this.ptr);\n return ret;\n }\n /**\n * Get the state of a board square by 1D array index\n * @param {number} idx\n * @returns {number}\n */\n cell_state(idx) {\n var ret = wasm.board_cell_state(this.ptr, idx);\n return ret >>> 0;\n }\n /**\n * Get new board derived from current with given move applied\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {Board}\n */\n apply_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_apply_move(this.ptr, ptr0, ptr1);\n return Board.__wrap(ret);\n }\n /**\n * Get new board derived from current with given jump applied\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {Board}\n */\n apply_jump(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.board_apply_jump(this.ptr, ptr0, ptr1);\n return Board.__wrap(ret);\n }\n /**\n * Get row index for current team, top row for black, bottom row for white\n * @returns {number}\n */\n king_row_idx() {\n var ret = wasm.board_king_row_idx(this.ptr);\n return ret >>> 0;\n }\n /**\n * Unwrap the jumpee piece from the square and [`Board::check_jumpee_team`] with [`Moveable`] response\n * @param {Square} jumpee\n * @param {Piece} from_occ\n * @returns {number}\n */\n static validate_jumpee(jumpee, from_occ) {\n _assertClass(jumpee, Square);\n var ptr0 = jumpee.ptr;\n jumpee.ptr = 0;\n _assertClass(from_occ, Piece);\n var ptr1 = from_occ.ptr;\n from_occ.ptr = 0;\n var ret = wasm.board_validate_jumpee(ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Check that the source piece and the jumpee are of opposing teams\n * @param {Piece} from\n * @param {Piece} jumpee\n * @returns {boolean}\n */\n static check_jumpee_team(from, jumpee) {\n _assertClass(from, Piece);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(jumpee, Piece);\n var ptr1 = jumpee.ptr;\n jumpee.ptr = 0;\n var ret = wasm.board_check_jumpee_team(ptr0, ptr1);\n return ret !== 0;\n }\n /**\n * Initialise a game board without game pieces\n * @param {number} width\n * @param {number} height\n * @param {number} current_turn\n */\n constructor(width, height, current_turn) {\n var ret = wasm.board_new(width, height, current_turn);\n return Board.__wrap(ret);\n }\n /**\n * Reset the given board to a starting layout with 3 rows of opposing pieces\n * @param {Board} board\n * @param {number} piece_rows\n * @returns {Board}\n */\n static init_game(board, piece_rows) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n var ret = wasm.board_init_game(ptr0, piece_rows);\n return Board.__wrap(ret);\n }\n}\n/**\n* Rank 2 tensor index to identify a board square by row and column\n*/\nexport class BrdIdx {\n\n static __wrap(ptr) {\n const obj = Object.create(BrdIdx.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_brdidx_free(ptr);\n }\n /**\n */\n get row() {\n var ret = wasm.__wbg_get_brdidx_row(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set row(arg0) {\n wasm.__wbg_set_brdidx_row(this.ptr, arg0);\n }\n /**\n */\n get col() {\n var ret = wasm.__wbg_get_brdidx_col(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set col(arg0) {\n wasm.__wbg_set_brdidx_col(this.ptr, arg0);\n }\n /**\n * @param {number} row\n * @param {number} col\n */\n constructor(row, col) {\n var ret = wasm.brdidx_from(row, col);\n return BrdIdx.__wrap(ret);\n }\n /**\n * @param {BrdIdx} other\n * @returns {boolean}\n */\n eq(other) {\n _assertClass(other, BrdIdx);\n var ret = wasm.brdidx_eq(this.ptr, other.ptr);\n return ret !== 0;\n }\n}\n/**\n* Root-level structure for managing the game as a collection of board states\n*/\nexport class Game {\n\n static __wrap(ptr) {\n const obj = Object.create(Game.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_game_free(ptr);\n }\n /**\n */\n get last_node_count() {\n var ret = wasm.__wbg_get_game_last_node_count(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set last_node_count(arg0) {\n wasm.__wbg_set_game_last_node_count(this.ptr, arg0);\n }\n /**\n */\n get perfect_chance() {\n var ret = wasm.__wbg_get_game_perfect_chance(this.ptr);\n return ret;\n }\n /**\n * @param {number} arg0\n */\n set perfect_chance(arg0) {\n wasm.__wbg_set_game_perfect_chance(this.ptr, arg0);\n }\n /**\n * Get pointer to current board's squares\n * @returns {number}\n */\n current_board_cells() {\n var ret = wasm.game_current_board_cells(this.ptr);\n return ret;\n }\n /**\n * Get pointer to current board's squares\n * @returns {number}\n */\n current_board_len() {\n var ret = wasm.game_current_board_len(this.ptr);\n return ret >>> 0;\n }\n /**\n * Current turn's team\n * @returns {number}\n */\n current_turn() {\n var ret = wasm.game_current_turn(this.ptr);\n return ret >>> 0;\n }\n /**\n * Current board's score\n * @returns {number}\n */\n score() {\n var ret = wasm.game_score(this.ptr);\n return ret;\n }\n /**\n * Get currently winning player\n * @returns {number | undefined}\n */\n winning() {\n var ret = wasm.game_winning(this.ptr);\n return ret === 2 ? undefined : ret;\n }\n /**\n * Check if a player has won\n * @returns {number | undefined}\n */\n has_won() {\n var ret = wasm.game_has_won(this.ptr);\n return ret === 2 ? undefined : ret;\n }\n /**\n * Get square on current board for given index\n * @param {BrdIdx} idx\n * @returns {Square}\n */\n current_cell_state(idx) {\n _assertClass(idx, BrdIdx);\n var ret = wasm.game_current_cell_state(this.ptr, idx.ptr);\n return Square.__wrap(ret);\n }\n /**\n * Set tree depth for AI to search to\n * @param {number} search_depth\n */\n set_search_depth(search_depth) {\n wasm.game_set_search_depth(this.ptr, search_depth);\n }\n /**\n * Set given index as selected piece\n * TODO: Check whether valid square?\n * @param {BrdIdx} idx\n */\n set_selected(idx) {\n _assertClass(idx, BrdIdx);\n wasm.game_set_selected(this.ptr, idx.ptr);\n }\n /**\n * Set proportion of perfect moves from AI\n * @param {number} new_chance\n */\n set_perfect_chance(new_chance) {\n wasm.game_set_perfect_chance(this.ptr, new_chance);\n }\n /**\n * Clear currently selected piece\n */\n clear_selected() {\n wasm.game_clear_selected(this.ptr);\n }\n /**\n * Attempt to make a move given a source and destination index\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n * @returns {number}\n */\n make_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n var ret = wasm.game_make_move(this.ptr, ptr0, ptr1);\n return ret >>> 0;\n }\n /**\n * Update board state with given move and push new board into current state\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n */\n execute_move(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n wasm.game_execute_move(this.ptr, ptr0, ptr1);\n }\n /**\n * Update board state with given jump move and push new board into current state\n * @param {BrdIdx} from\n * @param {BrdIdx} to\n */\n execute_jump(from, to) {\n _assertClass(from, BrdIdx);\n var ptr0 = from.ptr;\n from.ptr = 0;\n _assertClass(to, BrdIdx);\n var ptr1 = to.ptr;\n to.ptr = 0;\n wasm.game_execute_jump(this.ptr, ptr0, ptr1);\n }\n /**\n * Push current board into the previous turns and set given board to current\n * @param {Board} board\n */\n push_new_board(board) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n wasm.game_push_new_board(this.ptr, ptr0);\n }\n /**\n * Set current board to given\n * @param {Board} board\n */\n set_current(board) {\n _assertClass(board, Board);\n var ptr0 = board.ptr;\n board.ptr = 0;\n wasm.game_set_current(this.ptr, ptr0);\n }\n /**\n * Get new game without board renderer\n * @param {number} width\n * @param {number} height\n * @param {number} piece_rows\n * @param {number} first_turn\n * @param {number} search_depth\n */\n constructor(width, height, piece_rows, first_turn, search_depth) {\n var ret = wasm.game_new(width, height, piece_rows, first_turn, search_depth);\n return Game.__wrap(ret);\n }\n /**\n * Get a new game with canvas ID and dimensions\n * @param {number} width\n * @param {number} height\n * @param {number} piece_rows\n * @param {number} first_turn\n * @param {number} search_depth\n * @param {string} canvas_id\n * @param {number} canvas_width\n * @param {number} canvas_height\n * @returns {Game}\n */\n static new_with_canvas(width, height, piece_rows, first_turn, search_depth, canvas_id, canvas_width, canvas_height) {\n var ptr0 = passStringToWasm0(canvas_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.game_new_with_canvas(width, height, piece_rows, first_turn, search_depth, ptr0, len0, canvas_width, canvas_height);\n return Game.__wrap(ret);\n }\n /**\n * Set painter for rendering boards\n * @param {Painter} value\n */\n set_painter(value) {\n _assertClass(value, Painter);\n var ptr0 = value.ptr;\n value.ptr = 0;\n wasm.game_set_painter(this.ptr, ptr0);\n }\n /**\n * Draw current board using painter if exists\n */\n draw() {\n wasm.game_draw(this.ptr);\n }\n /**\n * Create computer, get move from current board and update current board\n */\n ai_move() {\n wasm.game_ai_move(this.ptr);\n }\n}\n/**\n* Used to paint boards onto HTML canvases\n*/\nexport class Painter {\n\n static __wrap(ptr) {\n const obj = Object.create(Painter.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_painter_free(ptr);\n }\n /**\n * Default constructor which queries for canvas by ID\n * @param {number} width\n * @param {number} height\n * @param {string} canvas_id\n */\n constructor(width, height, canvas_id) {\n var ptr0 = passStringToWasm0(canvas_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ret = wasm.painter_new(width, height, ptr0, len0);\n return Painter.__wrap(ret);\n }\n /**\n * Constructor with given canvas element\n * @param {number} width\n * @param {number} height\n * @param {HTMLCanvasElement} canvas\n * @returns {Painter}\n */\n static new_with_canvas(width, height, canvas) {\n var ret = wasm.painter_new_with_canvas(width, height, addHeapObject(canvas));\n return Painter.__wrap(ret);\n }\n /**\n * Set new square outline colour value\n * @param {any} value\n */\n set_square_outline(value) {\n wasm.painter_set_square_outline(this.ptr, addHeapObject(value));\n }\n /**\n * Set new line width for outlining squares\n * @param {number} value\n */\n set_outline_width(value) {\n wasm.painter_set_outline_width(this.ptr, value);\n }\n /**\n * Set whether squares are outlined\n * @param {boolean} value\n */\n set_draw_outline(value) {\n wasm.painter_set_draw_outline(this.ptr, value);\n }\n /**\n * Reset the canvas dimensions to the given width and height\n */\n reset_dimensions() {\n wasm.painter_reset_dimensions(this.ptr);\n }\n /**\n * Check whether given canvas dimensions divide evenly by given board dimenions\n * @param {Board} board\n * @returns {boolean}\n */\n validate_board_dim(board) {\n _assertClass(board, Board);\n var ret = wasm.painter_validate_board_dim(this.ptr, board.ptr);\n return ret !== 0;\n }\n /**\n * Draw a board onto the canvas\n * @param {Board} board\n */\n draw(board) {\n _assertClass(board, Board);\n wasm.painter_draw(this.ptr, board.ptr);\n }\n}\n/**\n* Game piece given by its team and strength (normal or kinged)\n*/\nexport class Piece {\n\n static __wrap(ptr) {\n const obj = Object.create(Piece.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_piece_free(ptr);\n }\n /**\n */\n get team() {\n var ret = wasm.__wbg_get_piece_team(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set team(arg0) {\n wasm.__wbg_set_piece_team(this.ptr, arg0);\n }\n /**\n */\n get strength() {\n var ret = wasm.__wbg_get_piece_strength(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set strength(arg0) {\n wasm.__wbg_set_piece_strength(this.ptr, arg0);\n }\n /**\n * @param {number} team\n * @param {number} strength\n */\n constructor(team, strength) {\n var ret = wasm.piece_new(team, strength);\n return Piece.__wrap(ret);\n }\n}\n/**\n* Board squares given by a state and a possible occupying game piece\n*/\nexport class Square {\n\n static __wrap(ptr) {\n const obj = Object.create(Square.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_square_free(ptr);\n }\n /**\n * Game piece if square is occupied\n */\n get occupant() {\n var ret = wasm.__wbg_get_square_occupant(this.ptr);\n return ret === 0 ? undefined : Piece.__wrap(ret);\n }\n /**\n * Game piece if square is occupied\n * @param {Piece | undefined} arg0\n */\n set occupant(arg0) {\n let ptr0 = 0;\n if (!isLikeNone(arg0)) {\n _assertClass(arg0, Piece);\n ptr0 = arg0.ptr;\n arg0.ptr = 0;\n }\n wasm.__wbg_set_square_occupant(this.ptr, ptr0);\n }\n /**\n * Description of whether the square is occupied or an unplayable, i.e. off-lattice square\n */\n get state() {\n var ret = wasm.__wbg_get_square_state(this.ptr);\n return ret >>> 0;\n }\n /**\n * Description of whether the square is occupied or an unplayable, i.e. off-lattice square\n * @param {number} arg0\n */\n set state(arg0) {\n wasm.__wbg_set_square_state(this.ptr, arg0);\n }\n /**\n * Standard constructor function to form square from state and occupant\n * @param {number} state\n * @param {Piece | undefined} occupant\n */\n constructor(state, occupant) {\n let ptr0 = 0;\n if (!isLikeNone(occupant)) {\n _assertClass(occupant, Piece);\n ptr0 = occupant.ptr;\n occupant.ptr = 0;\n }\n var ret = wasm.square_new(state, ptr0);\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed piece square by team and strength\n * @param {number} team\n * @param {number} strength\n * @returns {Square}\n */\n static pc(team, strength) {\n var ret = wasm.square_pc(team, strength);\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed empty square\n * @returns {Square}\n */\n static empty() {\n var ret = wasm.square_empty();\n return Square.__wrap(ret);\n }\n /**\n * Helper function for a well-formed unplayable square\n * @returns {Square}\n */\n static unplay() {\n var ret = wasm.square_unplay();\n return Square.__wrap(ret);\n }\n}\n\nexport function __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nexport function __wbindgen_string_new(arg0, arg1) {\n var ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nexport function __wbg_new_693216e109162396() {\n var ret = new Error();\n return addHeapObject(ret);\n};\n\nexport function __wbg_stack_0ddaca5d1abfb52f(arg0, arg1) {\n var ret = getObject(arg1).stack;\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_error_09919627ac0992f5(arg0, arg1) {\n try {\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(arg0, arg1);\n }\n};\n\nexport function __wbg_randomFillSync_d2ba53160aec6aba(arg0, arg1, arg2) {\n getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));\n};\n\nexport function __wbg_getRandomValues_e57c9b75ddead065(arg0, arg1) {\n getObject(arg0).getRandomValues(getObject(arg1));\n};\n\nexport function __wbg_self_86b4b13392c7af56() { return handleError(function () {\n var ret = self.self;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_crypto_b8c92eaac23d0d80(arg0) {\n var ret = getObject(arg0).crypto;\n return addHeapObject(ret);\n};\n\nexport function __wbg_msCrypto_9ad6677321a08dd8(arg0) {\n var ret = getObject(arg0).msCrypto;\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_is_undefined(arg0) {\n var ret = getObject(arg0) === undefined;\n return ret;\n};\n\nexport function __wbg_require_f5521a5b85ad2542(arg0, arg1, arg2) {\n var ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));\n return addHeapObject(ret);\n};\n\nexport function __wbg_getRandomValues_dd27e6b0652b3236(arg0) {\n var ret = getObject(arg0).getRandomValues;\n return addHeapObject(ret);\n};\n\nexport function __wbg_static_accessor_MODULE_452b4680e8614c81() {\n var ret = module;\n return addHeapObject(ret);\n};\n\nexport function __wbg_instanceof_Window_434ce1849eb4e0fc(arg0) {\n var ret = getObject(arg0) instanceof Window;\n return ret;\n};\n\nexport function __wbg_document_5edd43643d1060d9(arg0) {\n var ret = getObject(arg0).document;\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n};\n\nexport function __wbg_getElementById_b30e88aff96f66a1(arg0, arg1, arg2) {\n var ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n};\n\nexport function __wbg_error_ca520cb687b085a1(arg0) {\n console.error(getObject(arg0));\n};\n\nexport function __wbg_log_fbd13631356d44e4(arg0) {\n console.log(getObject(arg0));\n};\n\nexport function __wbg_instanceof_CanvasRenderingContext2d_e8b3a478a1b32d55(arg0) {\n var ret = getObject(arg0) instanceof CanvasRenderingContext2D;\n return ret;\n};\n\nexport function __wbg_setstrokeStyle_4c9ff9ea0c0c4092(arg0, arg1) {\n getObject(arg0).strokeStyle = getObject(arg1);\n};\n\nexport function __wbg_setfillStyle_680401a47926faa5(arg0, arg1) {\n getObject(arg0).fillStyle = getObject(arg1);\n};\n\nexport function __wbg_setlineWidth_4819b1bc5c54719b(arg0, arg1) {\n getObject(arg0).lineWidth = arg1;\n};\n\nexport function __wbg_beginPath_5a6fcb370b5b8eb3(arg0) {\n getObject(arg0).beginPath();\n};\n\nexport function __wbg_fill_0ced47ff22561640(arg0) {\n getObject(arg0).fill();\n};\n\nexport function __wbg_stroke_46c6315e5e1f35db(arg0) {\n getObject(arg0).stroke();\n};\n\nexport function __wbg_arc_b3cb1027882c81bb() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {\n getObject(arg0).arc(arg1, arg2, arg3, arg4, arg5);\n}, arguments) };\n\nexport function __wbg_fillRect_7ad775936c1881ce(arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).fillRect(arg1, arg2, arg3, arg4);\n};\n\nexport function __wbg_strokeRect_a3f2f571f1ad9730(arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).strokeRect(arg1, arg2, arg3, arg4);\n};\n\nexport function __wbg_instanceof_HtmlCanvasElement_a6157e470d06b638(arg0) {\n var ret = getObject(arg0) instanceof HTMLCanvasElement;\n return ret;\n};\n\nexport function __wbg_setwidth_362e8db8cbadbe96(arg0, arg1) {\n getObject(arg0).width = arg1 >>> 0;\n};\n\nexport function __wbg_setheight_28f53831182cc410(arg0, arg1) {\n getObject(arg0).height = arg1 >>> 0;\n};\n\nexport function __wbg_getContext_bd4e9445094eda84() { return handleError(function (arg0, arg1, arg2) {\n var ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));\n return isLikeNone(ret) ? 0 : addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_newnoargs_f579424187aa1717(arg0, arg1) {\n var ret = new Function(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n};\n\nexport function __wbg_call_89558c3e96703ca1() { return handleError(function (arg0, arg1) {\n var ret = getObject(arg0).call(getObject(arg1));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_self_e23d74ae45fb17d1() { return handleError(function () {\n var ret = self.self;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_window_b4be7f48b24ac56e() { return handleError(function () {\n var ret = window.window;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_globalThis_d61b1f48a57191ae() { return handleError(function () {\n var ret = globalThis.globalThis;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_global_e7669da72fd7f239() { return handleError(function () {\n var ret = global.global;\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_buffer_5e74a88a1424a2e0(arg0) {\n var ret = getObject(arg0).buffer;\n return addHeapObject(ret);\n};\n\nexport function __wbg_new_e3b800e570795b3c(arg0) {\n var ret = new Uint8Array(getObject(arg0));\n return addHeapObject(ret);\n};\n\nexport function __wbg_set_5b8081e9d002f0df(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n};\n\nexport function __wbg_length_30803400a8f15c59(arg0) {\n var ret = getObject(arg0).length;\n return ret;\n};\n\nexport function __wbg_newwithlength_5f4ce114a24dfe1e(arg0) {\n var ret = new Uint8Array(arg0 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbg_subarray_a68f835ca2af506f(arg0, arg1, arg2) {\n var ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_object_clone_ref(arg0) {\n var ret = getObject(arg0);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_debug_string(arg0, arg1) {\n var ret = debugString(getObject(arg1));\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\nexport function __wbindgen_memory() {\n var ret = wasm.memory;\n return addHeapObject(ret);\n};\n\n","import { Game, Board, BrdIdx, Painter, Team, init_wasm, Moveable, SquareState, Square } from \"draught\";\n// import { memory } from \"draught/draught_bg.wasm\";\n\n///////////////////\n// CONSTS\n///////////////////\n\nconst CANVAS_WIDTH = 720;\nconst CANVAS_HEIGHT = 720;\n\nvar BOARD_WIDTH = 8;\nvar BOARD_HEIGHT = 8;\n\nvar PIECE_ROWS = 3;\nvar SEARCH_DEPTH = 4;\nvar PERFECT_CHANCE = 0.5;\n\nconst STATUS_TIMEOUT = 3000;\nconst WON_TIMEOUT = 3000;\n\nconst GameState = {\n HUMAN_TURN: {\n THINKING: \"human_turn.thinking\",\n FROM_SELECTED: \"human_turn.from_selected\"\n },\n AI_TURN: \"ai_turn\"\n}\n\n//////////////////\n// GAME STUFF\n//////////////////\n\ninit_wasm();\n\n// let board = new Board(BOARD_WIDTH, BOARD_HEIGHT, Team.Black);\n\nconst statusText = document.getElementById(\"status-p\");\nconst statusAlert = document.getElementById(\"status-d\");\nconst teamText = document.getElementById(\"team-p\");\nconst nodeCountText = document.getElementById(\"node-count\");\nconst winningText = document.getElementById(\"winning-p\");\n\nconst startBtn = document.getElementById(\"startBtn\");\nstartBtn.onclick = start_game;\n\nlet wonTimeout = null;\nlet statusTimeout = null;\nlet setStatus = setStatusAlert;\n\nlet current_state = GameState.HUMAN_TURN.THINKING;\n\nlet game = null;\nlet painter = null;\n\nlet clicks = [];\n\nstart_game();\n\n/////////////////\n// CANVAS\n/////////////////\n\nconst canvas = document.getElementById(\"game-canvas\");\ncanvas.addEventListener(\"click\", (event) => {\n var mousepos = getMousePos(canvas, event);\n // console.log(mousepos);\n var cell = new BrdIdx(\n Math.floor((mousepos.y / canvas.clientHeight) * BOARD_HEIGHT),\n Math.floor((mousepos.x / canvas.clientWidth) * BOARD_WIDTH),\n );\n // console.log(cell);\n process_canvas_click(cell);\n});\n\n////////////////\n// FUNCS\n////////////////\n\nfunction start_game() {\n game = new Game(BOARD_WIDTH, BOARD_HEIGHT, PIECE_ROWS, Team.Black, SEARCH_DEPTH);\n painter = new Painter(CANVAS_WIDTH, CANVAS_HEIGHT, \"game-canvas\");\n game.set_painter(painter);\n game.draw();\n\n clearInterval(wonTimeout);\n updateTeamText();\n updateWinningText();\n clicks = [];\n current_state = GameState.HUMAN_TURN.THINKING;\n}\n\nfunction process_canvas_click(cell_coord) {\n\n switch(current_state) {\n // first click of a move\n case GameState.HUMAN_TURN.THINKING:\n if (game.current_cell_state(cell_coord).state != SquareState.Occupied ) {\n return;\n }\n\n if (game.current_cell_state(cell_coord).occupant.team != game.current_turn() ) {\n return;\n }\n\n // console.log(\"Your turn, first piece picked\");\n\n clicks.push(cell_coord);\n current_state = GameState.HUMAN_TURN.FROM_SELECTED;\n game.set_selected(cell_coord);\n game.draw();\n \n break;\n \n // second click of a move\n case GameState.HUMAN_TURN.FROM_SELECTED:\n\n // second click is different to first, process as move\n // otherwise, will skip straight to clean up (clear selected and clicks) \n if (!clicks[0].eq(cell_coord)) {\n\n if (game.current_cell_state(cell_coord).state != SquareState.Empty ) {\n return;\n }\n \n // console.log(\"Your turn, first piece already picked, picking second\");\n \n clicks.push(cell_coord);\n \n if (clicks.length != 2) {\n setStatus(`Error: wrong number of clicks to process ${clicks.length}`);\n console.error(`Error: wrong number of clicks to process ${clicks.length}`);\n \n return;\n }\n\n let status = game.make_move(clicks[0], clicks[1]);\n\n switch(status) {\n case Moveable.Allowed:\n\n if (aiCheckBox.checked && game.has_won() === undefined) {\n game.ai_move();\n nodeCountText.innerText = `searched ${game.last_node_count.toLocaleString(\"en-GB\")} possible moves`;\n }\n\n break;\n case Moveable.IllegalTrajectory:\n setStatus(\"You can't move like that!\");\n break;\n case Moveable.JumpingSameTeam:\n setStatus(\"You can't jump your own piece!\");\n break;\n case Moveable.NoJumpablePiece:\n setStatus(\"There's nothing to jump!\");\n break;\n case Moveable.OccupiedDest:\n setStatus(\"There's a piece there!\");\n break;\n case Moveable.OutOfBounds:\n setStatus(\"That square's not on the board! (how have you managed that?)\");\n break;\n case Moveable.UnoccupiedSrc:\n setStatus(\"There's no piece to move!\");\n break;\n case Moveable.Unplayable:\n setStatus(\"That's not a playable square!\");\n break;\n case Moveable.WrongTeamSrc:\n setStatus(\"That's not your piece!\");\n break;\n }\n \n }\n\n game.clear_selected();\n game.draw();\n clicks = [];\n current_state = GameState.HUMAN_TURN.THINKING;\n \n break;\n case GameState.AI_TURN:\n console.log(\"It's the AI's turn!\");\n break;\n }\n\n updateTeamText();\n updateWinningText();\n checkWon();\n}\n\nfunction getMousePos(canvas, evt) {\n var rect = canvas.getBoundingClientRect();\n return {\n x: evt.clientX - rect.left,\n y: evt.clientY - rect.top\n };\n}\n\nfunction setStatusText(txt, hide = true) {\n if(statusTimeout != null) {\n clearInterval(statusTimeout);\n }\n\n statusText.innerText = txt;\n\n if(hide) {\n statusTimeout = setTimeout(() => {\n statusText.innerText = \"\";\n }, STATUS_TIMEOUT);\n }\n}\n\nfunction setStatusAlert(txt, alertType = \"danger\", hide = true) {\n if(statusTimeout != null) {\n clearInterval(statusTimeout);\n }\n\n statusAlert.className = `alert alert-${alertType}`;\n statusAlert.innerText = txt;\n statusAlert.hidden = false;\n\n if(hide) {\n statusTimeout = setTimeout(() => {\n statusAlert.hidden = true;\n }, STATUS_TIMEOUT);\n }\n}\n\nfunction updateTeamText(){\n let team = game.current_turn();\n switch(team) {\n case Team.White:\n teamText.innerText = \"⚪ White ⚪\";\n break;\n case Team.Black:\n teamText.innerText = \"🔴 Black 🔴\";\n break;\n }\n}\n\nfunction updateWinningText(){\n \n switch(game.winning()) {\n case undefined:\n winningText.innerText = \"\";\n break;\n case Team.White:\n winningText.innerText = \"👑 White 👑\";\n break;\n case Team.Black:\n winningText.innerText = \"👑 Black 👑\";\n break;\n }\n}\n\nfunction checkWon() {\n\n switch(game.has_won()) {\n case undefined:\n break;\n case Team.White:\n setStatus(\"You Lost!\");\n wonTimeout = setInterval(() => {\n start_game();\n }, WON_TIMEOUT);\n break;\n case Team.Black:\n setStatus(\"You Won!\", \"success\");\n wonTimeout = setInterval(() => {\n start_game();\n }, WON_TIMEOUT);\n break;\n }\n}\n\n////////////////\n// UI\n////////////////\n\nconst widthBox = document.getElementById(\"width\");\n/**\n * Handler for width input box change, start a new game\n */\nconst onWidth = () => {\n\n BOARD_WIDTH = parseInt(widthBox.value);\n start_game();\n}\nwidthBox.onchange = onWidth;\nwidthBox.value = 8;\n\nconst heightBox = document.getElementById(\"height\");\n/**\n * Handler for height input box change, start a new game\n */\nconst onHeight = () => {\n\n BOARD_HEIGHT = parseInt(heightBox.value);\n pieceRowsBox.max = (BOARD_HEIGHT / 2) - 1;\n start_game();\n}\nheightBox.onchange = onHeight;\nheightBox.value = 8;\n\nconst pieceRowsBox = document.getElementById(\"play_rows\");\n/**\n * Handler for piece rows input box change, start a new game\n */\nconst onPieceRows = () => {\n\n PIECE_ROWS = parseInt(pieceRowsBox.value);\n start_game();\n}\npieceRowsBox.onchange = onPieceRows;\npieceRowsBox.value = 3;\n\nconst aiSearchDepthBox = document.getElementById(\"ai_search_depth\");\n/**\n * Handler for AI search depth input box change, start a new game\n */\nconst onAISearchDepth = () => {\n\n SEARCH_DEPTH = parseInt(aiSearchDepthBox.value);\n game.set_search_depth(SEARCH_DEPTH);\n\n if(SEARCH_DEPTH > 4) {\n setStatus(\"This increases thinking time exponentially, be careful (probably don't go past 6)\", \"warning\");\n }\n}\naiSearchDepthBox.onchange = onAISearchDepth;\naiSearchDepthBox.value = 4;\n\nconst aiCheckBox = document.getElementById(\"ai-checkbox\");\n/**\n * Handler for height input box change, get a new universe of given size\n */\nconst onAICheck = () => {\n \n}\naiCheckBox.onchange = onAICheck;\n// aiCheckBox.checked = true;\n\nconst aiPerfectChance = document.getElementById(\"ai_difficulty\");\n/**\n * Handler for piece rows input box change, start a new game\n */\nconst onPerfectChance = () => {\n\n PERFECT_CHANCE = parseInt(aiPerfectChance.value) / 100;\n game.set_perfect_chance(PERFECT_CHANCE);\n}\naiPerfectChance.onchange = onPerfectChance;\naiPerfectChance.value = 50;"],"sourceRoot":""} \ No newline at end of file diff --git a/1f6adaf6c2dc4c9caead.module.wasm b/1f6adaf6c2dc4c9caead.module.wasm deleted file mode 100644 index e51c5ac..0000000 Binary files a/1f6adaf6c2dc4c9caead.module.wasm and /dev/null differ diff --git a/5834d1c20fa287719232.module.wasm b/5834d1c20fa287719232.module.wasm new file mode 100644 index 0000000..d1bc4bf Binary files /dev/null and b/5834d1c20fa287719232.module.wasm differ diff --git a/doc/COPYRIGHT.txt b/doc/COPYRIGHT.txt index 16d7903..c2629a8 100644 --- a/doc/COPYRIGHT.txt +++ b/doc/COPYRIGHT.txt @@ -2,7 +2,8 @@ These documentation pages include resources by third parties. This copyright file applies only to those resources. The following third party resources are included, and carry their own copyright notices and license terms: -* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff): +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2, + FiraSans-Regular.woff, FiraSans-Medium.woff): Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ with Reserved Font Name Fira Sans. @@ -23,8 +24,10 @@ included, and carry their own copyright notices and license terms: Copyright (c) Nicolas Gallagher and Jonathan Neal. Licensed under the MIT license (see LICENSE-MIT.txt). -* Source Code Pro (SourceCodePro-Regular.ttf.woff, - SourceCodePro-Semibold.ttf.woff, SourceCodePro-It.ttf.woff): +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2, + SourceCodePro-Regular.ttf.woff, SourceCodePro-Semibold.ttf.woff, + SourceCodePro-It.ttf.woff): Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark @@ -33,8 +36,9 @@ included, and carry their own copyright notices and license terms: Licensed under the SIL Open Font License, Version 1.1. See SourceCodePro-LICENSE.txt. -* Source Serif 4 (SourceSerif4-Regular.ttf.woff, SourceSerif4-Bold.ttf.woff, - SourceSerif4-It.ttf.woff): +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2, SourceSerif4-Regular.ttf.woff, + SourceSerif4-Bold.ttf.woff, SourceSerif4-It.ttf.woff): Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United diff --git a/doc/FiraSans-LICENSE.txt b/doc/FiraSans-LICENSE.txt index d444ea9..ff9afab 100644 --- a/doc/FiraSans-LICENSE.txt +++ b/doc/FiraSans-LICENSE.txt @@ -1,5 +1,5 @@ Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. -with Reserved Font Name < Fira >, +with Reserved Font Name < Fira >, This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: @@ -19,7 +19,7 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The diff --git a/doc/NanumBarunGothic-LICENSE.txt b/doc/NanumBarunGothic-LICENSE.txt new file mode 100644 index 0000000..0bf4668 --- /dev/null +++ b/doc/NanumBarunGothic-LICENSE.txt @@ -0,0 +1,99 @@ +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/doc/NanumBarunGothic.ttf.woff b/doc/NanumBarunGothic.ttf.woff new file mode 100644 index 0000000..fb063e8 Binary files /dev/null and b/doc/NanumBarunGothic.ttf.woff differ diff --git a/doc/NanumBarunGothic.ttf.woff2 b/doc/NanumBarunGothic.ttf.woff2 new file mode 100644 index 0000000..1866ad4 Binary files /dev/null and b/doc/NanumBarunGothic.ttf.woff2 differ diff --git a/doc/SourceCodePro-It.ttf.woff2 b/doc/SourceCodePro-It.ttf.woff2 new file mode 100644 index 0000000..462c34e Binary files /dev/null and b/doc/SourceCodePro-It.ttf.woff2 differ diff --git a/doc/SourceCodePro-Regular.ttf.woff2 b/doc/SourceCodePro-Regular.ttf.woff2 new file mode 100644 index 0000000..10b558e Binary files /dev/null and b/doc/SourceCodePro-Regular.ttf.woff2 differ diff --git a/doc/SourceCodePro-Semibold.ttf.woff2 b/doc/SourceCodePro-Semibold.ttf.woff2 new file mode 100644 index 0000000..5ec64ee Binary files /dev/null and b/doc/SourceCodePro-Semibold.ttf.woff2 differ diff --git a/doc/SourceSerif4-Bold.ttf.woff2 b/doc/SourceSerif4-Bold.ttf.woff2 new file mode 100644 index 0000000..db57d21 Binary files /dev/null and b/doc/SourceSerif4-Bold.ttf.woff2 differ diff --git a/doc/SourceSerif4-It.ttf.woff2 b/doc/SourceSerif4-It.ttf.woff2 new file mode 100644 index 0000000..1cbc021 Binary files /dev/null and b/doc/SourceSerif4-It.ttf.woff2 differ diff --git a/doc/SourceSerif4-Regular.ttf.woff2 b/doc/SourceSerif4-Regular.ttf.woff2 new file mode 100644 index 0000000..2db73fe Binary files /dev/null and b/doc/SourceSerif4-Regular.ttf.woff2 differ diff --git a/doc/ayu.css b/doc/ayu.css index f41123b..1a8b5ad 100644 --- a/doc/ayu.css +++ b/doc/ayu.css @@ -1 +1 @@ - body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod){border-bottom-color:#5c6773;}h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}code{color:#ffb454;}h3>code,h4>code,h5>code{color:#e6e1cf;}pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 transparent;}.sidebar{scrollbar-color:#5c6773 transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#5c6773;}.docblock table,.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.content .highlighted{color:#000 !important;background-color:#c6afb3;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted{background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a span.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#c5c5c5;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#39AFD7;}.collapse-toggle,details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.search-focus:disabled{color:#929292;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help>div>span{border-bottom-color:#5c6773;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target>code,:target>.in-band{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.content .highlighted.mod,.content .highlighted.externcrate{}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content .highlighted.trait{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content .highlighted.traitalias{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}.content .highlighted.foreigntype{}pre.rust .lifetime{}.content .highlighted.primitive{}.content .highlighted.constant,.content .highlighted.static{}.stab.unstable{}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content .highlighted.enum{}.content .highlighted.struct{}.content .highlighted.keyword{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{}.stab.portability{}.content .highlighted.union{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}.content .highlighted.type{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,.help-button,#copy-path{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button:focus,#copy-path:hover,#copy-path:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results td span.alias{color:#c5c5c5;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;} \ No newline at end of file + body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 #24292f;}.sidebar{scrollbar-color:#5c6773 #24292f;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#5c6773;}.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#39AFD7;}a.srclink,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar a,.in-band a{color:#c5c5c5;}.search-results a{color:#0096cf;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help span.bottom,#help span.top{border-color:#5c6773;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:rgba(255,236,164,0.06);}:target{border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(15,20,25,1),rgba(15,20,25,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(15,20,25,1),rgba(15,20,25,0));}.toggle-line-inner{background:#616161;}.toggle-line:hover .toggle-line-inner{background:##898989;} \ No newline at end of file diff --git a/doc/clipboard.svg b/doc/clipboard.svg new file mode 100644 index 0000000..8adbd99 --- /dev/null +++ b/doc/clipboard.svg @@ -0,0 +1 @@ + diff --git a/doc/dark.css b/doc/dark.css index d606c8e..84725b2 100644 --- a/doc/dark.css +++ b/doc/dark.css @@ -1 +1 @@ -body{background-color:#353535;color:#ddd;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#DDD;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.content .highlighted{color:#eee !important;background-color:#616161;}.content .highlighted a,.content .highlighted span{color:#eee !important;}.content .highlighted.trait{background-color:#013191;}.content .highlighted.traitalias{background-color:#013191;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.mod{background-color:#803a1b;}.content .highlighted.externcrate{background-color:#396bac;}.content .highlighted.enum{background-color:#5b4e68;}.content .highlighted.struct{background-color:#194e9f;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#4950ed;}.content .highlighted.type{background-color:#38902c;}.content .highlighted.foreigntype{background-color:#b200d6;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#217d1c;}.content .highlighted.constant,.content .highlighted.static{background-color:#0063cc;}.content .highlighted.primitive{background-color:#00708a;}.content .highlighted.keyword{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#D2991D;}a.test-arrow{color:#dedede;}.collapse-toggle,details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-focus:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help>div>span{border-bottom-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target>code,:target>.in-band{background-color:#494a3d;border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,.help-button,#copy-path{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button:focus,#copy-path:hover,#copy-path:focus{border-color:#ffb900;}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results td span.alias{color:#fff;}.search-results td span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} \ No newline at end of file +body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) #5a5a5a;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-mod:focus{background-color:#803a1b;}a.result-externcrate:focus{background-color:#396bac;}a.result-enum:focus{background-color:#5b4e68;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#38902c;}a.result-foreigntype:focus{background-color:#b200d6;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#0063cc;}a.result-primitive:focus{background-color:#00708a;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#D2991D;}a.srclink,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar a,.in-band a{color:#ddd;}.search-results a{color:#ddd;}a.test-arrow{color:#dedede;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background-color:#494a3d;}:target{border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(53,53,53,1),rgba(53,53,53,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(53,53,53,1),rgba(53,53,53,0));}.toggle-line-inner{background:#616161;}.toggle-line:hover .toggle-line-inner{background:##898989;} \ No newline at end of file diff --git a/doc/draught/all.html b/doc/draught/all.html index c46f42b..d908bda 100644 --- a/doc/draught/all.html +++ b/doc/draught/all.html @@ -1,7 +1,5 @@ -List of all items in this crate - -

List of all items[] +List of all items in this crate +

List of all items[] -

Structs

Enums

Macros

Functions

Constants

- \ No newline at end of file +

Structs

Enums

Macros

Functions

Constants

+ \ No newline at end of file diff --git a/doc/draught/board/constant.STD_HEIGHT.html b/doc/draught/board/constant.STD_HEIGHT.html index d9c8210..cb368c4 100644 --- a/doc/draught/board/constant.STD_HEIGHT.html +++ b/doc/draught/board/constant.STD_HEIGHT.html @@ -1,6 +1,4 @@ -STD_HEIGHT in draught::board - Rust - -

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

pub const STD_HEIGHT: usize = 8;

Standard height of a checkers board is 8 squares

-
- \ No newline at end of file +STD_HEIGHT in draught::board - Rust +

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

pub const STD_HEIGHT: usize = 8;
Expand description

Standard height of a checkers board is 8 squares

+
+ \ No newline at end of file diff --git a/doc/draught/board/constant.STD_WIDTH.html b/doc/draught/board/constant.STD_WIDTH.html index 9e7b44f..aa065f4 100644 --- a/doc/draught/board/constant.STD_WIDTH.html +++ b/doc/draught/board/constant.STD_WIDTH.html @@ -1,6 +1,4 @@ -STD_WIDTH in draught::board - Rust - -

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

pub const STD_WIDTH: usize = 8;

Standard width of a checkers board is 8 squares

-
- \ No newline at end of file +STD_WIDTH in draught::board - Rust +

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

pub const STD_WIDTH: usize = 8;
Expand description

Standard width of a checkers board is 8 squares

+
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_board_current_turn__const.html b/doc/draught/board/constant.__wbg_get_board_current_turn__const.html new file mode 100644 index 0000000..bb14cb9 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_board_current_turn__const.html @@ -0,0 +1,3 @@ +__wbg_get_board_current_turn__const in draught::board - Rust +

Constant draught::board::__wbg_get_board_current_turn__const[][src]

const __wbg_get_board_current_turn__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_board_height__const.html b/doc/draught/board/constant.__wbg_get_board_height__const.html new file mode 100644 index 0000000..90ee91a --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_board_height__const.html @@ -0,0 +1,3 @@ +__wbg_get_board_height__const in draught::board - Rust +

Constant draught::board::__wbg_get_board_height__const[][src]

const __wbg_get_board_height__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_board_width__const.html b/doc/draught/board/constant.__wbg_get_board_width__const.html new file mode 100644 index 0000000..3c7d8f1 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_board_width__const.html @@ -0,0 +1,3 @@ +__wbg_get_board_width__const in draught::board - Rust +

Constant draught::board::__wbg_get_board_width__const[][src]

const __wbg_get_board_width__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_brdidx_col__const.html b/doc/draught/board/constant.__wbg_get_brdidx_col__const.html new file mode 100644 index 0000000..9d1f3d8 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_brdidx_col__const.html @@ -0,0 +1,3 @@ +__wbg_get_brdidx_col__const in draught::board - Rust +

Constant draught::board::__wbg_get_brdidx_col__const[][src]

const __wbg_get_brdidx_col__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_brdidx_row__const.html b/doc/draught/board/constant.__wbg_get_brdidx_row__const.html new file mode 100644 index 0000000..9b7bb45 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_brdidx_row__const.html @@ -0,0 +1,3 @@ +__wbg_get_brdidx_row__const in draught::board - Rust +

Constant draught::board::__wbg_get_brdidx_row__const[][src]

const __wbg_get_brdidx_row__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_piece_strength__const.html b/doc/draught/board/constant.__wbg_get_piece_strength__const.html new file mode 100644 index 0000000..d4461b2 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_piece_strength__const.html @@ -0,0 +1,3 @@ +__wbg_get_piece_strength__const in draught::board - Rust +

Constant draught::board::__wbg_get_piece_strength__const[][src]

const __wbg_get_piece_strength__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_piece_team__const.html b/doc/draught/board/constant.__wbg_get_piece_team__const.html new file mode 100644 index 0000000..a4d6f1b --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_piece_team__const.html @@ -0,0 +1,3 @@ +__wbg_get_piece_team__const in draught::board - Rust +

Constant draught::board::__wbg_get_piece_team__const[][src]

const __wbg_get_piece_team__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_square_occupant__const.html b/doc/draught/board/constant.__wbg_get_square_occupant__const.html new file mode 100644 index 0000000..8203033 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_square_occupant__const.html @@ -0,0 +1,3 @@ +__wbg_get_square_occupant__const in draught::board - Rust +

Constant draught::board::__wbg_get_square_occupant__const[][src]

const __wbg_get_square_occupant__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/constant.__wbg_get_square_state__const.html b/doc/draught/board/constant.__wbg_get_square_state__const.html new file mode 100644 index 0000000..d2e3b44 --- /dev/null +++ b/doc/draught/board/constant.__wbg_get_square_state__const.html @@ -0,0 +1,3 @@ +__wbg_get_square_state__const in draught::board - Rust +

Constant draught::board::__wbg_get_square_state__const[][src]

const __wbg_get_square_state__const: ();
+ \ No newline at end of file diff --git a/doc/draught/board/enums/enum.MoveType.html b/doc/draught/board/enums/enum.MoveType.html index b9b0d99..8fd8fa1 100644 --- a/doc/draught/board/enums/enum.MoveType.html +++ b/doc/draught/board/enums/enum.MoveType.html @@ -1,46 +1,41 @@ -MoveType in draught::board::enums - Rust - -

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

#[repr(u8)]
+MoveType in draught::board::enums - Rust
+    

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

#[repr(u8)]
 pub enum MoveType {
     Move,
     Jump,
-}

Move/Jump, for use in Move

-

- Variants

-
Move
Jump

Trait Implementations

impl Clone for MoveType[src]

impl Debug for MoveType[src]

impl FromWasmAbi for MoveType[src]

type Abi = u32

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

Expand description

Move/Jump, for use in Move

+

Variants

Move

Jump

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

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

-

impl IntoWasmAbi for MoveType[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for MoveType[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for MoveType[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<MoveType> for MoveType[src]

impl WasmDescribe for MoveType[src]

impl Copy for MoveType[src]

impl Eq for MoveType[src]

impl StructuralEq for MoveType[src]

impl StructuralPartialEq for MoveType[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/enums/enum.Moveable.html b/doc/draught/board/enums/enum.Moveable.html index 827af22..26c8ad8 100644 --- a/doc/draught/board/enums/enum.Moveable.html +++ b/doc/draught/board/enums/enum.Moveable.html @@ -1,7 +1,5 @@ -Moveable in draught::board::enums - Rust - -

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

#[repr(u8)]
+Moveable in draught::board::enums - Rust
+    

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

#[repr(u8)]
 pub enum Moveable {
     Allowed,
     UnoccupiedSrc,
@@ -12,42 +10,39 @@ pub enum Moveable {
     IllegalTrajectory,
     NoJumpablePiece,
     JumpingSameTeam,
-}

Possible outcomes of trying to move

-

- Variants

-
Allowed
UnoccupiedSrc
OccupiedDest
OutOfBounds
Unplayable
WrongTeamSrc
IllegalTrajectory
NoJumpablePiece
JumpingSameTeam

Trait Implementations

impl Clone for Moveable[src]

impl Debug for Moveable[src]

impl FromWasmAbi for Moveable[src]

type Abi = u32

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

Expand description

Possible outcomes of trying to move

+

Variants

Allowed

UnoccupiedSrc

OccupiedDest

OutOfBounds

Unplayable

WrongTeamSrc

IllegalTrajectory

NoJumpablePiece

JumpingSameTeam

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

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

-

impl IntoWasmAbi for Moveable[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Moveable[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Moveable[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Moveable> for Moveable[src]

impl WasmDescribe for Moveable[src]

impl Copy for Moveable[src]

impl Eq for Moveable[src]

impl StructuralEq for Moveable[src]

impl StructuralPartialEq for Moveable[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/enums/enum.SquareState.html b/doc/draught/board/enums/enum.SquareState.html index 8660b62..db8ef03 100644 --- a/doc/draught/board/enums/enum.SquareState.html +++ b/doc/draught/board/enums/enum.SquareState.html @@ -1,49 +1,44 @@ -SquareState in draught::board::enums - Rust - -

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

#[repr(u8)]
+SquareState in draught::board::enums - Rust
+    

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

#[repr(u8)]
 pub enum SquareState {
     Empty,
     Occupied,
     Unplayable,
-}

Model board square as Empty/Occupied/Unplayable

-

- Variants

-
Empty
Occupied
Unplayable

Trait Implementations

impl Clone for SquareState[src]

impl Debug for SquareState[src]

impl Display for SquareState[src]

impl FromWasmAbi for SquareState[src]

type Abi = u32

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

Expand description

Model board square as Empty/Occupied/Unplayable

+

Variants

Empty

Occupied

Unplayable

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

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

-

impl IntoWasmAbi for SquareState[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for SquareState[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for SquareState[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<SquareState> for SquareState[src]

impl WasmDescribe for SquareState[src]

impl Copy for SquareState[src]

impl Eq for SquareState[src]

impl StructuralEq for SquareState[src]

impl StructuralPartialEq for SquareState[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Converts the given value to a String. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/enums/enum.Strength.html b/doc/draught/board/enums/enum.Strength.html index 7bd3dd5..7b95012 100644 --- a/doc/draught/board/enums/enum.Strength.html +++ b/doc/draught/board/enums/enum.Strength.html @@ -1,46 +1,41 @@ -Strength in draught::board::enums - Rust - -

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

#[repr(u8)]
+Strength in draught::board::enums - Rust
+    

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

#[repr(u8)]
 pub enum Strength {
     Man,
     King,
-}

Man/King

-

- Variants

-
Man
King

Trait Implementations

impl Clone for Strength[src]

impl Debug for Strength[src]

impl FromWasmAbi for Strength[src]

type Abi = u32

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

Expand description

Man/King

+

Variants

Man

King

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

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

-

impl IntoWasmAbi for Strength[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Strength[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Strength[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Strength> for Strength[src]

impl WasmDescribe for Strength[src]

impl Copy for Strength[src]

impl Eq for Strength[src]

impl StructuralEq for Strength[src]

impl StructuralPartialEq for Strength[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/enums/enum.Team.html b/doc/draught/board/enums/enum.Team.html index 3c70fe5..02776b2 100644 --- a/doc/draught/board/enums/enum.Team.html +++ b/doc/draught/board/enums/enum.Team.html @@ -1,49 +1,44 @@ -Team in draught::board::enums - Rust - -

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

#[repr(u8)]
+Team in draught::board::enums - Rust
+    

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

#[repr(u8)]
 pub enum Team {
     Black,
     White,
-}

Black/White

-

- Variants

-
Black
White

Implementations

impl Team[src]

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

Get opposing team

-

Trait Implementations

impl Clone for Team[src]

impl Debug for Team[src]

impl Display for Team[src]

impl FromWasmAbi for Team[src]

type Abi = u32

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

Expand description

Black/White

+

Variants

Black

White

Implementations

Get opposing team

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

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

-

impl IntoWasmAbi for Team[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Team[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Team[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Team> for Team[src]

impl WasmDescribe for Team[src]

impl Copy for Team[src]

impl Eq for Team[src]

impl StructuralEq for Team[src]

impl StructuralPartialEq for Team[src]

Auto Trait Implementations

impl RefUnwindSafe for Team

impl Send for Team

impl Sync for Team

impl Unpin for Team

impl UnwindSafe for Team

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Converts the given value to a String. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/enums/index.html b/doc/draught/board/enums/index.html index 0d179d5..73468aa 100644 --- a/doc/draught/board/enums/index.html +++ b/doc/draught/board/enums/index.html @@ -1,11 +1,9 @@ -draught::board::enums - Rust - -

Module draught::board::enums[][src]

Enums

-
MoveType

Move/Jump, for use in Move

-
Moveable

Possible outcomes of trying to move

-
SquareState

Model board square as Empty/Occupied/Unplayable

-
Strength

Man/King

-
Team

Black/White

-
- \ No newline at end of file +draught::board::enums - Rust +

Module draught::board::enums[][src]

Enums

+

Move/Jump, for use in Move

+

Possible outcomes of trying to move

+

Model board square as Empty/Occupied/Unplayable

+

Man/King

+

Black/White

+
+ \ No newline at end of file diff --git a/doc/draught/board/index.html b/doc/draught/board/index.html index 850ad79..dec92cd 100644 --- a/doc/draught/board/index.html +++ b/doc/draught/board/index.html @@ -1,16 +1,14 @@ -draught::board - Rust - -

Module draught::board[][src]

Board module for components related to the checkers board and game structure

-

Modules

-
enums
iter

Structs

-
Board

Single state of a checkers board

-
BrdIdx

Rank 2 tensor index to identify a board square by row and column

-
Direction

Standard diagonal movements given by north west/east etc

-
Piece

Game piece given by its team and strength (normal or kinged)

-
Square

Board squares given by a state and a possible occupying game piece

-

Constants

-
STD_HEIGHT

Standard height of a checkers board is 8 squares

-
STD_WIDTH

Standard width of a checkers board is 8 squares

-
- \ No newline at end of file +draught::board - Rust +

Module draught::board[][src]

Expand description

Board module for components related to the checkers board and game structure

+

Modules

+

Structs

+

Single state of a checkers board

+

Rank 2 tensor index to identify a board square by row and column

+

Standard diagonal movements given by north west/east etc

+

Game piece given by its team and strength (normal or kinged)

+

Board squares given by a state and a possible occupying game piece

+

Constants

+
+ \ No newline at end of file diff --git a/doc/draught/board/iter/index.html b/doc/draught/board/iter/index.html index dfe3043..5881bdc 100644 --- a/doc/draught/board/iter/index.html +++ b/doc/draught/board/iter/index.html @@ -1,6 +1,4 @@ -draught::board::iter - Rust - -

Module draught::board::iter[][src]

Structs

-
PieceIterator
RowIndexIterator
RowSquareIterator
- \ No newline at end of file +draught::board::iter - Rust +

Module draught::board::iter[][src]

Structs

+
+ \ No newline at end of file diff --git a/doc/draught/board/iter/struct.PieceIterator.html b/doc/draught/board/iter/struct.PieceIterator.html index dacb1b7..4d989d0 100644 --- a/doc/draught/board/iter/struct.PieceIterator.html +++ b/doc/draught/board/iter/struct.PieceIterator.html @@ -1,142 +1,129 @@ -PieceIterator in draught::board::iter - Rust - -

Struct draught::board::iter::PieceIterator[][src]

pub struct PieceIterator<'a> {
+PieceIterator in draught::board::iter - Rust
+    

Struct draught::board::iter::PieceIterator[][src]

pub struct PieceIterator<'a> {
     board: &'a Board,
-    index_cursor: usize,
-}

- Fields

board: &'a Boardindex_cursor: usize

Implementations

impl<'a> PieceIterator<'a>[src]

pub fn new(board: &'a Board) -> Self[src]

Trait Implementations

impl<'a> Iterator for PieceIterator<'a>[src]

type Item = (usize, Square)

The type of the elements being iterated over.

-

fn next(&mut self) -> Option<(usize, Square)>[src]

Get next item from the iterator

-

Fields

board: &'a Boardindex_cursor: usize

Implementations

Trait Implementations

Get next item from the iterator

+

The type of the elements being iterated over.

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+
🔬 This is a nightly-only experimental API. (iter_advance_by)

Advances the iterator by n elements. Read more

+

Returns the nth element of the iterator. Read more

+

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

‘Zips up’ two iterators into a single iterator of pairs. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more

+

Takes a closure and creates an iterator which calls that closure on each +element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as +the next value. Read more

+

Creates an iterator which can use the peek and peek_mut methods to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more

-

Creates an iterator that skips elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that both yields elements based on a predicate and maps. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more

+

An iterator adapter similar to fold that holds internal state and +produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first None. Read more

+

Does something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+
🔬 This is a nightly-only experimental API. (iter_partition_in_place)

Reorders the elements of this iterator in-place according to the given predicate, such that all those that return true precede all those that return false. -Returns the number of true elements found. Read more

-

Auto Trait Implementations

impl<'a> RefUnwindSafe for PieceIterator<'a>

impl<'a> Send for PieceIterator<'a>

impl<'a> Sync for PieceIterator<'a>

impl<'a> Unpin for PieceIterator<'a>

impl<'a> UnwindSafe for PieceIterator<'a>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

-

type IntoIter = I

Which kind of iterator are we turning this into?

-

impl<I> IteratorRandom for I where
    I: Iterator
[src]

🔬 This is a nightly-only experimental API. (iter_is_partitioned)

Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more

+

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more

+

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more

+

Folds every element into an accumulator by applying an operation, +returning the final result. Read more

+

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Applies function to the elements of iterator and returns +the first non-none result. Read more

+
🔬 This is a nightly-only experimental API. (try_find)

Applies function to the elements of iterator and returns +the first true result or the first error. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its +index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the +specified function. Read more

+

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more

+

Returns the element that gives the minimum value from the +specified function. Read more

+

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more

+

Reverses an iterator’s direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which copies all of its elements. Read more

+

Creates an iterator which clones all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Determines if the elements of this Iterator are equal to those of +another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more

+

Determines if the elements of this Iterator are unequal to those of +another. Read more

+

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given comparator function. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Choose one element at random from the iterator. Read more

+

Collects values at random from the iterator into a supplied buffer until that buffer is filled. Read more

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Collects amount values at random from the iterator into a vector. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/iter/struct.RowIndexIterator.html b/doc/draught/board/iter/struct.RowIndexIterator.html index 5e5e4aa..a4d08d1 100644 --- a/doc/draught/board/iter/struct.RowIndexIterator.html +++ b/doc/draught/board/iter/struct.RowIndexIterator.html @@ -1,142 +1,129 @@ -RowIndexIterator in draught::board::iter - Rust - -

Struct draught::board::iter::RowIndexIterator[][src]

pub struct RowIndexIterator<'a> {
+RowIndexIterator in draught::board::iter - Rust
+    

Struct draught::board::iter::RowIndexIterator[][src]

pub struct RowIndexIterator<'a> {
     board: &'a Board,
-    row_cursor: usize,
-}

- Fields

board: &'a Boardrow_cursor: usize

Implementations

impl<'a> RowIndexIterator<'a>[src]

pub fn new(board: &'a Board) -> Self[src]

Trait Implementations

impl<'a> Iterator for RowIndexIterator<'a>[src]

type Item = Vec<usize>

The type of the elements being iterated over.

-

fn next(&mut self) -> Option<Vec<usize>>[src]

Get next item from the iterator

-

Fields

board: &'a Boardrow_cursor: usize

Implementations

Trait Implementations

Get next item from the iterator

+

The type of the elements being iterated over.

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+
🔬 This is a nightly-only experimental API. (iter_advance_by)

Advances the iterator by n elements. Read more

+

Returns the nth element of the iterator. Read more

+

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

‘Zips up’ two iterators into a single iterator of pairs. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more

+

Takes a closure and creates an iterator which calls that closure on each +element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as +the next value. Read more

+

Creates an iterator which can use the peek and peek_mut methods to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more

-

Creates an iterator that skips elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that both yields elements based on a predicate and maps. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more

+

An iterator adapter similar to fold that holds internal state and +produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first None. Read more

+

Does something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+
🔬 This is a nightly-only experimental API. (iter_partition_in_place)

Reorders the elements of this iterator in-place according to the given predicate, such that all those that return true precede all those that return false. -Returns the number of true elements found. Read more

-

Auto Trait Implementations

impl<'a> RefUnwindSafe for RowIndexIterator<'a>

impl<'a> Send for RowIndexIterator<'a>

impl<'a> Sync for RowIndexIterator<'a>

impl<'a> Unpin for RowIndexIterator<'a>

impl<'a> UnwindSafe for RowIndexIterator<'a>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

-

type IntoIter = I

Which kind of iterator are we turning this into?

-

impl<I> IteratorRandom for I where
    I: Iterator
[src]

🔬 This is a nightly-only experimental API. (iter_is_partitioned)

Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more

+

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more

+

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more

+

Folds every element into an accumulator by applying an operation, +returning the final result. Read more

+

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Applies function to the elements of iterator and returns +the first non-none result. Read more

+
🔬 This is a nightly-only experimental API. (try_find)

Applies function to the elements of iterator and returns +the first true result or the first error. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its +index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the +specified function. Read more

+

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more

+

Returns the element that gives the minimum value from the +specified function. Read more

+

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more

+

Reverses an iterator’s direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which copies all of its elements. Read more

+

Creates an iterator which clones all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Determines if the elements of this Iterator are equal to those of +another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more

+

Determines if the elements of this Iterator are unequal to those of +another. Read more

+

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given comparator function. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Choose one element at random from the iterator. Read more

+

Collects values at random from the iterator into a supplied buffer until that buffer is filled. Read more

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Collects amount values at random from the iterator into a vector. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/iter/struct.RowSquareIterator.html b/doc/draught/board/iter/struct.RowSquareIterator.html index dd556b3..c3eec71 100644 --- a/doc/draught/board/iter/struct.RowSquareIterator.html +++ b/doc/draught/board/iter/struct.RowSquareIterator.html @@ -1,142 +1,129 @@ -RowSquareIterator in draught::board::iter - Rust - -

Struct draught::board::iter::RowSquareIterator[][src]

pub struct RowSquareIterator<'a> {
+RowSquareIterator in draught::board::iter - Rust
+    

Struct draught::board::iter::RowSquareIterator[][src]

pub struct RowSquareIterator<'a> {
     board: &'a Board,
     index_iter: RowIndexIterator<'a>,
-}

- Fields

board: &'a Boardindex_iter: RowIndexIterator<'a>

Implementations

impl<'a> RowSquareIterator<'a>[src]

pub fn new(board: &'a Board) -> Self[src]

Trait Implementations

impl<'a> Iterator for RowSquareIterator<'a>[src]

type Item = Vec<Square>

The type of the elements being iterated over.

-

fn next(&mut self) -> Option<Vec<Square>>[src]

Get next item from the iterator

-

Fields

board: &'a Boardindex_iter: RowIndexIterator<'a>

Implementations

Trait Implementations

Get next item from the iterator

+

The type of the elements being iterated over.

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+
🔬 This is a nightly-only experimental API. (iter_advance_by)

Advances the iterator by n elements. Read more

+

Returns the nth element of the iterator. Read more

+

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

‘Zips up’ two iterators into a single iterator of pairs. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more

+

Takes a closure and creates an iterator which calls that closure on each +element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as +the next value. Read more

+

Creates an iterator which can use the peek and peek_mut methods to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more

-

Creates an iterator that skips elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that both yields elements based on a predicate and maps. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more

+

An iterator adapter similar to fold that holds internal state and +produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first None. Read more

+

Does something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+
🔬 This is a nightly-only experimental API. (iter_partition_in_place)

Reorders the elements of this iterator in-place according to the given predicate, such that all those that return true precede all those that return false. -Returns the number of true elements found. Read more

-

Auto Trait Implementations

impl<'a> RefUnwindSafe for RowSquareIterator<'a>

impl<'a> Send for RowSquareIterator<'a>

impl<'a> Sync for RowSquareIterator<'a>

impl<'a> Unpin for RowSquareIterator<'a>

impl<'a> UnwindSafe for RowSquareIterator<'a>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

-

type IntoIter = I

Which kind of iterator are we turning this into?

-

impl<I> IteratorRandom for I where
    I: Iterator
[src]

🔬 This is a nightly-only experimental API. (iter_is_partitioned)

Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more

+

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more

+

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more

+

Folds every element into an accumulator by applying an operation, +returning the final result. Read more

+

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Applies function to the elements of iterator and returns +the first non-none result. Read more

+
🔬 This is a nightly-only experimental API. (try_find)

Applies function to the elements of iterator and returns +the first true result or the first error. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its +index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the +specified function. Read more

+

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more

+

Returns the element that gives the minimum value from the +specified function. Read more

+

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more

+

Reverses an iterator’s direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which copies all of its elements. Read more

+

Creates an iterator which clones all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Determines if the elements of this Iterator are equal to those of +another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more

+

Determines if the elements of this Iterator are unequal to those of +another. Read more

+

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given comparator function. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Choose one element at random from the iterator. Read more

+

Collects values at random from the iterator into a supplied buffer until that buffer is filled. Read more

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Collects amount values at random from the iterator into a vector. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/sidebar-items.js b/doc/draught/board/sidebar-items.js index 4bb3570..205487c 100644 --- a/doc/draught/board/sidebar-items.js +++ b/doc/draught/board/sidebar-items.js @@ -1 +1 @@ -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","Single state of a checkers board"],["BrdIdx","Rank 2 tensor index to identify a board square by row and column"],["Direction","Standard diagonal movements given by north west/east etc"],["Piece","Game piece given by its team and strength (normal or kinged)"],["Square","Board squares given by a state and a possible occupying game piece"]]}); \ No newline at end of file +initSidebarItems({"constant":[["STD_HEIGHT","Standard height of a checkers board is 8 squares"],["STD_WIDTH","Standard width of a checkers board is 8 squares"],["__wbg_get_board_current_turn__const",""],["__wbg_get_board_height__const",""],["__wbg_get_board_width__const",""],["__wbg_get_brdidx_col__const",""],["__wbg_get_brdidx_row__const",""],["__wbg_get_piece_strength__const",""],["__wbg_get_piece_team__const",""],["__wbg_get_square_occupant__const",""],["__wbg_get_square_state__const",""]],"mod":[["enums",""],["iter",""]],"struct":[["Board","Single state of a checkers board"],["BrdIdx","Rank 2 tensor index to identify a board square by row and column"],["Direction","Standard diagonal movements given by north west/east etc"],["Piece","Game piece given by its team and strength (normal or kinged)"],["Square","Board squares given by a state and a possible occupying game piece"]]}); \ No newline at end of file diff --git a/doc/draught/board/struct.Board.html b/doc/draught/board/struct.Board.html index 50d5e86..b67d4f4 100644 --- a/doc/draught/board/struct.Board.html +++ b/doc/draught/board/struct.Board.html @@ -1,106 +1,102 @@ -Board in draught::board - Rust - -

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

pub struct Board {
-    cells: Vec<Square>,
-    pub width: usize,
-    pub height: usize,
+Board in draught::board - Rust
+    

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

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

Single state of a checkers board

-

- Fields

cells: Vec<Square>

1D backing array of board squares for the 2D game board

-
width: usizeheight: usizecurrent_turn: Team

Implementations

impl Board[src]

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

Get a mutable reference to a board square by 1D array index

-

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

Get the 1D array indices for the diagonally adjacent squares of a given board square

-

Returns

-

None: If the given square is unplayable

+}
Expand description

Single state of a checkers board

+

Fields

cells: Vec<Square>

1D backing array of board squares for the 2D game board

+
width: usizeheight: usizecurrent_turn: Team

Implementations

Get a mutable reference to a board square by 1D array index

+

Get the 1D array indices for the diagonally adjacent squares of a given board square

+
Returns
+

None: If the given square is unplayable

Some(Vec): A variable length vector of 1D indices for diagonally adjacent squares. Vector may be between 1 and 4 items long depending on the location of the given square

-

pub fn adjacent_dir(&self, idx: BrdIdx) -> Option<Direction<Square>>[src]

Get a Direction structure for the diagonally adjacent squares of a given board square

+

Get a Direction structure for the diagonally adjacent squares of a given board square

Similar to the Board::adjacent_indices function with differently formatted results

-

Returns

-

None: If the given square is unplayable

+
Returns
+

None: If the given square is unplayable

Some(Direction): A Direction structure for the diagonally adjacent squares.

-

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

Filter an array of diagonal indices (Like those from Board::adjacent_indices, Board::jumpable_indices) for those that are legal for a team’s man, i.e. solely up or down the board

-

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

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

Get the 1D array indices for the diagonally jumpable squares of a given board square

-

Returns

-

None: If the given square is unplayable

+

Filter an array of diagonal indices (Like those from Board::adjacent_indices, Board::jumpable_indices) for those that are legal for a team’s man, i.e. solely up or down the board

+

Get the 1D array indices for the diagonally jumpable squares of a given board square

+
Returns
+

None: If the given square is unplayable

Some(Vec): A variable length vector of 1D indices for diagonally jumpable squares. Vector may be between 1 and 4 items long depending on the location of the given square

-

pub fn jumpable_dir(&self, idx: BrdIdx) -> Option<Direction<Square>>[src]

Get a Direction structure for the diagonally jumpable squares of a given board square

+

Get a Direction structure for the diagonally jumpable squares of a given board square

Similar to the Board::jumpable_indices function with differently formatted results

-

Returns

-

None: If the given square is unplayable

+
Returns
+

None: If the given square is unplayable

Some(Direction): A Direction structure for the diagonally jumpable squares.

-

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

pub fn idx_diffs(from: BrdIdx, to: BrdIdx) -> (isize, isize)[src]

Get the difference between two BrdIdx objects

-

impl Board[src]

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

Get a copy of a board square by 1D array index

-

pub fn set_cell(&mut self, idx: usize, square: Square)[src]

Get a copy of a board square by 1D array index

-

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

Get a copy of a board square by 2D BrdIdx index

-

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

Transform a 2D row/column board index into a single 1D index for use with Board::cells

-

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

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

-

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

Transform a 1D array index (for Board::cells) into a 2D game board index (by row/col)

-

pub fn can_move(&self, from: BrdIdx, to: BrdIdx) -> Moveable[src]

Check whether a move given by source and destination indices is legal

-

pub fn validate_man_move(
    &self,
    from: BrdIdx,
    to: BrdIdx,
    from_square_occupant: Piece
) -> Moveable
[src]

Check that given move trajectory is valid for a man piece

-

pub fn validate_king_move(
    &self,
    from: BrdIdx,
    to: BrdIdx,
    from_square_occupant: Piece
) -> Moveable
[src]

Check that given move trajectory is valid for a king piece

-

pub fn jumpee_idx(&self, from: BrdIdx, to: BrdIdx) -> usize[src]

Get cell index of jumpee square given from and to locations

-

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

Get a pointer to the backing array of board squares, Board::cells

-

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

Get the number of board squares

-

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

Get the number of remaining pieces

-

pub fn num_player(&self, team: Team) -> usize[src]

Get the number of remaining pieces for a player

-

pub fn score(&self) -> isize[src]

Get the score value, Black - White pieces

-

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

Get the state of a board square by 1D array index

-

pub fn apply_move(&self, from: BrdIdx, to: BrdIdx) -> Board[src]

Get new board derived from current with given move applied

-

pub fn apply_jump(&self, from: BrdIdx, to: BrdIdx) -> Board[src]

Get new board derived from current with given jump applied

-

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

Get row index for current team, top row for black, bottom row for white

-

impl Board[src]

pub fn validate_jumpee(jumpee: Square, from_occ: Piece) -> Moveable[src]

Unwrap the jumpee piece from the square and Board::check_jumpee_team with Moveable response

-

pub fn check_jumpee_team(from: Piece, jumpee: Piece) -> bool[src]

Check that the source piece and the jumpee are of opposing teams

-

fn check_kinged(new_board: &mut Board, idx: BrdIdx)[src]

Check and apply king strength

-

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

Initialise a game board without game pieces

-

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

Reset the given board to a starting layout with 3 rows of opposing pieces

-

Trait Implementations

impl Clone for Board[src]

impl Debug for Board[src]

impl Display for Board[src]

impl From<Board> for JsValue[src]

impl FromWasmAbi for Board[src]

type Abi = u32

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

Get the difference between two BrdIdx objects

+

Get a copy of a board square by 1D array index

+

Get a copy of a board square by 1D array index

+

Get a copy of a board square by 2D BrdIdx index

+

Transform a 2D row/column board index into a single 1D index for use with Board::cells

+

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

+

Transform a 1D array index (for Board::cells) into a 2D game board index (by row/col)

+

Check whether a move given by source and destination indices is legal

+

Check that given move trajectory is valid for a man piece

+

Check that given move trajectory is valid for a king piece

+

Get cell index of jumpee square given from and to locations

+

Get a pointer to the backing array of board squares, Board::cells

+

Get the number of board squares

+

Get the number of remaining pieces

+

Get the number of remaining pieces for a player

+

Get the score value, Black - White pieces

+

Get the state of a board square by 1D array index

+

Get new board derived from current with given move applied

+

Get new board derived from current with given jump applied

+

Get row index for current team, top row for black, bottom row for white

+

Unwrap the jumpee piece from the square and Board::check_jumpee_team with Moveable response

+

Check that the source piece and the jumpee are of opposing teams

+

Check and apply king strength

+

Initialise a game board without game pieces

+

Reset the given board to a starting layout with 3 rows of opposing pieces

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for Board[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Board[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Board[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Board> for Board[src]

impl RefFromWasmAbi for Board[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, Board>

The type that holds the reference to Self for the duration of the +

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for Board[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, Board>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for Board[src]

impl Eq for Board[src]

impl StructuralEq for Board[src]

impl StructuralPartialEq for Board[src]

Auto Trait Implementations

impl RefUnwindSafe for Board

impl Send for Board

impl Sync for Board

impl Unpin for Board

impl UnwindSafe for Board

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Converts the given value to a String. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/struct.BrdIdx.html b/doc/draught/board/struct.BrdIdx.html index f7a1c71..6c27966 100644 --- a/doc/draught/board/struct.BrdIdx.html +++ b/doc/draught/board/struct.BrdIdx.html @@ -1,56 +1,52 @@ -BrdIdx in draught::board - Rust - -

Struct draught::board::BrdIdx[][src]

pub struct BrdIdx {
-    pub row: usize,
-    pub col: usize,
-}

Rank 2 tensor index to identify a board square by row and column

-

- Fields

row: usizecol: usize

Implementations

impl BrdIdx[src]

pub fn from(row: usize, col: usize) -> BrdIdx[src]

pub fn eq(&self, other: &BrdIdx) -> bool[src]

Trait Implementations

impl Clone for BrdIdx[src]

impl Debug for BrdIdx[src]

impl Display for BrdIdx[src]

impl From<BrdIdx> for JsValue[src]

impl FromWasmAbi for BrdIdx[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the +BrdIdx in draught::board - Rust +

Struct draught::board::BrdIdx[][src]

pub struct BrdIdx {
+    pub row: usize,
+    pub col: usize,
+}
Expand description

Rank 2 tensor index to identify a board square by row and column

+

Fields

row: usizecol: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for BrdIdx[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for BrdIdx[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for BrdIdx[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<BrdIdx> for BrdIdx[src]

impl RefFromWasmAbi for BrdIdx[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, BrdIdx>

The type that holds the reference to Self for the duration of the +

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for BrdIdx[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, BrdIdx>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for BrdIdx[src]

impl Copy for BrdIdx[src]

impl Eq for BrdIdx[src]

impl StructuralEq for BrdIdx[src]

impl StructuralPartialEq for BrdIdx[src]

Auto Trait Implementations

impl RefUnwindSafe for BrdIdx

impl Send for BrdIdx

impl Sync for BrdIdx

impl Unpin for BrdIdx

impl UnwindSafe for BrdIdx

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

Converts the given value to a String. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/struct.Direction.html b/doc/draught/board/struct.Direction.html index 80ab581..5a1d718 100644 --- a/doc/draught/board/struct.Direction.html +++ b/doc/draught/board/struct.Direction.html @@ -1,38 +1,34 @@ -Direction in draught::board - Rust - -

Struct draught::board::Direction[][src]

pub struct Direction<T: Clone + Copy> {
-    nw: Option<T>,
-    ne: Option<T>,
-    se: Option<T>,
-    sw: Option<T>,
-}

Standard diagonal movements given by north west/east etc

+Direction in draught::board - Rust +

Struct draught::board::Direction[][src]

pub struct Direction<T: Clone + Copy> {
+    nw: Option<T>,
+    ne: Option<T>,
+    se: Option<T>,
+    sw: Option<T>,
+}
Expand description

Standard diagonal movements given by north west/east etc

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

Use options for when movements are blocked/unallowed contextually

-

- Fields

nw: Option<T>

North West

-
ne: Option<T>

North East

-
se: Option<T>

South East

-
sw: Option<T>

South West

-

Implementations

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

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

Create an empty direction full of Option::None

-

Trait Implementations

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

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

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

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

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

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

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Fields

nw: Option<T>

North West

+
ne: Option<T>

North East

+
se: Option<T>

South East

+
sw: Option<T>

South West

+

Implementations

Create an empty direction full of Option::None

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/struct.Piece.html b/doc/draught/board/struct.Piece.html index 82caf01..797a503 100644 --- a/doc/draught/board/struct.Piece.html +++ b/doc/draught/board/struct.Piece.html @@ -1,54 +1,50 @@ -Piece in draught::board - Rust - -

Struct draught::board::Piece[][src]

pub struct Piece {
+Piece in draught::board - Rust
+    

Struct draught::board::Piece[][src]

pub struct Piece {
     pub team: Team,
     pub strength: Strength,
-}

Game piece given by its team and strength (normal or kinged)

-

- Fields

team: Teamstrength: Strength

Implementations

impl Piece[src]

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

Trait Implementations

impl Clone for Piece[src]

impl Debug for Piece[src]

impl From<Piece> for JsValue[src]

impl FromWasmAbi for Piece[src]

type Abi = u32

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

Expand description

Game piece given by its team and strength (normal or kinged)

+

Fields

team: Teamstrength: Strength

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for Piece[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Piece[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Piece[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Piece> for Piece[src]

impl RefFromWasmAbi for Piece[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, Piece>

The type that holds the reference to Self for the duration of the +

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for Piece[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, Piece>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for Piece[src]

impl Copy for Piece[src]

impl Eq for Piece[src]

impl StructuralEq for Piece[src]

impl StructuralPartialEq for Piece[src]

Auto Trait Implementations

impl RefUnwindSafe for Piece

impl Send for Piece

impl Sync for Piece

impl Unpin for Piece

impl UnwindSafe for Piece

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/board/struct.Square.html b/doc/draught/board/struct.Square.html index 95a0850..37d2152 100644 --- a/doc/draught/board/struct.Square.html +++ b/doc/draught/board/struct.Square.html @@ -1,60 +1,56 @@ -Square in draught::board - Rust - -

Struct draught::board::Square[][src]

pub struct Square {
-    pub occupant: Option<Piece>,
+Square in draught::board - Rust
+    

Struct draught::board::Square[][src]

pub struct Square {
+    pub occupant: Option<Piece>,
     pub state: SquareState,
-}

Board squares given by a state and a possible occupying game piece

-

- Fields

occupant: Option<Piece>

Game piece if square is occupied

+}
Expand description

Board squares given by a state and a possible occupying game piece

+

Fields

occupant: Option<Piece>

Game piece if square is occupied

state: SquareState

Description of whether the square is occupied or an unplayable, i.e. off-lattice square

-

Implementations

impl Square[src]

pub fn new(state: SquareState, occupant: Option<Piece>) -> Square[src]

Standard constructor function to form square from state and occupant

-

pub fn pc(team: Team, strength: Strength) -> Square[src]

Helper function for a well-formed piece square by team and strength

-

pub fn empty() -> Square[src]

Helper function for a well-formed empty square

-

pub fn unplay() -> Square[src]

Helper function for a well-formed unplayable square

-

Trait Implementations

impl Clone for Square[src]

impl Debug for Square[src]

impl From<Square> for JsValue[src]

impl FromWasmAbi for Square[src]

type Abi = u32

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

Implementations

Standard constructor function to form square from state and occupant

+

Helper function for a well-formed piece square by team and strength

+

Helper function for a well-formed empty square

+

Helper function for a well-formed unplayable square

+

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for Square[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Square[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Square[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl PartialEq<Square> for Square[src]

impl RefFromWasmAbi for Square[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, Square>

The type that holds the reference to Self for the duration of the +

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for Square[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, Square>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for Square[src]

impl Copy for Square[src]

impl Eq for Square[src]

impl StructuralEq for Square[src]

impl StructuralPartialEq for Square[src]

Auto Trait Implementations

impl RefUnwindSafe for Square

impl Send for Square

impl Sync for Square

impl Unpin for Square

impl UnwindSafe for Square

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/comp/index.html b/doc/draught/comp/index.html index e39fd3c..f87ebc2 100644 --- a/doc/draught/comp/index.html +++ b/doc/draught/comp/index.html @@ -1,10 +1,8 @@ -draught::comp - Rust - -

Module draught::comp[][src]

AI player logic

-

Structs

-
BoardNode

For storing boards in the AI tree, stores board with score for comparisons

-
Computer

Root-level structure for managing the game as a collection of board states

-
Move

Represents a move by source/destination indices and the move type

-
- \ No newline at end of file +draught::comp - Rust +

Module draught::comp[][src]

Expand description

AI player logic

+

Structs

+

For storing boards in the AI tree, stores board with score for comparisons

+

Root-level structure for managing the game as a collection of board states

+

Represents a move by source/destination indices and the move type

+
+ \ No newline at end of file diff --git a/doc/draught/comp/struct.BoardNode.html b/doc/draught/comp/struct.BoardNode.html index 1909936..36c50a4 100644 --- a/doc/draught/comp/struct.BoardNode.html +++ b/doc/draught/comp/struct.BoardNode.html @@ -1,29 +1,25 @@ -BoardNode in draught::comp - Rust - -

Struct draught::comp::BoardNode[][src]

pub struct BoardNode {
+BoardNode in draught::comp - Rust
+    

Struct draught::comp::BoardNode[][src]

pub struct BoardNode {
     pub board: Board,
-    pub score: isize,
-}

For storing boards in the AI tree, stores board with score for comparisons

-

- Fields

board: Boardscore: isize

Implementations

impl BoardNode[src]

pub fn new(board: Board, score: isize) -> BoardNode[src]

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

Trait Implementations

impl Clone for BoardNode[src]

impl Debug for BoardNode[src]

impl PartialEq<BoardNode> for BoardNode[src]

impl Eq for BoardNode[src]

impl StructuralEq for BoardNode[src]

impl StructuralPartialEq for BoardNode[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file + pub score: isize, +}
Expand description

For storing boards in the AI tree, stores board with score for comparisons

+

Fields

board: Boardscore: isize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/comp/struct.Computer.html b/doc/draught/comp/struct.Computer.html index 865470c..1e32183 100644 --- a/doc/draught/comp/struct.Computer.html +++ b/doc/draught/comp/struct.Computer.html @@ -1,35 +1,32 @@ -Computer in draught::comp - Rust - -

Struct draught::comp::Computer[][src]

pub struct Computer {
-    pub search_depth: usize,
+Computer in draught::comp - Rust
+    

Struct draught::comp::Computer[][src]

pub struct Computer {
+    pub search_depth: usize,
     pub team: Team,
-    pub last_node_count: usize,
-    pub perfect_chance: f64,
-}

Root-level structure for managing the game as a collection of board states

-

- Fields

search_depth: usizeteam: Teamlast_node_count: usizeperfect_chance: f64

Implementations

impl Computer[src]

pub fn new(search_depth: usize, team: Team, perfect_chance: f64) -> Computer[src]

fn available_turns(&self, board: &Board) -> Vec<Move>[src]

Get vector of available moves for a given board

-

fn gen_tree(&mut self, tree: &mut Arena<BoardNode>, board: Board) -> NodeId[src]

Generate tree of boards to given search depth, return root node

-

fn propagate_scores(tree: Arena<BoardNode>, root: NodeId) -> Arena<BoardNode>[src]

Propagate scores up the tree employing MiniMax algorithm

-

fn best_score(board: &Board, children_scores: Vec<isize>) -> isize[src]

Get best of given scores for given team

-

fn insert_board_scores(
    &mut self,
    tree: &mut Arena<BoardNode>,
    nodes: Vec<NodeId>
)
[src]

For given NodeIDs, insert score of board into tree + pub last_node_count: usize, + pub perfect_chance: f64, +}

Expand description

Root-level structure for managing the game as a collection of board states

+

Fields

search_depth: usizeteam: Teamlast_node_count: usizeperfect_chance: f64

Implementations

Get vector of available moves for a given board

+

Generate tree of boards to given search depth, return root node

+

Propagate scores up the tree employing MiniMax algorithm

+

Get best of given scores for given team

+

For given NodeIDs, insert score of board into tree Used for leaf nodes ready for propagating up tree

-

fn get_leaf_nodes(
    &mut self,
    tree: &mut Arena<BoardNode>,
    root: NodeId
) -> Vec<NodeId>
[src]

Traverse tree from given root ID and get NodeIDs of leaf nodes (those without children)

-

fn expand_layer(
    &mut self,
    tree: &mut Arena<BoardNode>,
    nodes: Vec<NodeId>
) -> Vec<NodeId>
[src]

Expand all given nodes and return newly inserted layer of nodes

-

fn expand_node(
    &mut self,
    tree: &mut Arena<BoardNode>,
    node: NodeId
) -> Vec<NodeId>
[src]

Insert all possible next boards as children of given board node

-

fn insert_boards(
    &mut self,
    tree: &mut Arena<BoardNode>,
    boards: Vec<BoardNode>
) -> Vec<NodeId>
[src]

Insert given boards into tree

-

fn get_move_boards(&self, board: &BoardNode) -> Vec<BoardNode>[src]

Get all possible next boards from given board

-

pub fn get_move(&mut self, brd: Board) -> Option<Board>[src]

Get a new board based on the given using MiniMax to make decisions

-

fn random_choice(
    tree: &Arena<BoardNode>,
    possible_moves: Vec<NodeId>,
    rng: &mut ThreadRng
) -> Board
[src]

Get a random board from possible node IDs and associated tree

-

Trait Implementations

impl Debug for Computer[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Traverse tree from given root ID and get NodeIDs of leaf nodes (those without children)

+

Expand all given nodes and return newly inserted layer of nodes

+

Insert all possible next boards as children of given board node

+

Insert given boards into tree

+

Get all possible next boards from given board

+

Get a new board based on the given using MiniMax to make decisions

+

Get a random board from possible node IDs and associated tree

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/comp/struct.Move.html b/doc/draught/comp/struct.Move.html index 5dd9823..9b4e47d 100644 --- a/doc/draught/comp/struct.Move.html +++ b/doc/draught/comp/struct.Move.html @@ -1,30 +1,26 @@ -Move in draught::comp - Rust - -

Struct draught::comp::Move[][src]

pub struct Move {
+Move in draught::comp - Rust
+    

Struct draught::comp::Move[][src]

pub struct Move {
     from: BrdIdx,
     to: BrdIdx,
     mv_type: MoveType,
-}

Represents a move by source/destination indices and the move type

-

- Fields

from: BrdIdxto: BrdIdxmv_type: MoveType

Implementations

impl Move[src]

pub fn new(from: BrdIdx, to: BrdIdx, mv_type: MoveType) -> Move[src]

Trait Implementations

impl Clone for Move[src]

impl Debug for Move[src]

impl PartialEq<Move> for Move[src]

impl Copy for Move[src]

impl Eq for Move[src]

impl StructuralEq for Move[src]

impl StructuralPartialEq for Move[src]

Auto Trait Implementations

impl RefUnwindSafe for Move

impl Send for Move

impl Sync for Move

impl Unpin for Move

impl UnwindSafe for Move

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +}
Expand description

Represents a move by source/destination indices and the move type

+

Fields

from: BrdIdxto: BrdIdxmv_type: MoveType

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+
🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/constant.__wasm_bindgen_generated_init_wasm__const.html b/doc/draught/constant.__wasm_bindgen_generated_init_wasm__const.html new file mode 100644 index 0000000..2d49a7d --- /dev/null +++ b/doc/draught/constant.__wasm_bindgen_generated_init_wasm__const.html @@ -0,0 +1,3 @@ +__wasm_bindgen_generated_init_wasm__const in draught - Rust +

Constant draught::__wasm_bindgen_generated_init_wasm__const[][src]

pub(crate) const __wasm_bindgen_generated_init_wasm__const: ();
+ \ No newline at end of file diff --git a/doc/draught/fn.__wasm_bindgen_generated_init_wasm.html b/doc/draught/fn.__wasm_bindgen_generated_init_wasm.html deleted file mode 100644 index 9434c5b..0000000 --- a/doc/draught/fn.__wasm_bindgen_generated_init_wasm.html +++ /dev/null @@ -1,5 +0,0 @@ -__wasm_bindgen_generated_init_wasm in draught - Rust - -

Function draught::__wasm_bindgen_generated_init_wasm[][src]

pub extern "C" fn __wasm_bindgen_generated_init_wasm(
) -> <() as ReturnWasmAbi>::Abi
- \ No newline at end of file diff --git a/doc/draught/fn.init_wasm.html b/doc/draught/fn.init_wasm.html index 5e4848a..3cd2640 100644 --- a/doc/draught/fn.init_wasm.html +++ b/doc/draught/fn.init_wasm.html @@ -1,5 +1,3 @@ -init_wasm in draught - Rust - -

Function draught::init_wasm[][src]

pub fn init_wasm()
- \ No newline at end of file +init_wasm in draught - Rust +

Function draught::init_wasm[][src]

pub fn init_wasm()
+ \ No newline at end of file diff --git a/doc/draught/game/constant.__wbg_get_game_last_node_count__const.html b/doc/draught/game/constant.__wbg_get_game_last_node_count__const.html new file mode 100644 index 0000000..4e750a8 --- /dev/null +++ b/doc/draught/game/constant.__wbg_get_game_last_node_count__const.html @@ -0,0 +1,3 @@ +__wbg_get_game_last_node_count__const in draught::game - Rust +

Constant draught::game::__wbg_get_game_last_node_count__const[][src]

const __wbg_get_game_last_node_count__const: ();
+ \ No newline at end of file diff --git a/doc/draught/game/constant.__wbg_get_game_perfect_chance__const.html b/doc/draught/game/constant.__wbg_get_game_perfect_chance__const.html new file mode 100644 index 0000000..ade5abc --- /dev/null +++ b/doc/draught/game/constant.__wbg_get_game_perfect_chance__const.html @@ -0,0 +1,3 @@ +__wbg_get_game_perfect_chance__const in draught::game - Rust +

Constant draught::game::__wbg_get_game_perfect_chance__const[][src]

const __wbg_get_game_perfect_chance__const: ();
+ \ No newline at end of file diff --git a/doc/draught/game/index.html b/doc/draught/game/index.html index 743391a..01d3072 100644 --- a/doc/draught/game/index.html +++ b/doc/draught/game/index.html @@ -1,8 +1,7 @@ -draught::game - Rust - -

Module draught::game[][src]

Top-level object for managing Boards, applying and managing turns

-

Structs

-
Game

Root-level structure for managing the game as a collection of board states

-
- \ No newline at end of file +draught::game - Rust +

Module draught::game[][src]

Expand description

Top-level object for managing Boards, applying and managing turns

+

Structs

+

Root-level structure for managing the game as a collection of board states

+

Constants

+
+ \ No newline at end of file diff --git a/doc/draught/game/sidebar-items.js b/doc/draught/game/sidebar-items.js index e820a46..2a082b4 100644 --- a/doc/draught/game/sidebar-items.js +++ b/doc/draught/game/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"struct":[["Game","Root-level structure for managing the game as a collection of board states"]]}); \ No newline at end of file +initSidebarItems({"constant":[["__wbg_get_game_last_node_count__const",""],["__wbg_get_game_perfect_chance__const",""]],"struct":[["Game","Root-level structure for managing the game as a collection of board states"]]}); \ No newline at end of file diff --git a/doc/draught/game/struct.Game.html b/doc/draught/game/struct.Game.html index bc982e0..ef9e962 100644 --- a/doc/draught/game/struct.Game.html +++ b/doc/draught/game/struct.Game.html @@ -1,76 +1,73 @@ -Game in draught::game - Rust - -

Struct draught::game::Game[][src]

pub struct Game {
+Game in draught::game - Rust
+    

Struct draught::game::Game[][src]

pub struct Game {
     current: Board,
-    selected_piece: Option<BrdIdx>,
-    previous_boards: Vec<Board>,
-    painter: Option<Painter>,
-    search_depth: usize,
-    pub last_node_count: usize,
-    pub perfect_chance: f64,
-}

Root-level structure for managing the game as a collection of board states

-

- Fields

current: Boardselected_piece: Option<BrdIdx>previous_boards: Vec<Board>painter: Option<Painter>search_depth: usizelast_node_count: usizeperfect_chance: f64

Implementations

impl Game[src]

pub fn previous_board(&self, turn: usize) -> &Board[src]

Get a read-only copy of a previous turn’s board

-

pub fn current_board(&self) -> &Board[src]

Set current board to given

-

impl Game[src]

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

Get pointer to current board’s squares

-

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

Get pointer to current board’s squares

-

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

Current turn’s team

-

pub fn score(&self) -> isize[src]

Current board’s score

-

pub fn winning(&self) -> Option<Team>[src]

Get currently winning player

-

pub fn has_won(&self) -> Option<Team>[src]

Check if a player has won

-

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

Get square on current board for given index

-

pub fn set_search_depth(&mut self, search_depth: usize)[src]

Set tree depth for AI to search to

-

pub fn set_selected(&mut self, idx: &BrdIdx)[src]

Set given index as selected piece + selected_piece: Option<BrdIdx>, + previous_boards: Vec<Board>, + painter: Option<Painter>, + search_depth: usize, + pub last_node_count: usize, + pub perfect_chance: f64, +}

Expand description

Root-level structure for managing the game as a collection of board states

+

Fields

current: Boardselected_piece: Option<BrdIdx>previous_boards: Vec<Board>painter: Option<Painter>search_depth: usizelast_node_count: usizeperfect_chance: f64

Implementations

Get a read-only copy of a previous turn’s board

+

Set current board to given

+

Get pointer to current board’s squares

+

Get pointer to current board’s squares

+

Current turn’s team

+

Current board’s score

+

Get currently winning player

+

Check if a player has won

+

Get square on current board for given index

+

Set tree depth for AI to search to

+

Set given index as selected piece TODO: Check whether valid square?

-

pub fn set_perfect_chance(&mut self, new_chance: f64)[src]

Set proportion of perfect moves from AI

-

pub fn clear_selected(&mut self)[src]

Clear currently selected piece

-

pub fn make_move(&mut self, from: BrdIdx, to: BrdIdx) -> Moveable[src]

Attempt to make a move given a source and destination index

-

pub fn execute_move(&mut self, from: BrdIdx, to: BrdIdx)[src]

Update board state with given move and push new board into current state

-

pub fn execute_jump(&mut self, from: BrdIdx, to: BrdIdx)[src]

Update board state with given jump move and push new board into current state

-

pub fn push_new_board(&mut self, board: Board)[src]

Push current board into the previous turns and set given board to current

-

pub fn set_current(&mut self, board: Board)[src]

Set current board to given

-

pub fn new(
    width: usize,
    height: usize,
    piece_rows: usize,
    first_turn: Team,
    search_depth: usize
) -> Game
[src]

Get new game without board renderer

-

pub fn new_with_canvas(
    width: usize,
    height: usize,
    piece_rows: usize,
    first_turn: Team,
    search_depth: usize,
    canvas_id: &str,
    canvas_width: u32,
    canvas_height: u32
) -> Game
[src]

Get a new game with canvas ID and dimensions

-

pub fn set_painter(&mut self, value: Painter)[src]

Set painter for rendering boards

-

pub fn draw(&self)[src]

Draw current board using painter if exists

-

pub fn ai_move(&mut self)[src]

Create computer, get move from current board and update current board

-

Trait Implementations

impl Debug for Game[src]

impl Display for Game[src]

impl From<Game> for JsValue[src]

impl FromWasmAbi for Game[src]

type Abi = u32

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

Set proportion of perfect moves from AI

+

Clear currently selected piece

+

Attempt to make a move given a source and destination index

+

Update board state with given move and push new board into current state

+

Update board state with given jump move and push new board into current state

+

Push current board into the previous turns and set given board to current

+

Set current board to given

+

Get new game without board renderer

+

Get a new game with canvas ID and dimensions

+

Set painter for rendering boards

+

Draw current board using painter if exists

+

Create computer, get move from current board and update current board

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for Game[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Game[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Game[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl RefFromWasmAbi for Game[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, Game>

The type that holds the reference to Self for the duration of the +

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for Game[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, Game>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for Game[src]

Auto Trait Implementations

impl RefUnwindSafe for Game

impl !Send for Game

impl !Sync for Game

impl Unpin for Game

impl UnwindSafe for Game

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

Converts the given value to a String. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/index.html b/doc/draught/index.html index 9451ae7..f69e3a1 100644 --- a/doc/draught/index.html +++ b/doc/draught/index.html @@ -1,16 +1,15 @@ -draught - Rust - -

Crate draught[][src]

Draught

+draught - Rust +

Crate draught[][src]

Expand description

Draught

An implementation of checkers/draughts in Rust WebAssembly with a minimax AI player

-

Re-exports

-
pub use board::Board;
pub use game::Game;
pub use comp::Computer;
pub use paint::Painter;

Modules

-
board

Board module for components related to the checkers board and game structure

-
comp

AI player logic

-
game

Top-level object for managing Boards, applying and managing turns

-
paint

Components for painting board states onto HTML canvases

-
utils

Macros

-
log

Wrap the web_sys access to the browser console in a macro for easy logging

-
log_error

Functions

-
__wasm_bindgen_generated_init_wasm
init_wasm
- \ No newline at end of file +

Re-exports

+
pub use board::Board;
pub use game::Game;
pub use comp::Computer;
pub use paint::Painter;

Modules

+

Board module for components related to the checkers board and game structure

+

AI player logic

+

Top-level object for managing Boards, applying and managing turns

+

Components for painting board states onto HTML canvases

+

Macros

+

Wrap the web_sys access to the browser console in a macro for easy logging

+

Constants

+

Functions

+
+ \ No newline at end of file diff --git a/doc/draught/macro.log!.html b/doc/draught/macro.log!.html index 7ff1ced..1742350 100644 --- a/doc/draught/macro.log!.html +++ b/doc/draught/macro.log!.html @@ -2,6 +2,7 @@ + Redirection

Redirecting to macro.log.html...

diff --git a/doc/draught/macro.log.html b/doc/draught/macro.log.html index 4d579fa..abc40ed 100644 --- a/doc/draught/macro.log.html +++ b/doc/draught/macro.log.html @@ -1,10 +1,7 @@ -log in draught - Rust - -

Macro draught::log[][src]

-macro_rules! log {
-    ( $( $t:tt )* ) => { ... };
-}
-

Wrap the web_sys access to the browser console in a macro for easy logging

-
- \ No newline at end of file +log in draught - Rust +

Macro draught::log[][src]

macro_rules! log {
+    ($($t : tt) *) => { ... };
+}
+
Expand description

Wrap the web_sys access to the browser console in a macro for easy logging

+
+ \ No newline at end of file diff --git a/doc/draught/macro.log_error!.html b/doc/draught/macro.log_error!.html index 9c19de2..a47d647 100644 --- a/doc/draught/macro.log_error!.html +++ b/doc/draught/macro.log_error!.html @@ -2,6 +2,7 @@ + Redirection

Redirecting to macro.log_error.html...

diff --git a/doc/draught/macro.log_error.html b/doc/draught/macro.log_error.html index 1942507..288e206 100644 --- a/doc/draught/macro.log_error.html +++ b/doc/draught/macro.log_error.html @@ -1,9 +1,6 @@ -log_error in draught - Rust - -

Macro draught::log_error[][src]

-macro_rules! log_error {
-    ( $( $t:tt )* ) => { ... };
-}
+log_error in draught - Rust +

Macro draught::log_error[][src]

macro_rules! log_error {
+    ($($t : tt) *) => { ... };
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/draught/paint/constant.BLACK_PIECE.html b/doc/draught/paint/constant.BLACK_PIECE.html index 81aabc7..e4d01c0 100644 --- a/doc/draught/paint/constant.BLACK_PIECE.html +++ b/doc/draught/paint/constant.BLACK_PIECE.html @@ -1,6 +1,4 @@ -BLACK_PIECE in draught::paint - Rust - -

Constant draught::paint::BLACK_PIECE[][src]

const BLACK_PIECE: &str = "#ed0000";

Default hex colour value for black pieces

-
- \ No newline at end of file +BLACK_PIECE in draught::paint - Rust +

Constant draught::paint::BLACK_PIECE[][src]

const BLACK_PIECE: &str = "#ed0000";
Expand description

Default hex colour value for black pieces

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.BLACK_PIECE_OUTLINE.html b/doc/draught/paint/constant.BLACK_PIECE_OUTLINE.html index 0e335d6..abb4821 100644 --- a/doc/draught/paint/constant.BLACK_PIECE_OUTLINE.html +++ b/doc/draught/paint/constant.BLACK_PIECE_OUTLINE.html @@ -1,6 +1,4 @@ -BLACK_PIECE_OUTLINE in draught::paint - Rust - -

Constant draught::paint::BLACK_PIECE_OUTLINE[][src]

const BLACK_PIECE_OUTLINE: &str = "#a60000";

Default hex colour value for black piece outline

-
- \ No newline at end of file +BLACK_PIECE_OUTLINE in draught::paint - Rust +

Constant draught::paint::BLACK_PIECE_OUTLINE[][src]

const BLACK_PIECE_OUTLINE: &str = "#a60000";
Expand description

Default hex colour value for black piece outline

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.BLACK_SQUARE.html b/doc/draught/paint/constant.BLACK_SQUARE.html index ac74419..d9a0ba9 100644 --- a/doc/draught/paint/constant.BLACK_SQUARE.html +++ b/doc/draught/paint/constant.BLACK_SQUARE.html @@ -1,6 +1,4 @@ -BLACK_SQUARE in draught::paint - Rust - -

Constant draught::paint::BLACK_SQUARE[][src]

const BLACK_SQUARE: &str = "#000000";

Default hex colour value for black square background

-
- \ No newline at end of file +BLACK_SQUARE in draught::paint - Rust +

Constant draught::paint::BLACK_SQUARE[][src]

const BLACK_SQUARE: &str = "#000000";
Expand description

Default hex colour value for black square background

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.DRAW_OUTLINE.html b/doc/draught/paint/constant.DRAW_OUTLINE.html index 41224ea..eaad6e6 100644 --- a/doc/draught/paint/constant.DRAW_OUTLINE.html +++ b/doc/draught/paint/constant.DRAW_OUTLINE.html @@ -1,6 +1,4 @@ -DRAW_OUTLINE in draught::paint - Rust - -

Constant draught::paint::DRAW_OUTLINE[][src]

const DRAW_OUTLINE: bool = true;

Whether to outline black squares

-
- \ No newline at end of file +DRAW_OUTLINE in draught::paint - Rust +

Constant draught::paint::DRAW_OUTLINE[][src]

const DRAW_OUTLINE: bool = true;
Expand description

Whether to outline black squares

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.DRAW_PIECE_OUTLINES.html b/doc/draught/paint/constant.DRAW_PIECE_OUTLINES.html index 69391a7..2903e69 100644 --- a/doc/draught/paint/constant.DRAW_PIECE_OUTLINES.html +++ b/doc/draught/paint/constant.DRAW_PIECE_OUTLINES.html @@ -1,6 +1,4 @@ -DRAW_PIECE_OUTLINES in draught::paint - Rust - -

Constant draught::paint::DRAW_PIECE_OUTLINES[][src]

const DRAW_PIECE_OUTLINES: bool = true;

Whether to outline pieces

-
- \ No newline at end of file +DRAW_PIECE_OUTLINES in draught::paint - Rust +

Constant draught::paint::DRAW_PIECE_OUTLINES[][src]

const DRAW_PIECE_OUTLINES: bool = true;
Expand description

Whether to outline pieces

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.KING_OUTLINE.html b/doc/draught/paint/constant.KING_OUTLINE.html index a70c5e9..731e288 100644 --- a/doc/draught/paint/constant.KING_OUTLINE.html +++ b/doc/draught/paint/constant.KING_OUTLINE.html @@ -1,6 +1,4 @@ -KING_OUTLINE in draught::paint - Rust - -

Constant draught::paint::KING_OUTLINE[][src]

const KING_OUTLINE: &str = "#ffea00";

Default hex colour value for black piece outline

-
- \ No newline at end of file +KING_OUTLINE in draught::paint - Rust +

Constant draught::paint::KING_OUTLINE[][src]

const KING_OUTLINE: &str = "#ffea00";
Expand description

Default hex colour value for black piece outline

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.OUTLINE_WIDTH.html b/doc/draught/paint/constant.OUTLINE_WIDTH.html index 900c588..b107f85 100644 --- a/doc/draught/paint/constant.OUTLINE_WIDTH.html +++ b/doc/draught/paint/constant.OUTLINE_WIDTH.html @@ -1,6 +1,4 @@ -OUTLINE_WIDTH in draught::paint - Rust - -

Constant draught::paint::OUTLINE_WIDTH[][src]

const OUTLINE_WIDTH: f64 = 0.05;

Line width when outlining black squares as proportion of min cell dimension

-
- \ No newline at end of file +OUTLINE_WIDTH in draught::paint - Rust +

Constant draught::paint::OUTLINE_WIDTH[][src]

const OUTLINE_WIDTH: f64 = 0.05;
Expand description

Line width when outlining black squares as proportion of min cell dimension

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.PIECE_OUTLINE_PROPORTION.html b/doc/draught/paint/constant.PIECE_OUTLINE_PROPORTION.html index f25071f..fd81cfd 100644 --- a/doc/draught/paint/constant.PIECE_OUTLINE_PROPORTION.html +++ b/doc/draught/paint/constant.PIECE_OUTLINE_PROPORTION.html @@ -1,6 +1,4 @@ -PIECE_OUTLINE_PROPORTION in draught::paint - Rust - -

Constant draught::paint::PIECE_OUTLINE_PROPORTION[][src]

const PIECE_OUTLINE_PROPORTION: f64 = 0.25;

Line width for outlining pieces as proportion of piece radius

-
- \ No newline at end of file +PIECE_OUTLINE_PROPORTION in draught::paint - Rust +

Constant draught::paint::PIECE_OUTLINE_PROPORTION[][src]

const PIECE_OUTLINE_PROPORTION: f64 = 0.25;
Expand description

Line width for outlining pieces as proportion of piece radius

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.PIECE_PROPORTION.html b/doc/draught/paint/constant.PIECE_PROPORTION.html index eed5ea9..c9dac32 100644 --- a/doc/draught/paint/constant.PIECE_PROPORTION.html +++ b/doc/draught/paint/constant.PIECE_PROPORTION.html @@ -1,6 +1,4 @@ -PIECE_PROPORTION in draught::paint - Rust - -

Constant draught::paint::PIECE_PROPORTION[][src]

const PIECE_PROPORTION: f64 = 0.6;

Proportion of square that piece fills as proportion of min cell dimension

-
- \ No newline at end of file +PIECE_PROPORTION in draught::paint - Rust +

Constant draught::paint::PIECE_PROPORTION[][src]

const PIECE_PROPORTION: f64 = 0.6;
Expand description

Proportion of square that piece fills as proportion of min cell dimension

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.SELECTED_PIECE.html b/doc/draught/paint/constant.SELECTED_PIECE.html index 1afcef0..7ad1900 100644 --- a/doc/draught/paint/constant.SELECTED_PIECE.html +++ b/doc/draught/paint/constant.SELECTED_PIECE.html @@ -1,6 +1,4 @@ -SELECTED_PIECE in draught::paint - Rust - -

Constant draught::paint::SELECTED_PIECE[][src]

const SELECTED_PIECE: &str = "#fffd78";

Default hex colour value for selected piece

-
- \ No newline at end of file +SELECTED_PIECE in draught::paint - Rust +

Constant draught::paint::SELECTED_PIECE[][src]

const SELECTED_PIECE: &str = "#fffd78";
Expand description

Default hex colour value for selected piece

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.SELECTED_PIECE_OUTLINE.html b/doc/draught/paint/constant.SELECTED_PIECE_OUTLINE.html index f64dc8d..e9f3190 100644 --- a/doc/draught/paint/constant.SELECTED_PIECE_OUTLINE.html +++ b/doc/draught/paint/constant.SELECTED_PIECE_OUTLINE.html @@ -1,6 +1,4 @@ -SELECTED_PIECE_OUTLINE in draught::paint - Rust - -

Constant draught::paint::SELECTED_PIECE_OUTLINE[][src]

const SELECTED_PIECE_OUTLINE: &str = "#d1cf45";

Default hex colour value for selected piece outline

-
- \ No newline at end of file +SELECTED_PIECE_OUTLINE in draught::paint - Rust +

Constant draught::paint::SELECTED_PIECE_OUTLINE[][src]

const SELECTED_PIECE_OUTLINE: &str = "#d1cf45";
Expand description

Default hex colour value for selected piece outline

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.SQUARE_OUTLINE.html b/doc/draught/paint/constant.SQUARE_OUTLINE.html index 74cebad..a7c46c9 100644 --- a/doc/draught/paint/constant.SQUARE_OUTLINE.html +++ b/doc/draught/paint/constant.SQUARE_OUTLINE.html @@ -1,6 +1,4 @@ -SQUARE_OUTLINE in draught::paint - Rust - -

Constant draught::paint::SQUARE_OUTLINE[][src]

const SQUARE_OUTLINE: &str = "#9c9c9c";

Default hex colour value for outline of black squares

-
- \ No newline at end of file +SQUARE_OUTLINE in draught::paint - Rust +

Constant draught::paint::SQUARE_OUTLINE[][src]

const SQUARE_OUTLINE: &str = "#9c9c9c";
Expand description

Default hex colour value for outline of black squares

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.WHITE_PIECE.html b/doc/draught/paint/constant.WHITE_PIECE.html index fd043ec..a02e3b1 100644 --- a/doc/draught/paint/constant.WHITE_PIECE.html +++ b/doc/draught/paint/constant.WHITE_PIECE.html @@ -1,6 +1,4 @@ -WHITE_PIECE in draught::paint - Rust - -

Constant draught::paint::WHITE_PIECE[][src]

const WHITE_PIECE: &str = "#dbdbdb";

Default hex colour value for white pieces

-
- \ No newline at end of file +WHITE_PIECE in draught::paint - Rust +

Constant draught::paint::WHITE_PIECE[][src]

const WHITE_PIECE: &str = "#dbdbdb";
Expand description

Default hex colour value for white pieces

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.WHITE_PIECE_OUTLINE.html b/doc/draught/paint/constant.WHITE_PIECE_OUTLINE.html index 9cc5b32..95b03b3 100644 --- a/doc/draught/paint/constant.WHITE_PIECE_OUTLINE.html +++ b/doc/draught/paint/constant.WHITE_PIECE_OUTLINE.html @@ -1,6 +1,4 @@ -WHITE_PIECE_OUTLINE in draught::paint - Rust - -

Constant draught::paint::WHITE_PIECE_OUTLINE[][src]

const WHITE_PIECE_OUTLINE: &str = "#9c9c9c";

Default hex colour value for white piece outline

-
- \ No newline at end of file +WHITE_PIECE_OUTLINE in draught::paint - Rust +

Constant draught::paint::WHITE_PIECE_OUTLINE[][src]

const WHITE_PIECE_OUTLINE: &str = "#9c9c9c";
Expand description

Default hex colour value for white piece outline

+
+ \ No newline at end of file diff --git a/doc/draught/paint/constant.WHITE_SQUARE.html b/doc/draught/paint/constant.WHITE_SQUARE.html index d8f8fc6..8bb1d1b 100644 --- a/doc/draught/paint/constant.WHITE_SQUARE.html +++ b/doc/draught/paint/constant.WHITE_SQUARE.html @@ -1,6 +1,4 @@ -WHITE_SQUARE in draught::paint - Rust - -

Constant draught::paint::WHITE_SQUARE[][src]

const WHITE_SQUARE: &str = "#FFFFFF";

Default hex colour value for white square background

-
- \ No newline at end of file +WHITE_SQUARE in draught::paint - Rust +

Constant draught::paint::WHITE_SQUARE[][src]

const WHITE_SQUARE: &str = "#FFFFFF";
Expand description

Default hex colour value for white square background

+
+ \ No newline at end of file diff --git a/doc/draught/paint/index.html b/doc/draught/paint/index.html index 98c0054..4114f8b 100644 --- a/doc/draught/paint/index.html +++ b/doc/draught/paint/index.html @@ -1,24 +1,22 @@ -draught::paint - Rust - -

Module draught::paint[][src]

Components for painting board states onto HTML canvases

-

Structs

-
Painter

Used to paint boards onto HTML canvases

-

Constants

-
BLACK_PIECE

Default hex colour value for black pieces

-
BLACK_PIECE_OUTLINE

Default hex colour value for black piece outline

-
BLACK_SQUARE

Default hex colour value for black square background

-
DRAW_OUTLINE

Whether to outline black squares

-
DRAW_PIECE_OUTLINES

Whether to outline pieces

-
KING_OUTLINE

Default hex colour value for black piece outline

-
OUTLINE_WIDTH

Line width when outlining black squares as proportion of min cell dimension

-
PIECE_OUTLINE_PROPORTION

Line width for outlining pieces as proportion of piece radius

-
PIECE_PROPORTION

Proportion of square that piece fills as proportion of min cell dimension

-
SELECTED_PIECE

Default hex colour value for selected piece

-
SELECTED_PIECE_OUTLINE

Default hex colour value for selected piece outline

-
SQUARE_OUTLINE

Default hex colour value for outline of black squares

-
WHITE_PIECE

Default hex colour value for white pieces

-
WHITE_PIECE_OUTLINE

Default hex colour value for white piece outline

-
WHITE_SQUARE

Default hex colour value for white square background

-
- \ No newline at end of file +draught::paint - Rust +

Module draught::paint[][src]

Expand description

Components for painting board states onto HTML canvases

+

Structs

+

Used to paint boards onto HTML canvases

+

Constants

+

Default hex colour value for black pieces

+

Default hex colour value for black piece outline

+

Default hex colour value for black square background

+

Whether to outline black squares

+

Whether to outline pieces

+

Default hex colour value for black piece outline

+

Line width when outlining black squares as proportion of min cell dimension

+

Line width for outlining pieces as proportion of piece radius

+

Proportion of square that piece fills as proportion of min cell dimension

+

Default hex colour value for selected piece

+

Default hex colour value for selected piece outline

+

Default hex colour value for outline of black squares

+

Default hex colour value for white pieces

+

Default hex colour value for white piece outline

+

Default hex colour value for white square background

+
+ \ No newline at end of file diff --git a/doc/draught/paint/struct.Painter.html b/doc/draught/paint/struct.Painter.html index 8e9a187..f34d01d 100644 --- a/doc/draught/paint/struct.Painter.html +++ b/doc/draught/paint/struct.Painter.html @@ -1,10 +1,8 @@ -Painter in draught::paint - Rust - -

Struct draught::paint::Painter[][src]

pub struct Painter {
Show fields +Painter in draught::paint - Rust +

Struct draught::paint::Painter[][src]

pub struct Painter {
Show 19 fields canvas: HtmlCanvasElement, context: CanvasRenderingContext2d, - selected_idx: Option<BrdIdx>, + selected_idx: Option<BrdIdx>, white_square: JsValue, black_square: JsValue, white_piece: JsValue, @@ -14,60 +12,59 @@ black_piece_line: JsValue, selected_piece_line: JsValue, king_line: JsValue, - piece_lines: bool, - piece_line_proportion: f64, + piece_lines: bool, + piece_line_proportion: f64, square_outline: JsValue, - outline_width: f64, - draw_outline: bool, - width: u32, - height: u32, -
}

Used to paint boards onto HTML canvases

-

- Fields

canvas: HtmlCanvasElementcontext: CanvasRenderingContext2dselected_idx: Option<BrdIdx>white_square: JsValueblack_square: JsValuewhite_piece: JsValueblack_piece: JsValueselected_piece: JsValuewhite_piece_line: JsValueblack_piece_line: JsValueselected_piece_line: JsValueking_line: JsValuepiece_lines: boolpiece_line_proportion: f64square_outline: JsValueoutline_width: f64draw_outline: boolwidth: u32height: u32

Implementations

impl Painter[src]

pub fn set_selected(&mut self, idx: &Option<BrdIdx>)[src]

Set selected piece by board index

-

fn get_canvas(canvas_id: &str) -> HtmlCanvasElement[src]

Get a canvas by element ID

-

fn get_canvas_context(canvas: &HtmlCanvasElement) -> CanvasRenderingContext2d[src]

Get a 2D canvas context for a given canvas

-

impl Painter[src]

pub fn new(width: u32, height: u32, canvas_id: &str) -> Painter[src]

Default constructor which queries for canvas by ID

-

pub fn new_with_canvas(
    width: u32,
    height: u32,
    canvas: HtmlCanvasElement
) -> Painter
[src]

Constructor with given canvas element

-

pub fn set_square_outline(&mut self, value: JsValue)[src]

Set new square outline colour value

-

pub fn set_outline_width(&mut self, value: f64)[src]

Set new line width for outlining squares

-

pub fn set_draw_outline(&mut self, value: bool)[src]

Set whether squares are outlined

-

pub fn reset_dimensions(&self)[src]

Reset the canvas dimensions to the given width and height

-

pub fn validate_board_dim(&self, board: &Board) -> bool[src]

Check whether given canvas dimensions divide evenly by given board dimenions

-

pub fn draw(&self, board: &Board)[src]

Draw a board onto the canvas

-

Trait Implementations

impl Debug for Painter[src]

impl From<Painter> for JsValue[src]

impl FromWasmAbi for Painter[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the + outline_width: f64, + draw_outline: bool, + width: u32, + height: u32, +

}
Expand description

Used to paint boards onto HTML canvases

+

Fields

canvas: HtmlCanvasElementcontext: CanvasRenderingContext2dselected_idx: Option<BrdIdx>white_square: JsValueblack_square: JsValuewhite_piece: JsValueblack_piece: JsValueselected_piece: JsValuewhite_piece_line: JsValueblack_piece_line: JsValueselected_piece_line: JsValueking_line: JsValuepiece_lines: boolpiece_line_proportion: f64square_outline: JsValueoutline_width: f64draw_outline: boolwidth: u32height: u32

Implementations

Set selected piece by board index

+

Get a canvas by element ID

+

Get a 2D canvas context for a given canvas

+

Default constructor which queries for canvas by ID

+

Constructor with given canvas element

+

Set new square outline colour value

+

Set new line width for outlining squares

+

Set whether squares are outlined

+

Reset the canvas dimensions to the given width and height

+

Check whether given canvas dimensions divide evenly by given board dimenions

+

Draw a board onto the canvas

+

Trait Implementations

Formats the value using the given formatter. Read more

+

Performs the conversion.

+

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

-

impl IntoWasmAbi for Painter[src]

type Abi = u32

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

Recover a Self from Self::Abi. Read more

+

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

-

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

-

impl OptionFromWasmAbi for Painter[src]

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

-

impl OptionIntoWasmAbi for Painter[src]

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

-

impl RefFromWasmAbi for Painter[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

-

type Anchor = Ref<'static, Painter>

The type that holds the reference to Self for the duration of the +

The wasm ABI type references to Self are recovered from.

+

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

-

impl RefMutFromWasmAbi for Painter[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

-

type Anchor = RefMut<'static, Painter>

Same as RefFromWasmAbi::Anchor

-

impl WasmDescribe for Painter[src]

Auto Trait Implementations

impl RefUnwindSafe for Painter

impl !Send for Painter

impl !Sync for Painter

impl Unpin for Painter

impl UnwindSafe for Painter

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

-

Recover a Self::Anchor from Self::Abi. Read more

+

Same as RefFromWasmAbi::Abi

+

Same as RefFromWasmAbi::Anchor

+

Same as RefFromWasmAbi::ref_from_abi

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Performs the conversion.

+

Performs the conversion.

+

Same as IntoWasmAbi::Abi

+

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

-

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

-

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

-

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

- \ No newline at end of file +

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+
+ \ No newline at end of file diff --git a/doc/draught/sidebar-items.js b/doc/draught/sidebar-items.js index 5263f85..2a4c9f0 100644 --- a/doc/draught/sidebar-items.js +++ b/doc/draught/sidebar-items.js @@ -1 +1 @@ -initSidebarItems({"fn":[["__wasm_bindgen_generated_init_wasm",""],["init_wasm",""]],"macro":[["log","Wrap the [`web_sys`] access to the browser console in a macro for easy logging"],["log_error",""]],"mod":[["board","Board module for components related to the checkers board and game structure"],["comp","AI player logic"],["game","Top-level object for managing [`Board`]s, applying and managing turns"],["paint","Components for painting board states onto HTML canvases"],["utils",""]]}); \ No newline at end of file +initSidebarItems({"constant":[["__wasm_bindgen_generated_init_wasm__const",""]],"fn":[["init_wasm",""]],"macro":[["log","Wrap the [`web_sys`] access to the browser console in a macro for easy logging"],["log_error",""]],"mod":[["board","Board module for components related to the checkers board and game structure"],["comp","AI player logic"],["game","Top-level object for managing [`Board`]s, applying and managing turns"],["paint","Components for painting board states onto HTML canvases"],["utils",""]]}); \ No newline at end of file diff --git a/doc/draught/utils/fn.set_panic_hook.html b/doc/draught/utils/fn.set_panic_hook.html index 3e6a210..f0923a3 100644 --- a/doc/draught/utils/fn.set_panic_hook.html +++ b/doc/draught/utils/fn.set_panic_hook.html @@ -1,5 +1,3 @@ -set_panic_hook in draught::utils - Rust - -

Function draught::utils::set_panic_hook[][src]

pub fn set_panic_hook()
- \ No newline at end of file +set_panic_hook in draught::utils - Rust +

Function draught::utils::set_panic_hook[][src]

pub fn set_panic_hook()
+ \ No newline at end of file diff --git a/doc/draught/utils/index.html b/doc/draught/utils/index.html index 93ac62f..651e3a0 100644 --- a/doc/draught/utils/index.html +++ b/doc/draught/utils/index.html @@ -1,6 +1,4 @@ -draught::utils - Rust - -

Module draught::utils[][src]

Functions

-
set_panic_hook
- \ No newline at end of file +draught::utils - Rust +

Module draught::utils[][src]

Functions

+
+ \ No newline at end of file diff --git a/doc/implementors/core/clone/trait.Clone.js b/doc/implementors/core/clone/trait.Clone.js index 00b88aa..16441b7 100644 --- a/doc/implementors/core/clone/trait.Clone.js +++ b/doc/implementors/core/clone/trait.Clone.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Clone for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Clone for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Clone for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Clone for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Clone for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Clone for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> Clone for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Clone for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Clone for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Clone for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Clone for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Clone for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; +implementors["draught"] = [{"text":"impl Clone for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Clone for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Clone for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Clone for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Clone for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Clone for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> Clone for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Clone for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Clone for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Clone for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Clone for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Clone for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/cmp/trait.Eq.js b/doc/implementors/core/cmp/trait.Eq.js index 5e9c4c1..a14a501 100644 --- a/doc/implementors/core/cmp/trait.Eq.js +++ b/doc/implementors/core/cmp/trait.Eq.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Eq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Eq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Eq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Eq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Eq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Eq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Eq + Clone + Copy> Eq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Eq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Eq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Eq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Eq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Eq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; +implementors["draught"] = [{"text":"impl Eq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Eq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Eq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Eq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Eq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Eq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Eq + Clone + Copy> Eq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Eq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Eq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Eq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Eq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Eq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/cmp/trait.PartialEq.js b/doc/implementors/core/cmp/trait.PartialEq.js index 9b2ec0b..bcf5c22 100644 --- a/doc/implementors/core/cmp/trait.PartialEq.js +++ b/doc/implementors/core/cmp/trait.PartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl PartialEq<MoveType> for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl PartialEq<Team> for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl PartialEq<Strength> for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl PartialEq<SquareState> for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl PartialEq<Moveable> for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl PartialEq<Piece> for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: PartialEq + Clone + Copy> PartialEq<Direction<T>> for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl PartialEq<Square> for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl PartialEq<BrdIdx> for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl PartialEq<Board> for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl PartialEq<Move> for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl PartialEq<BoardNode> for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; +implementors["draught"] = [{"text":"impl PartialEq<MoveType> for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl PartialEq<Team> for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl PartialEq<Strength> for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl PartialEq<SquareState> for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl PartialEq<Moveable> for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl PartialEq<Piece> for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: PartialEq + Clone + Copy> PartialEq<Direction<T>> for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl PartialEq<Square> for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl PartialEq<BrdIdx> for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl PartialEq<Board> for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl PartialEq<Move> for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl PartialEq<BoardNode> for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/convert/trait.From.js b/doc/implementors/core/convert/trait.From.js index c75c55e..965b3d0 100644 --- a/doc/implementors/core/convert/trait.From.js +++ b/doc/implementors/core/convert/trait.From.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl From<Piece> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Square> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<BrdIdx> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Board> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Game> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Painter> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]}]; +implementors["draught"] = [{"text":"impl From<Piece> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Square> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<BrdIdx> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Board> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Game> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]},{"text":"impl From<Painter> for JsValue","synthetic":false,"types":["wasm_bindgen::JsValue"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/fmt/trait.Debug.js b/doc/implementors/core/fmt/trait.Debug.js index d2cb888..c87d20c 100644 --- a/doc/implementors/core/fmt/trait.Debug.js +++ b/doc/implementors/core/fmt/trait.Debug.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Debug for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Debug for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Debug for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Debug for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Debug for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Debug for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Debug + Clone + Copy> Debug for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Debug for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Debug for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Debug for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Debug for Game","synthetic":false,"types":["draught::game::Game"]},{"text":"impl Debug for Painter","synthetic":false,"types":["draught::paint::Painter"]},{"text":"impl Debug for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Debug for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]},{"text":"impl Debug for Computer","synthetic":false,"types":["draught::comp::Computer"]}]; +implementors["draught"] = [{"text":"impl Debug for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Debug for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Debug for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Debug for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Debug for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Debug for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Debug + Clone + Copy> Debug for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Debug for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Debug for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Debug for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Debug for Game","synthetic":false,"types":["draught::game::Game"]},{"text":"impl Debug for Painter","synthetic":false,"types":["draught::paint::Painter"]},{"text":"impl Debug for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl Debug for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]},{"text":"impl Debug for Computer","synthetic":false,"types":["draught::comp::Computer"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/fmt/trait.Display.js b/doc/implementors/core/fmt/trait.Display.js index f13dffb..fc048d8 100644 --- a/doc/implementors/core/fmt/trait.Display.js +++ b/doc/implementors/core/fmt/trait.Display.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Display for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Display for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Display for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Display for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Display for Game","synthetic":false,"types":["draught::game::Game"]}]; +implementors["draught"] = [{"text":"impl Display for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Display for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Display for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Display for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl Display for Game","synthetic":false,"types":["draught::game::Game"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/iter/traits/iterator/trait.Iterator.js b/doc/implementors/core/iter/traits/iterator/trait.Iterator.js index e10ea71..d78b63d 100644 --- a/doc/implementors/core/iter/traits/iterator/trait.Iterator.js +++ b/doc/implementors/core/iter/traits/iterator/trait.Iterator.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl<'a> Iterator for RowIndexIterator<'a>","synthetic":false,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Iterator for RowSquareIterator<'a>","synthetic":false,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Iterator for PieceIterator<'a>","synthetic":false,"types":["draught::board::iter::PieceIterator"]}]; +implementors["draught"] = [{"text":"impl<'a> Iterator for RowIndexIterator<'a>","synthetic":false,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Iterator for RowSquareIterator<'a>","synthetic":false,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Iterator for PieceIterator<'a>","synthetic":false,"types":["draught::board::iter::PieceIterator"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.Copy.js b/doc/implementors/core/marker/trait.Copy.js index 0d0573a..eb69457 100644 --- a/doc/implementors/core/marker/trait.Copy.js +++ b/doc/implementors/core/marker/trait.Copy.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Copy for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Copy for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Copy for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Copy for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Copy for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Copy for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Copy + Clone> Copy for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Copy for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Copy for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Copy for Move","synthetic":false,"types":["draught::comp::Move"]}]; +implementors["draught"] = [{"text":"impl Copy for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl Copy for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl Copy for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl Copy for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl Copy for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl Copy for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Copy + Clone> Copy for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl Copy for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl Copy for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl Copy for Move","synthetic":false,"types":["draught::comp::Move"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.Freeze.js b/doc/implementors/core/marker/trait.Freeze.js index 510b6c1..4608eed 100644 --- a/doc/implementors/core/marker/trait.Freeze.js +++ b/doc/implementors/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Freeze for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Freeze for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Freeze for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Freeze for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Freeze for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Freeze for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Freeze for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Freeze for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Freeze for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Freeze for Direction<T> where
    T: Freeze
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Freeze for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Freeze for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Freeze for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl Freeze for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl Freeze for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Freeze for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Freeze for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Freeze for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +implementors["draught"] = [{"text":"impl Freeze for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Freeze for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Freeze for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Freeze for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Freeze for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Freeze for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Freeze for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Freeze for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Freeze for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Freeze for Direction<T> where
    T: Freeze
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Freeze for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Freeze for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Freeze for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl Freeze for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl Freeze for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Freeze for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Freeze for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Freeze for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.Send.js b/doc/implementors/core/marker/trait.Send.js index 2ae51f8..0584eeb 100644 --- a/doc/implementors/core/marker/trait.Send.js +++ b/doc/implementors/core/marker/trait.Send.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Send for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Send for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Send for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Send for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Send for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Send for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Send for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Send for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Send for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Send for Direction<T> where
    T: Send
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Send for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Send for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Send for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl !Send for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl !Send for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Send for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Send for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Send for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +implementors["draught"] = [{"text":"impl Send for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Send for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Send for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Send for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Send for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Send for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Send for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Send for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Send for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Send for Direction<T> where
    T: Send
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Send for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Send for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Send for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl !Send for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl !Send for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Send for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Send for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Send for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.StructuralEq.js b/doc/implementors/core/marker/trait.StructuralEq.js index d869d0e..7c028a8 100644 --- a/doc/implementors/core/marker/trait.StructuralEq.js +++ b/doc/implementors/core/marker/trait.StructuralEq.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl StructuralEq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl StructuralEq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl StructuralEq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl StructuralEq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl StructuralEq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl StructuralEq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> StructuralEq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl StructuralEq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl StructuralEq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl StructuralEq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl StructuralEq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl StructuralEq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; +implementors["draught"] = [{"text":"impl StructuralEq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl StructuralEq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl StructuralEq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl StructuralEq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl StructuralEq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl StructuralEq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> StructuralEq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl StructuralEq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl StructuralEq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl StructuralEq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl StructuralEq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl StructuralEq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.StructuralPartialEq.js b/doc/implementors/core/marker/trait.StructuralPartialEq.js index f41638d..ec800b5 100644 --- a/doc/implementors/core/marker/trait.StructuralPartialEq.js +++ b/doc/implementors/core/marker/trait.StructuralPartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl StructuralPartialEq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl StructuralPartialEq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl StructuralPartialEq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl StructuralPartialEq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl StructuralPartialEq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl StructuralPartialEq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> StructuralPartialEq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl StructuralPartialEq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl StructuralPartialEq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl StructuralPartialEq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl StructuralPartialEq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl StructuralPartialEq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; +implementors["draught"] = [{"text":"impl StructuralPartialEq for MoveType","synthetic":false,"types":["draught::board::enums::MoveType"]},{"text":"impl StructuralPartialEq for Team","synthetic":false,"types":["draught::board::enums::Team"]},{"text":"impl StructuralPartialEq for Strength","synthetic":false,"types":["draught::board::enums::Strength"]},{"text":"impl StructuralPartialEq for SquareState","synthetic":false,"types":["draught::board::enums::SquareState"]},{"text":"impl StructuralPartialEq for Moveable","synthetic":false,"types":["draught::board::enums::Moveable"]},{"text":"impl StructuralPartialEq for Piece","synthetic":false,"types":["draught::board::Piece"]},{"text":"impl<T: Clone + Copy> StructuralPartialEq for Direction<T>","synthetic":false,"types":["draught::board::Direction"]},{"text":"impl StructuralPartialEq for Square","synthetic":false,"types":["draught::board::Square"]},{"text":"impl StructuralPartialEq for BrdIdx","synthetic":false,"types":["draught::board::BrdIdx"]},{"text":"impl StructuralPartialEq for Board","synthetic":false,"types":["draught::board::Board"]},{"text":"impl StructuralPartialEq for Move","synthetic":false,"types":["draught::comp::Move"]},{"text":"impl StructuralPartialEq for BoardNode","synthetic":false,"types":["draught::comp::BoardNode"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.Sync.js b/doc/implementors/core/marker/trait.Sync.js index bc79d2c..82f27b4 100644 --- a/doc/implementors/core/marker/trait.Sync.js +++ b/doc/implementors/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Sync for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Sync for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Sync for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Sync for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Sync for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Sync for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Sync for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Sync for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Sync for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Sync for Direction<T> where
    T: Sync
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Sync for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Sync for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Sync for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl !Sync for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl !Sync for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Sync for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Sync for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Sync for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +implementors["draught"] = [{"text":"impl Sync for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Sync for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Sync for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Sync for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Sync for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Sync for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Sync for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Sync for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Sync for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Sync for Direction<T> where
    T: Sync
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Sync for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Sync for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Sync for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl !Sync for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl !Sync for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Sync for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Sync for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Sync for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/marker/trait.Unpin.js b/doc/implementors/core/marker/trait.Unpin.js index 6493e2b..eda5986 100644 --- a/doc/implementors/core/marker/trait.Unpin.js +++ b/doc/implementors/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ (function() {var implementors = {}; -implementors["draught"] = [{"text":"impl Unpin for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Unpin for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Unpin for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Unpin for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Unpin for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Unpin for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Unpin for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Unpin for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Unpin for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Unpin for Direction<T> where
    T: Unpin
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Unpin for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Unpin for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Unpin for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl Unpin for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl Unpin for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Unpin for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Unpin for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Unpin for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +implementors["draught"] = [{"text":"impl Unpin for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl Unpin for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl Unpin for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl Unpin for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl Unpin for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> Unpin for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> Unpin for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> Unpin for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl Unpin for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> Unpin for Direction<T> where
    T: Unpin
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl Unpin for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl Unpin for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl Unpin for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl Unpin for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl Unpin for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl Unpin for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl Unpin for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl Unpin for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000..b09ba67 --- /dev/null +++ b/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["draught"] = [{"text":"impl RefUnwindSafe for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl RefUnwindSafe for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl RefUnwindSafe for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl RefUnwindSafe for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl RefUnwindSafe for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> RefUnwindSafe for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> RefUnwindSafe for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> RefUnwindSafe for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl RefUnwindSafe for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> RefUnwindSafe for Direction<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl RefUnwindSafe for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl RefUnwindSafe for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl RefUnwindSafe for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl RefUnwindSafe for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl RefUnwindSafe for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl RefUnwindSafe for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl RefUnwindSafe for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl RefUnwindSafe for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000..e905896 --- /dev/null +++ b/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["draught"] = [{"text":"impl UnwindSafe for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl UnwindSafe for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl UnwindSafe for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl UnwindSafe for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl UnwindSafe for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> UnwindSafe for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> UnwindSafe for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> UnwindSafe for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl UnwindSafe for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> UnwindSafe for Direction<T> where
    T: UnwindSafe
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl UnwindSafe for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl UnwindSafe for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl UnwindSafe for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl UnwindSafe for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl UnwindSafe for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl UnwindSafe for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl UnwindSafe for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl UnwindSafe for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/std/panic/trait.RefUnwindSafe.js b/doc/implementors/std/panic/trait.RefUnwindSafe.js deleted file mode 100644 index 5ee11e2..0000000 --- a/doc/implementors/std/panic/trait.RefUnwindSafe.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = {}; -implementors["draught"] = [{"text":"impl RefUnwindSafe for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl RefUnwindSafe for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl RefUnwindSafe for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl RefUnwindSafe for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl RefUnwindSafe for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> RefUnwindSafe for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> RefUnwindSafe for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> RefUnwindSafe for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl RefUnwindSafe for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> RefUnwindSafe for Direction<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl RefUnwindSafe for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl RefUnwindSafe for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl RefUnwindSafe for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl RefUnwindSafe for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl RefUnwindSafe for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl RefUnwindSafe for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl RefUnwindSafe for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl RefUnwindSafe for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/implementors/std/panic/trait.UnwindSafe.js b/doc/implementors/std/panic/trait.UnwindSafe.js deleted file mode 100644 index 947b814..0000000 --- a/doc/implementors/std/panic/trait.UnwindSafe.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = {}; -implementors["draught"] = [{"text":"impl UnwindSafe for MoveType","synthetic":true,"types":["draught::board::enums::MoveType"]},{"text":"impl UnwindSafe for Team","synthetic":true,"types":["draught::board::enums::Team"]},{"text":"impl UnwindSafe for Strength","synthetic":true,"types":["draught::board::enums::Strength"]},{"text":"impl UnwindSafe for SquareState","synthetic":true,"types":["draught::board::enums::SquareState"]},{"text":"impl UnwindSafe for Moveable","synthetic":true,"types":["draught::board::enums::Moveable"]},{"text":"impl<'a> UnwindSafe for RowIndexIterator<'a>","synthetic":true,"types":["draught::board::iter::RowIndexIterator"]},{"text":"impl<'a> UnwindSafe for RowSquareIterator<'a>","synthetic":true,"types":["draught::board::iter::RowSquareIterator"]},{"text":"impl<'a> UnwindSafe for PieceIterator<'a>","synthetic":true,"types":["draught::board::iter::PieceIterator"]},{"text":"impl UnwindSafe for Piece","synthetic":true,"types":["draught::board::Piece"]},{"text":"impl<T> UnwindSafe for Direction<T> where
    T: UnwindSafe
","synthetic":true,"types":["draught::board::Direction"]},{"text":"impl UnwindSafe for Square","synthetic":true,"types":["draught::board::Square"]},{"text":"impl UnwindSafe for BrdIdx","synthetic":true,"types":["draught::board::BrdIdx"]},{"text":"impl UnwindSafe for Board","synthetic":true,"types":["draught::board::Board"]},{"text":"impl UnwindSafe for Game","synthetic":true,"types":["draught::game::Game"]},{"text":"impl UnwindSafe for Painter","synthetic":true,"types":["draught::paint::Painter"]},{"text":"impl UnwindSafe for Move","synthetic":true,"types":["draught::comp::Move"]},{"text":"impl UnwindSafe for BoardNode","synthetic":true,"types":["draught::comp::BoardNode"]},{"text":"impl UnwindSafe for Computer","synthetic":true,"types":["draught::comp::Computer"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/doc/light.css b/doc/light.css index a5060b7..5d93285 100644 --- a/doc/light.css +++ b/doc/light.css @@ -1 +1 @@ - body{background-color:white;color:black;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#ddd;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.content .highlighted{color:#000 !important;background-color:#ccc;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted.trait{background-color:#c7b6ff;}.content .highlighted.traitalias{background-color:#c7b6ff;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.enum{background-color:#b4d1b9;}.content .highlighted.struct{background-color:#e7b1a0;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#c6afb3;}.content .highlighted.type{background-color:#ffc891;}.content .highlighted.foreigntype{background-color:#f5c4ff;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#8ce488;}.content .highlighted.constant,.content .highlighted.static{background-color:#c3e0ff;}.content .highlighted.primitive{background-color:#9aecff;}.content .highlighted.keyword{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#3873AD;}a.test-arrow{color:#f5f5f5;}.collapse-toggle,details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-focus:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help>div>span{border-bottom-color:#bfbfbf;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target>code,:target>.in-band{background:#FDFFD3;border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,.help-button,#copy-path{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,.help-button:hover,.help-button:focus,#copy-path:hover,#copy-path:focus{border-color:#717171;}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results td span.alias{color:#000;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} \ No newline at end of file + body{background-color:white;color:black;}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#ddd;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#b4d1b9;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#ffc891;}a.result-foreigntype:focus{background-color:#f5c4ff;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#c3e0ff;}a.result-primitive:focus{background-color:#9aecff;}a.result-keyword:focus{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#3873AD;}a.srclink,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar a,.in-band a{color:#000;}.search-results a{color:initial;}a.test-arrow{color:#f5f5f5;}body.source .example-wrap pre.rust a{background:#eee;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:#FDFFD3;}:target{border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} \ No newline at end of file diff --git a/doc/main.js b/doc/main.js index 0639f07..082b6de 100644 --- a/doc/main.js +++ b/doc/main.js @@ -1,8 +1,8 @@ -if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}(function(){var rustdocVars=document.getElementById("rustdoc-vars");if(rustdocVars){window.rootPath=rustdocVars.attributes["data-root-path"].value;window.currentCrate=rustdocVars.attributes["data-current-crate"].value;window.searchJS=rustdocVars.attributes["data-search-js"].value;window.searchIndexJS=rustdocVars.attributes["data-search-index-js"].value}var sidebarVars=document.getElementById("sidebar-vars");if(sidebarVars){window.sidebarCurrent={name:sidebarVars.attributes["data-name"].value,ty:sidebarVars.attributes["data-ty"].value,relpath:sidebarVars.attributes["data-relpath"].value,}}}());function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}var THEME_PICKER_ELEMENT_ID="theme-picker";var THEMES_ELEMENT_ID="theme-choices";function getThemesElement(){return document.getElementById(THEMES_ELEMENT_ID)}function getThemePickerElement(){return document.getElementById(THEME_PICKER_ELEMENT_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function showThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}(function(){var themeChoices=getThemesElement();var themePicker=getThemePickerElement();var availableThemes=["ayu","dark","light"];function switchThemeButtonState(){if(themeChoices.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}}function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!==THEME_PICKER_ELEMENT_ID&&(!active.parentNode||active.parentNode.id!==THEMES_ELEMENT_ID)&&(!related||(related.id!==THEME_PICKER_ELEMENT_ID&&(!related.parentNode||related.parentNode.id!==THEMES_ELEMENT_ID)))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;availableThemes.forEach(function(item){var but=document.createElement("button");but.textContent=item;but.onclick=function(){switchTheme(window.currentTheme,window.mainTheme,item,true);useSystemTheme(false)};but.onblur=handleThemeButtonsBlur;themeChoices.appendChild(but)})}());(function(){"use strict";window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:function(){return document.getElementById("search")},title:null,titleBeforeSearch:document.title,timeout:null,currentTab:0,mouseMovedAfterSearch:true,clearInputTimeout:function(){if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},focus:function(){searchState.input.focus()},defocus:function(){searchState.input.blur()},showResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(main,"hidden");removeClass(search,"hidden");searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(search,"hidden");removeClass(main,"hidden");document.title=searchState.titleBeforeSearch;if(searchState.browserSupportsHistoryApi()){history.replaceState("",window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:function(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},putBackSearch:function(search_input){var search=searchState.outputElement();if(search_input.value!==""&&hasClass(search,"hidden")){searchState.showResults(search);if(searchState.browserSupportsHistoryApi()){var extra="?search="+encodeURIComponent(search_input.value);history.replaceState(search_input.value,"",getNakedUrl()+extra+window.location.hash)}document.title=searchState.title}},browserSupportsHistoryApi:function(){return window.history&&typeof window.history.pushState==="function"},setup:function(){var search_input=searchState.input;if(!searchState.input){return}function loadScript(url){var script=document.createElement('script');script.src=url;document.head.append(script)}var searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(window.searchJS);loadScript(window.searchIndexJS)}}search_input.addEventListener("focus",function(){searchState.putBackSearch(this);search_input.origPlaceholder=searchState.input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});search_input.addEventListener("blur",function(){search_input.placeholder=searchState.input.origPlaceholder});document.addEventListener("mousemove",function(){searchState.mouseMovedAfterSearch=true});search_input.removeAttribute('disabled');searchState.addCrateDropdown(window.ALL_CRATES);var params=searchState.getQueryStringParams();if(params.search!==undefined){var search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},addCrateDropdown:function(crates){var elem=document.getElementById("crate-search");if(!elem){return}var savedCrate=getSettingValue("saved-filter-crate");for(var i=0,len=crates.length;i0){return tmp}}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop=""}function isHidden(elem){return elem.offsetHeight===0}var toggleAllDocsId="toggle-all-docs";var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var elem;var search=searchState.outputElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){searchState.hideResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(searchState.browserSupportsHistoryApi()){history.replaceState(hash,"",getNakedUrl()+window.location.search+"#"+hash)}elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}elem=document.getElementById(savedHash.slice(1));if(!elem||!isHidden(elem)){return}var parent=elem.parentNode;if(parent&&hasClass(parent,"impl-items")){onEachLazy(parent.getElementsByClassName("collapsed"),function(e){if(e.parentNode===parent){e.click();return true}});if(isHidden(elem)){if(hasClass(parent.lastElementChild,"collapse-toggle")){parent.lastElementChild.click()}}}}}function highlightSourceLines(match,ev){if(typeof match==="undefined"){hideSidebar();match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to0){collapseDocs(collapses[0],"show")}openParentDetails(h3.parentNode)}else{openParentDetails(elem.parentNode)}}}function getHelpElement(build){if(build!==false){buildHelperPopup()}return document.getElementById("help")}function displayHelp(display,ev,help){if(display===true){help=help?help:getHelpElement(true);if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else{help=help?help:getHelpElement(false);if(help&&hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}}function handleEscape(ev){var help=getHelpElement(false);var search=searchState.outputElement();if(hasClass(help,"hidden")===false){displayHelp(false,ev,help)}else if(hasClass(search,"hidden")===false){searchState.clearInputTimeout();ev.preventDefault();searchState.hideResults(search)}searchState.defocus();hideThemeButtonState()}var disableShortcuts=getSettingValue("disable-shortcuts")==="true";function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts===true){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":displayHelp(true,ev);break;case"t":case"T":displayHelp(false,ev);ev.preventDefault();var themePicker=getThemePickerElement();themePicker.click();themePicker.focus();break;default:if(getThemePickerElement().parentNode.contains(ev.target)){handleThemeKeyDown(ev)}}}}function handleThemeKeyDown(ev){var active=document.activeElement;var themes=getThemesElement();switch(getVirtualKey(ev)){case"ArrowUp":ev.preventDefault();if(active.previousElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.previousElementSibling.focus()}else{showThemeButtonState();themes.lastElementChild.focus()}break;case"ArrowDown":ev.preventDefault();if(active.nextElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.nextElementSibling.focus()}else{showThemeButtonState();themes.firstElementChild.focus()}break;case"Enter":case"Return":case"Space":if(ev.target.id===THEME_PICKER_ELEMENT_ID&&themes.style.display==="none"){ev.preventDefault();showThemeButtonState();themes.firstElementChild.focus()}break;case"Home":ev.preventDefault();themes.firstElementChild.focus();break;case"End":ev.preventDefault();themes.lastElementChild.focus();break}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem}elem=elem.parentNode}while(elem);return null}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);var handleSourceHighlight=(function(){var prev_line_id=0;var set_fragment=function(name){var x=window.scrollX,y=window.scrollY;if(searchState.browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return function(ev){var cur_line_id=parseInt(ev.target.id,10);ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());document.addEventListener("click",function(ev){var helpElem=getHelpElement(false);if(hasClass(ev.target,"help-button")){displayHelp(true,ev)}else if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle")}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle")}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){handleSourceHighlight(ev)}else if(helpElem&&hasClass(helpElem,"hidden")===false){var is_inside_help_popup=ev.target!==helpElem&&helpElem.contains(ev.target);if(is_inside_help_popup===false){addClass(helpElem,"hidden");removeClass(document.body,"blur")}}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""))}}});(function(){var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=window.rootPath.match(/\.\.\//g).length+1;for(i=0;i"+""+"
"+code.outerHTML+"
";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i"+labelForToggleButton(sectionIsCollapsed)+"]";return toggle}function createToggle(toggle,otherMessage,fontSize,extraClass,show){var span=document.createElement("span");span.className="toggle-label";if(show){span.style.display="none"}if(!otherMessage){span.innerHTML=" Expand description"}else{span.innerHTML=otherMessage}if(fontSize){span.style.fontSize=fontSize}var mainToggle=toggle.cloneNode(true);mainToggle.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper";if(!show){addClass(wrapper,"collapsed");var inner=mainToggle.getElementsByClassName("inner");if(inner&&inner.length>0){inner[0].innerHTML="+"}}if(extraClass){addClass(wrapper,extraClass)}wrapper.appendChild(mainToggle);return wrapper}(function(){var toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}var toggle=createSimpleToggle(false);var hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";var hideImplementors=getSettingValue("auto-collapse-implementors")!=="false";var hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";var hideTraitImplementations=getSettingValue("auto-hide-trait-implementations")!=="false";var impl_list=document.getElementById("trait-implementations-list");if(impl_list!==null){onEachLazy(impl_list.getElementsByClassName("collapse-toggle"),function(e){collapseNonInherent(e)})}var blanket_list=document.getElementById("blanket-implementations-list");if(blanket_list!==null){onEachLazy(blanket_list.getElementsByClassName("collapse-toggle"),function(e){collapseNonInherent(e)})}var func=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"item-info")){next=next.nextElementSibling}if(!next){return}if(hasClass(next,"docblock")){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide")}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"item-info")){next=next.nextElementSibling}if(next&&hasClass(next,"docblock")){next=next.nextElementSibling}if(!next){return}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);var impl_call=function(){};onEachLazy(document.getElementsByTagName("details"),function(e){var showLargeItem=!hideLargeItemContents&&hasClass(e,"type-contents-toggle");var showImplementor=!hideImplementors&&hasClass(e,"implementors-toggle");if(showLargeItem||showImplementor){e.open=true}});if(hideMethodDocs===true){impl_call=function(e,newToggle){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide")}}}}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(false)+"] Hide undocumented items"}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items"}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=Array.prototype.slice.call(e.getElementsByClassName("hidden"));var needToggle=hiddenElems.some(function(hiddenElem){return hasClass(hiddenElem,"content")===false&&hasClass(hiddenElem,"docblock")===false});if(needToggle===true){var inner_toggle=newToggle.cloneNode(true);inner_toggle.onclick=toggleClicked;e.insertBefore(inner_toggle,e.firstChild);impl_call(e.previousSibling,inner_toggle)}});var currentType=document.getElementsByClassName("type-decl")[0];var className=null;if(currentType){currentType=currentType.getElementsByClassName("rust")[0];if(currentType){onEachLazy(currentType.classList,function(item){if(item!=="main"){className=item;return true}})}}function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true)});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){e.innerHTML=" Show "+e.childNodes[0].innerHTML}})}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){return}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct"}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum"}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant"}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type"}otherMessage+=" is marked as non-exhaustive"}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left"}e.parentNode.insertBefore(createToggle(toggle,otherMessage,fontSize,extraClass,true),e);if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);var pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){var lineNumbersFunc=function(){};if(getSettingValue("line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;ithe rustdoc book.";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["T","Focus the theme picker menu"],["↑","Move up in search results"],["↓","Move down in search results"],["ctrl + ↑ / ↓","Switch result tab"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(function(x){return"
"+x[0].split(" ").map(function(y,index){return(index&1)===0?""+y+"":" "+y+" "}).join("")+"
"+x[1]+"
"}).join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";var infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ +if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}(function(){var rustdocVars=document.getElementById("rustdoc-vars");if(rustdocVars){window.rootPath=rustdocVars.attributes["data-root-path"].value;window.currentCrate=rustdocVars.attributes["data-current-crate"].value;window.searchJS=rustdocVars.attributes["data-search-js"].value;window.searchIndexJS=rustdocVars.attributes["data-search-index-js"].value}var sidebarVars=document.getElementById("sidebar-vars");if(sidebarVars){window.sidebarCurrent={name:sidebarVars.attributes["data-name"].value,ty:sidebarVars.attributes["data-ty"].value,relpath:sidebarVars.attributes["data-relpath"].value,}}}());function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}var THEME_PICKER_ELEMENT_ID="theme-picker";var THEMES_ELEMENT_ID="theme-choices";function getThemesElement(){return document.getElementById(THEMES_ELEMENT_ID)}function getThemePickerElement(){return document.getElementById(THEME_PICKER_ELEMENT_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function showThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){var themePicker=getThemePickerElement();var themeChoices=getThemesElement();themeChoices.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}(function(){var themeChoices=getThemesElement();var themePicker=getThemePickerElement();var availableThemes=["ayu","dark","light"];function switchThemeButtonState(){if(themeChoices.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}}function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!==THEME_PICKER_ELEMENT_ID&&(!active.parentNode||active.parentNode.id!==THEMES_ELEMENT_ID)&&(!related||(related.id!==THEME_PICKER_ELEMENT_ID&&(!related.parentNode||related.parentNode.id!==THEMES_ELEMENT_ID)))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;availableThemes.forEach(function(item){var but=document.createElement("button");but.textContent=item;but.onclick=function(){switchTheme(window.currentTheme,window.mainTheme,item,true);useSystemTheme(false)};but.onblur=handleThemeButtonsBlur;themeChoices.appendChild(but)})}());(function(){"use strict";window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:function(){return document.getElementById("search")},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:function(){if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},focus:function(){searchState.input.focus()},defocus:function(){searchState.input.blur()},showResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(main,"hidden");removeClass(search,"hidden");searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:function(search){if(search===null||typeof search==='undefined'){search=searchState.outputElement()}addClass(search,"hidden");removeClass(main,"hidden");document.title=searchState.titleBeforeSearch;if(searchState.browserSupportsHistoryApi()){history.replaceState("",window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:function(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},putBackSearch:function(search_input){var search=searchState.outputElement();if(search_input.value!==""&&hasClass(search,"hidden")){searchState.showResults(search);if(searchState.browserSupportsHistoryApi()){var extra="?search="+encodeURIComponent(search_input.value);history.replaceState(search_input.value,"",getNakedUrl()+extra+window.location.hash)}document.title=searchState.title}},browserSupportsHistoryApi:function(){return window.history&&typeof window.history.pushState==="function"},setup:function(){var search_input=searchState.input;if(!searchState.input){return}function loadScript(url){var script=document.createElement('script');script.src=url;document.head.append(script)}var searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(window.searchJS);loadScript(window.searchIndexJS)}}search_input.addEventListener("focus",function(){searchState.putBackSearch(this);search_input.origPlaceholder=searchState.input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});search_input.addEventListener("blur",function(){search_input.placeholder=searchState.input.origPlaceholder});if(search_input.value!=''){loadSearch()}searchState.addCrateDropdown(window.ALL_CRATES);var params=searchState.getQueryStringParams();if(params.search!==undefined){var search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},addCrateDropdown:function(crates){var elem=document.getElementById("crate-search");if(!elem){return}var savedCrate=getSettingValue("saved-filter-crate");for(var i=0,len=crates.length;i0){return tmp}}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop=""}var toggleAllDocsId="toggle-all-docs";var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var elem;var search=searchState.outputElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){searchState.hideResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(searchState.browserSupportsHistoryApi()){history.replaceState(hash,"",getNakedUrl()+window.location.search+"#"+hash)}elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}expandSection(savedHash.slice(1))}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function getHelpElement(build){if(build){buildHelperPopup()}return document.getElementById("help")}function displayHelp(display,ev,help){if(display){help=help?help:getHelpElement(true);if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else{help=help?help:getHelpElement(false);if(help&&!hasClass(help,"hidden")){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}}function handleEscape(ev){var help=getHelpElement(false);var search=searchState.outputElement();if(help&&!hasClass(help,"hidden")){displayHelp(false,ev,help)}else if(search&&!hasClass(search,"hidden")){searchState.clearInputTimeout();ev.preventDefault();searchState.hideResults(search)}searchState.defocus();hideThemeButtonState()}var disableShortcuts=getSettingValue("disable-shortcuts")==="true";function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":displayHelp(true,ev);break;case"t":case"T":displayHelp(false,ev);ev.preventDefault();var themePicker=getThemePickerElement();themePicker.click();themePicker.focus();break;default:if(getThemePickerElement().parentNode.contains(ev.target)){handleThemeKeyDown(ev)}}}}function handleThemeKeyDown(ev){var active=document.activeElement;var themes=getThemesElement();switch(getVirtualKey(ev)){case"ArrowUp":ev.preventDefault();if(active.previousElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.previousElementSibling.focus()}else{showThemeButtonState();themes.lastElementChild.focus()}break;case"ArrowDown":ev.preventDefault();if(active.nextElementSibling&&ev.target.id!==THEME_PICKER_ELEMENT_ID){active.nextElementSibling.focus()}else{showThemeButtonState();themes.firstElementChild.focus()}break;case"Enter":case"Return":case"Space":if(ev.target.id===THEME_PICKER_ELEMENT_ID&&themes.style.display==="none"){ev.preventDefault();showThemeButtonState();themes.firstElementChild.focus()}break;case"Home":ev.preventDefault();themes.firstElementChild.focus();break;case"End":ev.preventDefault();themes.lastElementChild.focus();break}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);(function(){var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=window.rootPath.match(/\.\.\//g).length+1;for(i=0;i .in-band > .trait").textContent;var baseIdName="impl-"+traitName+"-";var libs=Object.getOwnPropertyNames(imp);for(var i=0,llength=libs.length;i summary:not(.hideme)"),function(el){el.addEventListener("click",function(e){if(e.target.tagName!="SUMMARY"&&e.target.tagName!="A"){e.preventDefault()}})});onEachLazy(document.getElementsByClassName("notable-traits"),function(e){e.onclick=function(){this.getElementsByClassName('notable-traits-tooltiptext')[0].classList.toggle("force-tooltip")}});var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")){hideSidebar()}else{showSidebar()}}}var buildHelperPopup=function(){var popup=document.createElement("aside");addClass(popup,"hidden");popup.id="help";popup.addEventListener("click",function(ev){if(ev.target===popup){displayHelp(false,ev)}});var book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \ + the rustdoc book.";var container=document.createElement("div");var shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["T","Focus the theme picker menu"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(function(x){return"
"+x[0].split(" ").map(function(y,index){return(index&1)===0?""+y+"":" "+y+" "}).join("")+"
"+x[1]+"
"}).join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";var infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ enum, trait, type, macro, \ and const.","Search functions by type signature (e.g., vec -> usize or \ * -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(function(x){return"

"+x+"

"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;container.appendChild(book_info);container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,searchState.outputElement());buildHelperPopup=function(){}}onHashChange(null);window.onhashchange=onHashChange;searchState.setup()}());function copy_path(but){var parent=but.parentElement;var path=[];onEach(parent.childNodes,function(child){if(child.tagName==='A'){path.push(child.textContent)}});var el=document.createElement('textarea');el.value='use '+path.join('::')+';';el.setAttribute('readonly','');el.style.position='absolute';el.style.left='-9999px';document.body.appendChild(el);el.select();document.execCommand('copy');document.body.removeChild(el);but.textContent='✓'} \ No newline at end of file + your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(function(x){return"

"+x+"

"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;container.appendChild(book_info);container.appendChild(div_shortcuts);container.appendChild(div_infos);var rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";var rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc 1.58.1 (db9d1b20b 2022-01-20)";rustdoc_version.appendChild(rustdoc_version_code);container.appendChild(rustdoc_version);popup.appendChild(container);insertAfter(popup,searchState.outputElement());buildHelperPopup=function(){}};onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){var reset_button_timeout=null;window.copy_path=function(but){var parent=but.parentElement;var path=[];onEach(parent.childNodes,function(child){if(child.tagName==='A'){path.push(child.textContent)}});var el=document.createElement('textarea');el.value=path.join('::');el.setAttribute('readonly','');el.style.position='absolute';el.style.left='-9999px';document.body.appendChild(el);el.select();document.execCommand('copy');document.body.removeChild(el);but.children[0].style.display='none';var tmp;if(but.childNodes.length<2){tmp=document.createTextNode('✓');but.appendChild(tmp)}else{onEachLazy(but.childNodes,function(e){if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent='✓'}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent='';reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/doc/normalize.css b/doc/normalize.css index 6d692b5..469959f 100644 --- a/doc/normalize.css +++ b/doc/normalize.css @@ -1,2 +1,2 @@ - /*! normalize.css v3.0.0 | MIT License | git.io/normalize */ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} \ No newline at end of file + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/doc/noscript.css b/doc/noscript.css index 807cd86..a4ce2bb 100644 --- a/doc/noscript.css +++ b/doc/noscript.css @@ -1 +1 @@ - #main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}#main>h2+div,#main>h3+div{display:block;}#main>h2+h3{display:flex;}#main .impl-items .hidden{display:block !important;}#main .impl-items h4.hidden{display:flex !important;}#main .attributes{margin-left:0 !important;}#copy-path{display:none;} \ No newline at end of file + #main .attributes{margin-left:0 !important;}#copy-path{display:none;}.sub{display:none;}#theme-picker{display:none;} \ No newline at end of file diff --git a/doc/rustdoc.css b/doc/rustdoc.css index 909b415..e7788fd 100644 --- a/doc/rustdoc.css +++ b/doc/rustdoc.css @@ -1 +1 @@ - @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2"),url("FiraSans-Regular.woff") format('woff');font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2"),url("FiraSans-Medium.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff") format('woff');font-display:swap;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif 4",serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){font-weight:500;margin:20px 0 15px 0;padding-bottom:6px;}h1.fqn{display:flex;border-bottom:1px dashed;margin-top:0;padding-left:1px;}h1.fqn>.in-band>a:hover{text-decoration:underline;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border-bottom:1px solid;}h3.impl,h3.method,h4.method,h3.type,h4.type,h4.associatedconstant{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}h3.impl,h3.method,h4.method.trait-impl,h3.type,h4.type.trait-impl,h4.associatedconstant.trait-impl{padding-left:15px;}h1,h2,h3,h4,.sidebar,a.source,.search-input,.content table td:first-child>a,.collapse-toggle,div.item-list .out-of-band,#source-sidebar,#sidebar-toggle,#main>ul.docblock>li>a{font-family:"Fira Sans",Arial,sans-serif;}.content ul.crate a.crate{font-size:16px/1.6;font-family:"Fira Sans",Arial,sans-serif;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}code,pre,a.test-arrow{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;padding-right:1ex;}pre{padding:14px;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;min-width:70em;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow:auto;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-child{font-weight:500;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{margin-top:0;margin-bottom:8px;text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc:not(.source) .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;border-top-left-radius:5px;border-bottom-left-radius:5px;padding:13px 8px;text-align:right;}.rustdoc:not(.source) .example-wrap>pre.rust{width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results>table{width:100%;table-layout:fixed;}.content pre.line-numbers{float:left;border:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom:1px solid;}#main>.docblock h1{font-size:1.3em;}#main>.docblock h2{font-size:1.15em;}#main>.docblock h3,#main>.docblock h4,#main>.docblock h5{font-size:1em;}#main>h2+div,#main>h2+h3,#main>h3+div{display:none;flex-wrap:wrap;}.docblock h1{font-size:1em;}.docblock h2{font-size:0.95em;}.docblock h3,.docblock h4,.docblock h5{font-size:0.9em;}.docblock{margin-left:24px;position:relative;}.content .out-of-band{flex-grow:0;text-align:right;font-size:23px;margin:0px;padding:0 0 0 12px;font-weight:normal;}h3.impl>.out-of-band{font-size:21px;}h4.method>.out-of-band{font-size:19px;}h4>code,h3>code,.invisible>code{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;}.in-band>code{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",Arial,sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);border:1px dashed;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content .method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div:not(.notable-traits){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items>h4{border-bottom:0;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.toggle-wrapper.marg-left>.collapse-toggle{left:-24px;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .item-info code{font-size:90%;}.content .item-info{position:relative;margin-left:33px;margin-top:-13px;}.sub-variant>div>.item-info{margin-top:initial;}.content .item-info::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{margin-left:20px;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.item-info{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-7px;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-28px;padding-right:10px;}.anchor:before{content:'\2002\00a7\2002';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.item-info a{text-decoration:underline;}.invisible>.srclink,h4>code+.srclink,h3>code+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 63px);}#crate-search{min-width:115px;margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results .desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results a{display:block;}.content .search-results td:first-child{padding-right:0;width:50%;}.content .search-results td:first-child a{padding-right:10px;}.content .search-results td:first-child a:after{clear:both;content:"";display:block;}.content .search-results td:first-child a span{float:left;}tr.result span.primitive::after{content:' (primitive type)';font-style:italic;}tr.result span.keyword::after{content:' (keyword)';font-style:italic;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help>div>span{text-align:center;display:block;margin:10px 0;font-size:18px;border-bottom:1px solid #ccc;padding-bottom:4px;margin-bottom:6px;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:0 20px 20px 17px;;}.stab{display:table;border-width:1px;border-style:solid;padding:3px;margin-bottom:5px;font-size:90%;}.stab p{display:inline;}.stab summary{display:list-item;}.stab .emoji{font-size:1.5em;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-right:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;position:absolute;right:0;top:0;}.impl-items .since,.impl .since,.methods .since{flex-grow:0;padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{flex-grow:0;font-size:17px;font-weight:normal;}.impl-items code,.impl code,.methods code{flex-grow:1;}.impl-items h4,h4.impl,h3.impl,.methods h3{display:flex;flex-basis:100%;font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.section-header a{color:inherit;}.code-attribute{font-weight:300;}.collapse-toggle{font-weight:300;position:absolute;left:-23px;top:0;}h3>.collapse-toggle,h4>.collapse-toggle{font-size:0.8em;top:5px;}.toggle-wrapper>.collapse-toggle{left:-24px;margin-top:0px;}.toggle-wrapper{position:relative;margin-top:0;}.toggle-wrapper.collapsed{height:25px;transition:height .2s;margin-bottom:.6em;}.collapse-toggle>.inner{display:inline-block;width:1.2ch;text-align:center;}.collapse-toggle.hidden-default{position:relative;margin-left:20px;}.since+.srclink{display:table-cell;padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}.toggle-wrapper>.collapse-toggle{left:0;}.variant+.toggle-wrapper+.docblock>p{margin-top:5px;}.sub-variant,.sub-variant>h3{margin-top:0px !important;padding-top:1px;}#main>details>.sub-variant>h3{font-size:15px;margin-left:25px;margin-bottom:5px;}.sub-variant>div{margin-left:20px;margin-bottom:10px;}.sub-variant>div>span{display:block;position:relative;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.docblock>.section-header:first-child{margin-left:15px;margin-top:0;}.docblock>.section-header:first-child:hover>a:before{left:-10px;}#main>.variant,#main>.structfield{display:block;}:target>code{opacity:1;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:16px;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:20px;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:16px;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:20px;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border:0;border-top:2px solid;}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:16px;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}h4>.notable-traits{position:absolute;left:-44px;top:2px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu,.help-button{position:absolute;top:10px;}#settings-menu{right:0;outline:none;}#theme-picker,#settings-menu,.help-button,#copy-path{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}.help-button{right:30px;font-family:"Fira Sans",Arial,sans-serif;text-align:center;font-size:17px;padding-top:2px;}#copy-path{height:30px;font-size:18px;margin-left:10px;padding:0 6px;width:28px;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;left:0;top:45px;bottom:0;overflow-y:auto;border-right:1px solid;display:none;}.sidebar>.block.version{border-bottom:none;margin-top:12px;margin-bottom:0;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main,#search{margin-top:45px;padding:0;}.content h4>.out-of-band{position:inherit;}.toggle-wrapper>.collapse-toggle{left:0px;}.toggle-wrapper{height:1.5em;}#search{margin-left:0;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{display:flex;}.anchor{display:none !important;}.theme-picker{left:10px;top:54px;z-index:1;}h4>.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar.mobile>div.version{overflow:hidden;max-height:33px;}.sidebar{width:calc(100% + 30px);}.show-it{display:block;width:246px;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}.collapse-toggle{left:-20px;}.impl>.collapse-toggle{left:-10px;}.item-list>details.rustdoc-toggle>summary:not(.hideme)::before{left:-10px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}.help-button{display:none;}.search-container>div{width:calc(100% - 32px);}}@media print{nav.sub,.content .out-of-band,.collapse-toggle{display:none;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main,#search{margin-top:100px;}#main>table:not(.table-display) td{word-break:break-word;width:50%;}.search-container>div{display:block;width:calc(100% - 37px);}#crate-search{width:100%;border-radius:4px;border:0;}#crate-search+.search-input{width:calc(100% + 71px);margin-left:-36px;}#theme-picker,#settings-menu{padding:5px;width:31px;height:31px;}#theme-picker{margin-top:-2px;}#settings-menu{top:7px;}.docblock{margin-left:12px;}}h3.notable{margin:0;margin-bottom:13px;font-size:19px;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary::-webkit-details-marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"[+]";font-weight:300;font-size:0.8em;letter-spacing:1px;cursor:pointer;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-23px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle[open]{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before{content:"[−]";display:inline;} \ No newline at end of file + @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2"),url("FiraSans-Regular.woff") format('woff');font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2"),url("FiraSans-Medium.woff") format('woff');font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2"),url("SourceSerif4-Regular.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2"),url("SourceSerif4-It.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2"),url("SourceSerif4-Bold.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2"),url("SourceCodePro-Regular.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2"),url("SourceCodePro-It.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2"),url("SourceCodePro-Semibold.ttf.woff") format("woff");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic.ttf.woff2") format("woff2"),url("NanumBarunGothic.ttf.woff") format("woff");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:20px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}h1.fqn{display:flex;border-bottom:1px dashed;margin-top:0;padding-left:1px;}h1.fqn>.in-band>a:hover{text-decoration:underline;}h2,.top-doc h3,.top-doc h4,.sidebar .others h3{border-bottom:1px solid;}h3.code-header{font-size:1.1em;}h4.code-header{font-size:1em;}h3.code-header,h4.code-header{font-weight:600;border-bottom-style:none;padding:0;margin:0;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}div.impl-items>div{padding-left:0;}h1,h2,h3,h4,h5,h6,.sidebar,a.source,.search-input,.search-results .result-name,.content table td:first-child>a,.item-left>a,div.item-list .out-of-band,span.since,#source-sidebar,#sidebar-toggle,details.rustdoc-toggle>summary::before,div.impl-items>div:not(.docblock):not(.item-info),.content ul.crate a.crate,a.srclink,#main>ul.docblock>li>a{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}.content ul.crate a.crate{font-size:16px/1.6;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.docblock.item-decl{margin-left:0;}.item-decl pre{overflow-x:auto;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow-y:scroll;}.rustdoc.source .sidebar{overflow-y:auto;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;height:100%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;font-weight:inherit;padding:0;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.location a:hover{text-decoration:underline;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;font-weight:inherit;padding:0;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.example-wrap>pre.rust a:hover{text-decoration:underline;}.rustdoc:not(.source) .example-wrap>pre:not(.line-number){width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre.line-numbers{width:auto;overflow-x:visible;}.rustdoc .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results>table{width:100%;table-layout:fixed;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.3em;}.top-doc .docblock h3{font-size:1.15em;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.1em;}.top-doc .docblock h6{font-size:1em;}.docblock h5{font-size:1em;}.docblock h6{font-size:0.95em;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.information){max-width:100%;overflow-x:auto;}.content .out-of-band{flex-grow:0;text-align:right;font-size:23px;margin:0px;padding:0 0 0 12px;font-weight:normal;}.method>.code-header,.trait-impl>.code-header,.invisible>.code-header{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;overflow-wrap:anywhere;}.in-band>code,.in-band>.code-header{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",Arial,sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);overflow-x:auto;display:block;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content>.methods>.method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div:not(.notable-traits):not(.method){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .item-info code{font-size:90%;}.content .item-info{position:relative;margin-left:33px;}.sub-variant>div>.item-info{margin-top:initial;}.content .item-info::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.item-info{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.anchor::before{content:'§';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.item-info a{text-decoration:underline;}.invisible>.srclink,.method>.code-header+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.item-table{display:table;}.item-row{display:table-row;}.item-left,.item-right{display:table-cell;}.item-left{padding-right:1.2rem;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 63px);}#crate-search{min-width:115px;margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;width:100%;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.search-results .result-name>span{display:inline-block;margin:0;font-weight:normal;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:18px;}#help span.top{text-align:center;display:block;margin:10px 0;border-bottom:1px solid;padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:0 20px 20px 17px;;}.item-info .stab{display:table;}.stab{padding:3px;margin-bottom:5px;font-size:90%;font-weight:normal;}.stab p{display:inline;}.stab .emoji{font-size:1.2em;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-left:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.impl-items .since,.impl .since,.methods .since{padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{font-size:17px;font-weight:normal;}.rightside{float:right;}.has-srclink{font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.code-attribute{font-weight:300;}.since+.srclink{padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}h3.variant{font-weight:600;font-size:1.1em;margin-bottom:10px;border-bottom:none;}.sub-variant h4{font-size:1em;font-weight:400;border-bottom:none;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.top-doc .docblock>.section-header:first-child{margin-left:15px;}.top-doc .docblock>.section-header:first-child:hover>a:before{left:-10px;}.docblock>.section-header:first-child{margin-top:0;}:target>code,:target>.code-header{opacity:1;}:target{padding-right:3px;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:16px;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:20px;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:16px;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:19px;font-weight:600;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:20px;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border:0;border-top:2px solid;}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:16px;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu,#help-button{position:absolute;top:10px;}#settings-menu{right:0;outline:none;}#theme-picker,#settings-menu,#help-button,#copy-path{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}#help-button{right:30px;font-family:"Fira Sans",Arial,sans-serif;text-align:center;font-size:17px;padding-top:2px;}#copy-path{background:initial;margin-left:10px;padding:0;padding-left:2px;border:0;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"";cursor:pointer;width:17px;height:max(17px,1.1em);background-repeat:no-repeat;background-position:top left;display:inline-block;vertical-align:middle;opacity:.5;}details.rustdoc-toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.rustdoc-toggle>summary.hideme::after{content:"";}details.rustdoc-toggle>summary:focus::before,details.rustdoc-toggle>summary:hover::before{opacity:1;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-family:'Fira Sans';font-size:16px;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:3px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{width:17px;height:max(17px,1.1em);background-repeat:no-repeat;background-position:top left;display:inline-block;content:"";}details.rustdoc-toggle[open] >summary::after,details.rustdoc-toggle[open] >summary.hideme::after{content:"Collapse";}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;top:45px;bottom:0;width:246px;left:-246px;overflow-y:auto;border-right:1px solid;}.sidebar>.block.version{overflow:hidden;border-bottom:none;margin-bottom:0;height:100%;padding-left:12px;}.sidebar>.block.version>div.narrow-helper{float:left;width:1px;height:100%;}.sidebar>.block.version>p{margin:0;min-width:55px;display:flex;align-items:center;height:100%;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main,#search{margin-top:45px;padding:0;}#search{margin-left:0;}.anchor{display:none !important;}.theme-picker{left:10px;top:54px;z-index:1;}.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar.mobile>div.version{overflow:hidden;max-height:33px;}.sidebar{width:calc(100% + 30px);}.show-it,.sidebar-elems:focus-within{z-index:2;left:0;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main>details.rustdoc-toggle>summary::before,#main>div>details.rustdoc-toggle>summary::before{left:-11px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:block;}.item-row{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-container>div{width:calc(100% - 32px);}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}}@media print{nav.sub,.content .out-of-band{display:none;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main,#search{margin-top:100px;}#main>table:not(.table-display) td{word-break:break-word;width:50%;}.search-container>div{display:block;width:calc(100% - 37px);}#crate-search{width:100%;border-radius:4px;border:0;}#crate-search+.search-input{width:calc(100% + 71px);margin-left:-36px;}#theme-picker,#settings-menu{padding:5px;width:31px;height:31px;}#theme-picker{margin-top:-2px;}#settings-menu{top:7px;}.docblock{margin-left:12px;}.docblock code{overflow-wrap:anywhere;}}.scraped-example-title{font-family:'Fira Sans';}.scraped-example:not(.expanded) .code-wrapper pre.line-numbers{overflow:hidden;max-height:240px;}.scraped-example:not(.expanded) .code-wrapper .example-wrap pre.rust{overflow-y:hidden;max-height:240px;padding-bottom:0;}.scraped-example .code-wrapper .prev{position:absolute;top:0.25em;right:2.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .next{position:absolute;top:0.25em;right:1.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .expand{position:absolute;top:0.25em;right:0.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper:before{content:" ";width:100%;height:5px;position:absolute;z-index:100;top:0;background:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}.scraped-example:not(.expanded) .code-wrapper:after{content:" ";width:100%;height:5px;position:absolute;z-index:100;bottom:0;background:linear-gradient(to top,rgba(255,255,255,1),rgba(255,255,255,0));}.scraped-example:not(.expanded) .code-wrapper{overflow:hidden;max-height:240px;}.scraped-example .code-wrapper .line-numbers{margin:0;padding:14px 0;}.scraped-example .code-wrapper .line-numbers span{padding:0 14px;}.scraped-example .code-wrapper .example-wrap{flex:1;overflow-x:auto;overflow-y:hidden;margin-bottom:0;}.scraped-example .code-wrapper .example-wrap pre.rust{overflow-x:inherit;width:inherit;overflow-y:hidden;}.scraped-example .example-wrap .rust span.highlight{background:#fcffd6;}.scraped-example .example-wrap .rust span.highlight.focus{background:#f6fdb0;}.more-examples-toggle{margin-top:10px;}.more-examples-toggle summary{color:#999;font-family:'Fira Sans';}.more-scraped-examples{margin-left:25px;display:flex;flex-direction:row;width:calc(100% - 25px);}.more-scraped-examples-inner{width:calc(100% - 20px);}.toggle-line{align-self:stretch;margin-right:10px;margin-top:5px;padding:0 4px;cursor:pointer;}.toggle-line:hover .toggle-line-inner{background:#aaa;}.toggle-line-inner{min-width:2px;background:#ddd;height:100%;}.more-scraped-examples .scraped-example{margin-bottom:20px;}.more-scraped-examples .scraped-example:last-child{margin-bottom:0;}.example-links a{margin-top:20px;font-family:'Fira Sans';}.example-links ul{margin-bottom:0;}details.undocumented[open] >summary::before,details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{background-image:url(toggle-minus.svg);}details.undocumented>summary::before,details.rustdoc-toggle>summary::before{background-image:url(toggle-plus.svg);} \ No newline at end of file diff --git a/doc/search-index.js b/doc/search-index.js index 7ceee3c..76eb541 100644 --- a/doc/search-index.js +++ b/doc/search-index.js @@ -1,4 +1,4 @@ var searchIndex = JSON.parse('{\ -"draught":{"doc":"Draught","t":[5,0,0,0,5,14,14,0,0,3,3,3,3,17,17,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,12,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,13,13,13,13,13,13,13,13,13,4,4,13,13,13,13,4,4,4,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,12,12,12,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,12,12,11,12,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,17,17,17,17,17,17,17,17,17,3,17,17,17,17,17,17,12,12,12,11,11,12,12,11,11,12,11,11,11,11,11,12,11,11,11,12,11,11,11,12,12,12,11,11,11,11,12,12,12,11,11,11,11,12,11,11,11,11,11,12,12,12,12,5],"n":["__wasm_bindgen_generated_init_wasm","board","comp","game","init_wasm","log","log_error","paint","utils","Board","BrdIdx","Direction","Piece","STD_HEIGHT","STD_WIDTH","Square","adjacent_dir","adjacent_indices","apply_jump","apply_move","board_index","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_move","cell","cell_idx","cell_index","cell_mut","cell_state","cells","cells","check_jumpee_team","check_kinged","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","col","current_turn","describe","describe","describe","describe","empty","empty","enums","eq","eq","eq","eq","eq","eq","filter_indices","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_abi","from_abi","from_abi","from_abi","grid_cell","height","idx_diffs","init_game","into","into","into","into","into","into_abi","into_abi","into_abi","into_abi","is_none","is_none","is_none","is_none","iter","jumpable_dir","jumpable_indices","jumpee_idx","king_row_idx","ne","ne","ne","ne","ne","ne","new","new","new","none","none","none","none","num_cells","num_pieces","num_player","nw","occupant","pc","player_adjacent_indices","player_jumpable_indices","ref_from_abi","ref_from_abi","ref_from_abi","ref_from_abi","ref_mut_from_abi","ref_mut_from_abi","ref_mut_from_abi","ref_mut_from_abi","return_abi","return_abi","return_abi","return_abi","row","score","se","set_cell","state","strength","sw","team","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unplay","validate_jumpee","validate_king_move","validate_man_move","vzip","vzip","vzip","vzip","vzip","width","Allowed","Black","Empty","IllegalTrajectory","Jump","JumpingSameTeam","King","Man","Move","MoveType","Moveable","NoJumpablePiece","Occupied","OccupiedDest","OutOfBounds","SquareState","Strength","Team","UnoccupiedSrc","Unplayable","Unplayable","White","WrongTeamSrc","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","describe","describe","describe","describe","describe","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_abi","from_abi","from_abi","from_abi","from_abi","into","into","into","into","into","into_abi","into_abi","into_abi","into_abi","into_abi","is_none","is_none","is_none","is_none","is_none","none","none","none","none","none","opponent","return_abi","return_abi","return_abi","return_abi","return_abi","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","PieceIterator","RowIndexIterator","RowSquareIterator","board","board","board","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","from","from","from","index_cursor","index_iter","into","into","into","into_iter","into_iter","into_iter","new","new","new","next","next","next","row_cursor","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","BoardNode","Computer","Move","available_turns","best_score","board","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","brd","clone","clone","clone_into","clone_into","eq","eq","expand_layer","expand_node","fmt","fmt","fmt","from","from","from","from","gen_tree","get_leaf_nodes","get_move","get_move_boards","insert_board_scores","insert_boards","into","into","into","last_node_count","mv_type","ne","ne","new","new","new","perfect_chance","propagate_scores","random_choice","score","search_depth","team","to","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","Game","ai_move","borrow","borrow_mut","clear_selected","current","current_board","current_board_cells","current_board_len","current_cell_state","current_turn","describe","draw","execute_jump","execute_move","fmt","fmt","from","from_abi","has_won","into","into_abi","is_none","last_node_count","make_move","new","new_with_canvas","none","painter","perfect_chance","previous_board","previous_boards","push_new_board","ref_from_abi","ref_mut_from_abi","return_abi","score","search_depth","selected_piece","set_current","set_painter","set_perfect_chance","set_search_depth","set_selected","to_string","try_from","try_into","type_id","vzip","winning","BLACK_PIECE","BLACK_PIECE_OUTLINE","BLACK_SQUARE","DRAW_OUTLINE","DRAW_PIECE_OUTLINES","KING_OUTLINE","OUTLINE_WIDTH","PIECE_OUTLINE_PROPORTION","PIECE_PROPORTION","Painter","SELECTED_PIECE","SELECTED_PIECE_OUTLINE","SQUARE_OUTLINE","WHITE_PIECE","WHITE_PIECE_OUTLINE","WHITE_SQUARE","black_piece","black_piece_line","black_square","borrow","borrow_mut","canvas","context","describe","draw","draw_outline","fmt","from","from_abi","get_canvas","get_canvas_context","height","into","into_abi","is_none","king_line","new","new_with_canvas","none","outline_width","piece_line_proportion","piece_lines","ref_from_abi","ref_mut_from_abi","reset_dimensions","return_abi","selected_idx","selected_piece","selected_piece_line","set_draw_outline","set_outline_width","set_selected","set_square_outline","square_outline","try_from","try_into","type_id","validate_board_dim","vzip","white_piece","white_piece_line","white_square","width","set_panic_hook"],"q":["draught","","","","","","","","","draught::board","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::board::enums","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::board::iter","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::comp","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::game","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::paint","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::utils"],"d":["","Board module for components related to the checkers board …","AI player logic","Top-level object for managing [Board]s, applying and …","","Wrap the [web_sys] access to the browser console in a …","","Components for painting board states onto HTML canvases","","Single state of a checkers board","Rank 2 tensor index to identify a board square by row and …","Standard diagonal movements given by north west/east etc","Game piece given by its team and strength (normal or …","Standard height of a checkers board is 8 squares","Standard width of a checkers board is 8 squares","Board squares given by a state and a possible occupying …","Get a [Direction] structure for the diagonally adjacent …","Get the 1D array indices for the diagonally adjacent …","Get new board derived from current with given jump applied","Get new board derived from current with given move applied","Transform a 1D array index (for [Board::cells]) into a 2D …","","","","","","","","","","","Check whether a move given by source and destination …","Get a copy of a board square by 1D array index","Similar to [Board::cell_index] but with a [BrdIdx] …","Transform a 2D row/column board index into a single 1D …","Get a mutable reference to a board square by 1D array …","Get the state of a board square by 1D array index","Get a pointer to the backing array of board squares, […","1D backing array of board squares for the 2D game board","Check that the source piece and the jumpee are of …","Check and apply king strength","","","","","","","","","","","","","","","","","Create an empty direction full of [Option::None]","Helper function for a well-formed empty square","","","","","","","","Filter an array of diagonal indices (Like those from […","","","","","","","","","","","","","","","","","","Get a copy of a board square by 2D [BrdIdx] index","","Get the difference between two [BrdIdx] objects","Reset the given board to a starting layout with 3 rows of …","","","","","","","","","","","","","","","Get a [Direction] structure for the diagonally jumpable …","Get the 1D array indices for the diagonally jumpable …","Get cell index of jumpee square given from and to …","Get row index for current team, top row for black, bottom …","","","","","","North East","","Standard constructor function to form square from state …","Initialise a game board without game pieces","","","","","Get the number of board squares","Get the number of remaining pieces","Get the number of remaining pieces for a player","North West ","Game piece if square is occupied","Helper function for a well-formed piece square by team …","","","","","","","","","","","","","","","","Get the score value, Black - White pieces","South East","Get a copy of a board square by 1D array index","Description of whether the square is occupied or an …","","South West","","","","","","","","","","","","","","","","","","","","","","","","Helper function for a well-formed unplayable square","Unwrap the jumpee piece from the square and […","Check that given move trajectory is valid for a king …","Check that given move trajectory is valid for a man piece ","","","","","","","","","","","","","","","","Move/Jump, for use in Move","Possible outcomes of trying to move","","","","","Model board square as Empty/Occupied/Unplayable","Man/King","Black/White","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get opposing team","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get next item from the iterator","Get next item from the iterator","Get next item from the iterator","","","","","","","","","","","","","","For storing boards in the AI tree, stores board with …","Root-level structure for managing the game as a …","Represents a move by source/destination indices and the …","Get vector of available moves for a given board","Get best of given scores for given team","","","","","","","","","","","","","","","Expand all given nodes and return newly inserted layer of …","Insert all possible next boards as children of given …","","","","","","","","Generate tree of boards to given search depth, return …","Traverse tree from given root ID and get NodeIDs of leaf …","Get a new board based on the given using MiniMax to make …","Get all possible next boards from given board","For given NodeIDs, insert score of board into tree Used …","Insert given boards into tree","","","","","","","","","","","","Propagate scores up the tree employing MiniMax algorithm","Get a random board from possible node IDs and associated …","","","","","","","","","","","","","","","","","","","Root-level structure for managing the game as a …","Create computer, get move from current board and update …","","","Clear currently selected piece","","Set current board to given","Get pointer to current board’s squares","Get pointer to current board’s squares","Get square on current board for given index","Current turn’s team","","Draw current board using painter if exists","Update board state with given jump move and push new …","Update board state with given move and push new board …","","","","","Check if a player has won","","","","","Attempt to make a move given a source and destination …","Get new game without board renderer","Get a new game with canvas ID and dimensions","","","","Get a read-only copy of a previous turn’s board","","Push current board into the previous turns and set given …","","","","Current board’s score","","","Set current board to given","Set painter for rendering boards","Set proportion of perfect moves from AI","Set tree depth for AI to search to","Set given index as selected piece TODO: Check whether …","","","","","","Get currently winning player","Default hex colour value for black pieces","Default hex colour value for black piece outline","Default hex colour value for black square background","Whether to outline black squares","Whether to outline pieces","Default hex colour value for black piece outline","Line width when outlining black squares as proportion of …","Line width for outlining pieces as proportion of piece …","Proportion of square that piece fills as proportion of …","Used to paint boards onto HTML canvases","Default hex colour value for selected piece","Default hex colour value for selected piece outline","Default hex colour value for outline of black squares","Default hex colour value for white pieces","Default hex colour value for white piece outline","Default hex colour value for white square background","","","","","","","","","Draw a board onto the canvas","","","","","Get a canvas by element ID","Get a 2D canvas context for a given canvas","","","","","","Default constructor which queries for canvas by ID","Constructor with given canvas element","","","","","","","Reset the canvas dimensions to the given width and height","","","","","Set whether squares are outlined","Set new line width for outlining squares","Set selected piece by board index","Set new square outline colour value","","","","","Check whether given canvas dimensions divide evenly by …","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,3,4,5,1,2,3,4,5,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5,1,2,3,4,5,1,5,1,2,4,5,1,3,4,0,2,3,4,5,5,1,1,2,3,4,5,5,1,1,2,3,4,5,5,1,2,4,5,1,1,1,1,1,2,3,4,5,1,2,4,5,1,2,4,5,1,0,1,1,1,1,2,3,4,5,1,3,2,4,1,2,4,5,1,1,1,1,3,4,4,1,1,2,4,5,1,2,4,5,1,2,4,5,1,5,1,3,1,4,2,3,2,2,3,4,5,1,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,4,1,1,1,2,3,4,5,1,1,6,7,8,6,9,6,10,10,9,0,0,6,8,6,6,0,0,0,6,8,6,7,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,7,10,8,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,7,9,7,10,8,6,9,7,10,8,6,7,8,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,0,0,0,11,12,13,11,12,13,11,12,13,11,12,13,13,12,11,12,13,11,12,13,11,12,13,11,12,13,11,11,12,13,11,12,13,11,12,13,11,12,13,0,0,0,14,14,15,16,15,14,16,15,14,15,16,15,16,15,16,15,14,14,16,15,14,16,15,14,16,14,14,14,14,14,14,16,15,14,14,16,16,15,16,15,14,14,14,14,15,14,14,16,16,15,16,15,14,16,15,14,16,15,14,16,15,14,0,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,0],"f":[[[]],null,null,null,[[]],null,null,null,null,null,null,null,null,null,null,null,[[["brdidx",3]],[["direction",3],["option",4]]],[[["brdidx",3]],[["option",4],["vec",3]]],[[["brdidx",3]],["board",3]],[[["brdidx",3]],["board",3]],[[["usize",15]],["brdidx",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["brdidx",3]],["moveable",4]],[[["usize",15]],["square",3]],[[["brdidx",3]],["usize",15]],[[["usize",15]],["usize",15]],[[["usize",15]],["square",3]],[[["usize",15]],["squarestate",4]],[[]],null,[[["piece",3]],["bool",15]],[[["board",3],["brdidx",3]]],[[],["piece",3]],[[],["direction",3]],[[],["square",3]],[[],["brdidx",3]],[[],["board",3]],[[]],[[]],[[]],[[]],[[]],null,null,[[]],[[]],[[]],[[]],[[],["direction",3]],[[],["square",3]],null,[[["piece",3]],["bool",15]],[[["direction",3]],["bool",15]],[[["square",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["board",3]],["bool",15]],[[["team",4],["vec",3],["brdidx",3],["usize",15]],[["vec",3],["usize",15]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[["usize",15]],["brdidx",3]],[[]],[[]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["brdidx",3]],["square",3]],null,[[["brdidx",3]]],[[["board",3],["usize",15]],["board",3]],[[]],[[]],[[]],[[]],[[]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],null,[[["brdidx",3]],[["direction",3],["option",4]]],[[["brdidx",3]],[["option",4],["vec",3]]],[[["brdidx",3]],["usize",15]],[[],["usize",15]],[[["piece",3]],["bool",15]],[[["direction",3]],["bool",15]],[[["square",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["board",3]],["bool",15]],null,[[["team",4],["strength",4]],["piece",3]],[[["option",4],["squarestate",4],["piece",3]],["square",3]],[[["team",4],["usize",15]],["board",3]],[[]],[[]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[["team",4]],["usize",15]],null,null,[[["team",4],["strength",4]],["square",3]],[[["team",4],["brdidx",3]],[["option",4],["vec",3]]],[[["team",4],["brdidx",3]],[["option",4],["vec",3]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,[[],["isize",15]],null,[[["usize",15],["square",3]]],null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["square",3]],[[["square",3],["piece",3]],["moveable",4]],[[["brdidx",3],["piece",3]],["moveable",4]],[[["brdidx",3],["piece",3]],["moveable",4]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["movetype",4]],[[],["team",4]],[[],["strength",4]],[[],["squarestate",4]],[[],["moveable",4]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["movetype",4]],["bool",15]],[[["team",4]],["bool",15]],[[["strength",4]],["bool",15]],[[["squarestate",4]],["bool",15]],[[["moveable",4]],["bool",15]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[]],[[]],[[]],[[]],[[]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["team",4]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[["board",3]]],[[["board",3]]],[[["board",3]]],[[],[["option",4],["vec",3]]],[[],[["option",4],["vec",3]]],[[],["option",4]],null,[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],null,null,null,[[["board",3]],[["move",3],["vec",3]]],[[["isize",15],["board",3],["vec",3]],["isize",15]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[["board",3]],["boardnode",3]],[[],["move",3]],[[],["boardnode",3]],[[]],[[]],[[["move",3]],["bool",15]],[[["boardnode",3]],["bool",15]],[[["arena",3],["nodeid",3],["vec",3]],[["nodeid",3],["vec",3]]],[[["arena",3],["nodeid",3]],[["nodeid",3],["vec",3]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],null,[[["arena",3],["board",3]],["nodeid",3]],[[["arena",3],["nodeid",3]],[["nodeid",3],["vec",3]]],[[["board",3]],[["option",4],["board",3]]],[[["boardnode",3]],[["boardnode",3],["vec",3]]],[[["arena",3],["nodeid",3],["vec",3]]],[[["boardnode",3],["arena",3],["vec",3]],[["nodeid",3],["vec",3]]],[[]],[[]],[[]],null,null,[[["move",3]],["bool",15]],[[["boardnode",3]],["bool",15]],[[["movetype",4],["brdidx",3]],["move",3]],[[["isize",15],["board",3]],["boardnode",3]],[[["team",4],["usize",15],["f64",15]],["computer",3]],null,[[["arena",3],["boardnode",3],["nodeid",3]],[["arena",3],["boardnode",3]]],[[["threadrng",3],["arena",3],["nodeid",3],["vec",3]],["board",3]],null,null,null,null,[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],null,[[]],[[]],[[]],[[]],null,[[],["board",3]],[[]],[[],["usize",15]],[[["brdidx",3]],["square",3]],[[],["team",4]],[[]],[[]],[[["brdidx",3]]],[[["brdidx",3]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[["u32",15]]],[[],[["option",4],["team",4]]],[[]],[[],["u32",15]],[[],["bool",15]],null,[[["brdidx",3]],["moveable",4]],[[["team",4],["usize",15]],["game",3]],[[["str",15],["team",4],["usize",15],["u32",15]],["game",3]],[[]],null,null,[[["usize",15]],["board",3]],null,[[["board",3]]],[[]],[[]],[[]],[[],["isize",15]],null,null,[[["board",3]]],[[["painter",3]]],[[["f64",15]]],[[["usize",15]]],[[["brdidx",3]]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],[["option",4],["team",4]]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],null,null,[[]],[[["board",3]]],null,[[["formatter",3]],["result",6]],[[]],[[["u32",15]]],[[["str",15]],["htmlcanvaselement",3]],[[["htmlcanvaselement",3]],["canvasrenderingcontext2d",3]],null,[[]],[[],["u32",15]],[[],["bool",15]],null,[[["u32",15],["str",15]],["painter",3]],[[["u32",15],["htmlcanvaselement",3]],["painter",3]],[[]],null,null,null,[[]],[[]],[[]],[[]],null,null,null,[[["bool",15]]],[[["f64",15]]],[[["option",4]]],[[["jsvalue",3]]],null,[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[["board",3]],["bool",15]],[[]],null,null,null,null,[[]]],"p":[[3,"Board"],[3,"Piece"],[3,"Direction"],[3,"Square"],[3,"BrdIdx"],[4,"Moveable"],[4,"Team"],[4,"SquareState"],[4,"MoveType"],[4,"Strength"],[3,"RowIndexIterator"],[3,"RowSquareIterator"],[3,"PieceIterator"],[3,"Computer"],[3,"BoardNode"],[3,"Move"],[3,"Game"],[3,"Painter"]]}\ +"draught":{"doc":"Draught","t":[17,0,0,0,5,14,14,0,0,3,3,3,3,17,17,3,17,17,17,17,17,17,17,17,17,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,12,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,13,13,13,13,13,13,13,13,13,4,4,13,13,13,13,4,4,4,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,12,12,12,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,17,17,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,12,12,11,12,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,17,17,17,17,17,17,17,17,17,3,17,17,17,17,17,17,12,12,12,11,11,12,12,11,11,12,11,11,11,11,11,12,11,11,11,12,11,11,11,12,12,12,11,11,11,11,12,12,12,11,11,11,11,12,11,11,11,11,11,12,12,12,12,5],"n":["__wasm_bindgen_generated_init_wasm__const","board","comp","game","init_wasm","log","log_error","paint","utils","Board","BrdIdx","Direction","Piece","STD_HEIGHT","STD_WIDTH","Square","__wbg_get_board_current_turn__const","__wbg_get_board_height__const","__wbg_get_board_width__const","__wbg_get_brdidx_col__const","__wbg_get_brdidx_row__const","__wbg_get_piece_strength__const","__wbg_get_piece_team__const","__wbg_get_square_occupant__const","__wbg_get_square_state__const","adjacent_dir","adjacent_indices","apply_jump","apply_move","board_index","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","can_move","cell","cell_idx","cell_index","cell_mut","cell_state","cells","cells","check_jumpee_team","check_kinged","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","col","current_turn","describe","describe","describe","describe","empty","empty","enums","eq","eq","eq","eq","eq","eq","filter_indices","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_abi","from_abi","from_abi","from_abi","grid_cell","height","idx_diffs","init_game","into","into","into","into","into","into_abi","into_abi","into_abi","into_abi","is_none","is_none","is_none","is_none","iter","jumpable_dir","jumpable_indices","jumpee_idx","king_row_idx","ne","ne","ne","ne","ne","ne","new","new","new","none","none","none","none","num_cells","num_pieces","num_player","nw","occupant","pc","player_adjacent_indices","player_jumpable_indices","ref_from_abi","ref_from_abi","ref_from_abi","ref_from_abi","ref_mut_from_abi","ref_mut_from_abi","ref_mut_from_abi","ref_mut_from_abi","return_abi","return_abi","return_abi","return_abi","row","score","se","set_cell","state","strength","sw","team","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unplay","validate_jumpee","validate_king_move","validate_man_move","vzip","vzip","vzip","vzip","vzip","width","Allowed","Black","Empty","IllegalTrajectory","Jump","JumpingSameTeam","King","Man","Move","MoveType","Moveable","NoJumpablePiece","Occupied","OccupiedDest","OutOfBounds","SquareState","Strength","Team","UnoccupiedSrc","Unplayable","Unplayable","White","WrongTeamSrc","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","describe","describe","describe","describe","describe","eq","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_abi","from_abi","from_abi","from_abi","from_abi","into","into","into","into","into","into_abi","into_abi","into_abi","into_abi","into_abi","is_none","is_none","is_none","is_none","is_none","none","none","none","none","none","opponent","return_abi","return_abi","return_abi","return_abi","return_abi","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","PieceIterator","RowIndexIterator","RowSquareIterator","board","board","board","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","from","from","from","index_cursor","index_iter","into","into","into","into_iter","into_iter","into_iter","new","new","new","next","next","next","row_cursor","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","BoardNode","Computer","Move","available_turns","best_score","board","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","brd","clone","clone","clone_into","clone_into","eq","eq","expand_layer","expand_node","fmt","fmt","fmt","from","from","from","from","gen_tree","get_leaf_nodes","get_move","get_move_boards","insert_board_scores","insert_boards","into","into","into","last_node_count","mv_type","ne","ne","new","new","new","perfect_chance","propagate_scores","random_choice","score","search_depth","team","to","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","Game","__wbg_get_game_last_node_count__const","__wbg_get_game_perfect_chance__const","ai_move","borrow","borrow_mut","clear_selected","current","current_board","current_board_cells","current_board_len","current_cell_state","current_turn","describe","draw","execute_jump","execute_move","fmt","fmt","from","from_abi","has_won","into","into_abi","is_none","last_node_count","make_move","new","new_with_canvas","none","painter","perfect_chance","previous_board","previous_boards","push_new_board","ref_from_abi","ref_mut_from_abi","return_abi","score","search_depth","selected_piece","set_current","set_painter","set_perfect_chance","set_search_depth","set_selected","to_string","try_from","try_into","type_id","vzip","winning","BLACK_PIECE","BLACK_PIECE_OUTLINE","BLACK_SQUARE","DRAW_OUTLINE","DRAW_PIECE_OUTLINES","KING_OUTLINE","OUTLINE_WIDTH","PIECE_OUTLINE_PROPORTION","PIECE_PROPORTION","Painter","SELECTED_PIECE","SELECTED_PIECE_OUTLINE","SQUARE_OUTLINE","WHITE_PIECE","WHITE_PIECE_OUTLINE","WHITE_SQUARE","black_piece","black_piece_line","black_square","borrow","borrow_mut","canvas","context","describe","draw","draw_outline","fmt","from","from_abi","get_canvas","get_canvas_context","height","into","into_abi","is_none","king_line","new","new_with_canvas","none","outline_width","piece_line_proportion","piece_lines","ref_from_abi","ref_mut_from_abi","reset_dimensions","return_abi","selected_idx","selected_piece","selected_piece_line","set_draw_outline","set_outline_width","set_selected","set_square_outline","square_outline","try_from","try_into","type_id","validate_board_dim","vzip","white_piece","white_piece_line","white_square","width","set_panic_hook"],"q":["draught","","","","","","","","","draught::board","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::board::enums","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::board::iter","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::comp","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::game","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::paint","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","draught::utils"],"d":["","Board module for components related to the checkers board …","AI player logic","Top-level object for managing Boards, applying and …","","Wrap the web_sys access to the browser console in a macro …","","Components for painting board states onto HTML canvases","","Single state of a checkers board","Rank 2 tensor index to identify a board square by row and …","Standard diagonal movements given by north west/east etc","Game piece given by its team and strength (normal or …","Standard height of a checkers board is 8 squares","Standard width of a checkers board is 8 squares","Board squares given by a state and a possible occupying …","","","","","","","","","","Get a Direction structure for the diagonally adjacent …","Get the 1D array indices for the diagonally adjacent …","Get new board derived from current with given jump applied","Get new board derived from current with given move applied","Transform a 1D array index (for Board::cells) into a 2D …","","","","","","","","","","","Check whether a move given by source and destination …","Get a copy of a board square by 1D array index","Similar to Board::cell_index but with a BrdIdx instead of …","Transform a 2D row/column board index into a single 1D …","Get a mutable reference to a board square by 1D array index","Get the state of a board square by 1D array index","Get a pointer to the backing array of board squares, …","1D backing array of board squares for the 2D game board","Check that the source piece and the jumpee are of opposing …","Check and apply king strength","","","","","","","","","","","","","","","","","Create an empty direction full of Option::None","Helper function for a well-formed empty square","","","","","","","","Filter an array of diagonal indices (Like those from …","","","","","","","","","","","","","","","","","","Get a copy of a board square by 2D BrdIdx index","","Get the difference between two BrdIdx objects","Reset the given board to a starting layout with 3 rows of …","","","","","","","","","","","","","","","Get a Direction structure for the diagonally jumpable …","Get the 1D array indices for the diagonally jumpable …","Get cell index of jumpee square given from and to locations","Get row index for current team, top row for black, bottom …","","","","","","North East","","Standard constructor function to form square from state …","Initialise a game board without game pieces","","","","","Get the number of board squares","Get the number of remaining pieces","Get the number of remaining pieces for a player","North West ","Game piece if square is occupied","Helper function for a well-formed piece square by team and …","","","","","","","","","","","","","","","","Get the score value, Black - White pieces","South East","Get a copy of a board square by 1D array index","Description of whether the square is occupied or an …","","South West","","","","","","","","","","","","","","","","","","","","","","","","Helper function for a well-formed unplayable square","Unwrap the jumpee piece from the square and …","Check that given move trajectory is valid for a king piece ","Check that given move trajectory is valid for a man piece ","","","","","","","","","","","","","","","","Move/Jump, for use in Move","Possible outcomes of trying to move","","","","","Model board square as Empty/Occupied/Unplayable","Man/King","Black/White","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get opposing team","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get next item from the iterator","Get next item from the iterator","Get next item from the iterator","","","","","","","","","","","","","","For storing boards in the AI tree, stores board with score …","Root-level structure for managing the game as a collection …","Represents a move by source/destination indices and the …","Get vector of available moves for a given board","Get best of given scores for given team","","","","","","","","","","","","","","","Expand all given nodes and return newly inserted layer of …","Insert all possible next boards as children of given board …","","","","","","","","Generate tree of boards to given search depth, return root …","Traverse tree from given root ID and get NodeIDs of leaf …","Get a new board based on the given using MiniMax to make …","Get all possible next boards from given board","For given NodeIDs, insert score of board into tree Used …","Insert given boards into tree","","","","","","","","","","","","Propagate scores up the tree employing MiniMax algorithm","Get a random board from possible node IDs and associated …","","","","","","","","","","","","","","","","","","","Root-level structure for managing the game as a collection …","","","Create computer, get move from current board and update …","","","Clear currently selected piece","","Set current board to given","Get pointer to current board’s squares","Get pointer to current board’s squares","Get square on current board for given index","Current turn’s team","","Draw current board using painter if exists","Update board state with given jump move and push new board …","Update board state with given move and push new board into …","","","","","Check if a player has won","","","","","Attempt to make a move given a source and destination index","Get new game without board renderer","Get a new game with canvas ID and dimensions","","","","Get a read-only copy of a previous turn’s board","","Push current board into the previous turns and set given …","","","","Current board’s score","","","Set current board to given","Set painter for rendering boards","Set proportion of perfect moves from AI","Set tree depth for AI to search to","Set given index as selected piece TODO: Check whether …","","","","","","Get currently winning player","Default hex colour value for black pieces","Default hex colour value for black piece outline","Default hex colour value for black square background","Whether to outline black squares","Whether to outline pieces","Default hex colour value for black piece outline","Line width when outlining black squares as proportion of …","Line width for outlining pieces as proportion of piece …","Proportion of square that piece fills as proportion of min …","Used to paint boards onto HTML canvases","Default hex colour value for selected piece","Default hex colour value for selected piece outline","Default hex colour value for outline of black squares","Default hex colour value for white pieces","Default hex colour value for white piece outline","Default hex colour value for white square background","","","","","","","","","Draw a board onto the canvas","","","","","Get a canvas by element ID","Get a 2D canvas context for a given canvas","","","","","","Default constructor which queries for canvas by ID","Constructor with given canvas element","","","","","","","Reset the canvas dimensions to the given width and height","","","","","Set whether squares are outlined","Set new line width for outlining squares","Set selected piece by board index","Set new square outline colour value","","","","","Check whether given canvas dimensions divide evenly by …","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,3,4,5,1,2,3,4,5,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5,1,2,3,4,5,1,5,1,2,4,5,1,3,4,0,2,3,4,5,5,1,1,2,3,4,5,5,1,1,2,3,4,5,5,1,2,4,5,1,1,1,1,1,2,3,4,5,1,2,4,5,1,2,4,5,1,0,1,1,1,1,2,3,4,5,1,3,2,4,1,2,4,5,1,1,1,1,3,4,4,1,1,2,4,5,1,2,4,5,1,2,4,5,1,5,1,3,1,4,2,3,2,2,3,4,5,1,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,4,1,1,1,2,3,4,5,1,1,6,7,8,6,9,6,10,10,9,0,0,6,8,6,6,0,0,0,6,8,6,7,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,7,10,8,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,7,9,7,10,8,6,9,7,10,8,6,7,8,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,9,7,10,8,6,0,0,0,11,12,13,11,12,13,11,12,13,11,12,13,13,12,11,12,13,11,12,13,11,12,13,11,12,13,11,11,12,13,11,12,13,11,12,13,11,12,13,0,0,0,14,14,15,16,15,14,16,15,14,15,16,15,16,15,16,15,14,14,16,15,14,16,15,14,16,14,14,14,14,14,14,16,15,14,14,16,16,15,16,15,14,14,14,14,15,14,14,16,16,15,16,15,14,16,15,14,16,15,14,16,15,14,0,0,0,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,0],"f":[null,null,null,null,[[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[["brdidx",3]],["option",4,[["direction",3,[["square",3]]]]]],[[["brdidx",3]],["option",4,[["vec",3,[["usize",15]]]]]],[[["brdidx",3],["brdidx",3]],["board",3]],[[["brdidx",3],["brdidx",3]],["board",3]],[[["usize",15]],["brdidx",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["brdidx",3],["brdidx",3]],["moveable",4]],[[["usize",15]],["square",3]],[[["brdidx",3]],["usize",15]],[[["usize",15],["usize",15]],["usize",15]],[[["usize",15]],["square",3]],[[["usize",15]],["squarestate",4]],[[]],null,[[["piece",3],["piece",3]],["bool",15]],[[["board",3],["brdidx",3]]],[[],["piece",3]],[[],["direction",3]],[[],["square",3]],[[],["brdidx",3]],[[],["board",3]],[[]],[[]],[[]],[[]],[[]],null,null,[[]],[[]],[[]],[[]],[[],["direction",3]],[[],["square",3]],null,[[["piece",3]],["bool",15]],[[["direction",3]],["bool",15]],[[["square",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["board",3]],["bool",15]],[[["brdidx",3],["team",4],["vec",3,[["usize",15]]]],["vec",3,[["usize",15]]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[["usize",15],["usize",15]],["brdidx",3]],[[]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["brdidx",3]],["square",3]],null,[[["brdidx",3],["brdidx",3]]],[[["board",3],["usize",15]],["board",3]],[[]],[[]],[[]],[[]],[[]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],[[],["bool",15]],null,[[["brdidx",3]],["option",4,[["direction",3,[["square",3]]]]]],[[["brdidx",3]],["option",4,[["vec",3,[["usize",15]]]]]],[[["brdidx",3],["brdidx",3]],["usize",15]],[[],["usize",15]],[[["piece",3]],["bool",15]],[[["direction",3]],["bool",15]],[[["square",3]],["bool",15]],[[["brdidx",3]],["bool",15]],[[["board",3]],["bool",15]],null,[[["team",4],["strength",4]],["piece",3]],[[["squarestate",4],["option",4,[["piece",3]]]],["square",3]],[[["usize",15],["usize",15],["team",4]],["board",3]],[[]],[[]],[[]],[[]],[[],["usize",15]],[[],["usize",15]],[[["team",4]],["usize",15]],null,null,[[["team",4],["strength",4]],["square",3]],[[["brdidx",3],["team",4]],["option",4,[["vec",3,[["usize",15]]]]]],[[["brdidx",3],["team",4]],["option",4,[["vec",3,[["usize",15]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,[[],["isize",15]],null,[[["usize",15],["square",3]]],null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["square",3]],[[["square",3],["piece",3]],["moveable",4]],[[["brdidx",3],["brdidx",3],["piece",3]],["moveable",4]],[[["brdidx",3],["brdidx",3],["piece",3]],["moveable",4]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["movetype",4]],[[],["team",4]],[[],["strength",4]],[[],["squarestate",4]],[[],["moveable",4]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["movetype",4]],["bool",15]],[[["team",4]],["bool",15]],[[["strength",4]],["bool",15]],[[["squarestate",4]],["bool",15]],[[["moveable",4]],["bool",15]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[["u32",15]]],[[]],[[]],[[]],[[]],[[]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[],["u32",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[["u32",15]],["bool",15]],[[]],[[]],[[]],[[]],[[]],[[],["team",4]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],[[]],[[]],null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[["board",3]]],[[["board",3]]],[[["board",3]]],[[],["option",4,[["vec",3,[["usize",15]]]]]],[[],["option",4,[["vec",3,[["square",3]]]]]],[[],["option",4]],null,[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],null,null,null,[[["board",3]],["vec",3,[["move",3]]]],[[["board",3],["vec",3,[["isize",15]]]],["isize",15]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[["board",3]],["boardnode",3]],[[],["move",3]],[[],["boardnode",3]],[[]],[[]],[[["move",3]],["bool",15]],[[["boardnode",3]],["bool",15]],[[["arena",3],["vec",3,[["nodeid",3]]]],["vec",3,[["nodeid",3]]]],[[["arena",3],["nodeid",3]],["vec",3,[["nodeid",3]]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[]],[[]],null,[[["arena",3],["board",3]],["nodeid",3]],[[["arena",3],["nodeid",3]],["vec",3,[["nodeid",3]]]],[[["board",3]],["option",4,[["board",3]]]],[[["boardnode",3]],["vec",3,[["boardnode",3]]]],[[["arena",3],["vec",3,[["nodeid",3]]]]],[[["arena",3],["vec",3,[["boardnode",3]]]],["vec",3,[["nodeid",3]]]],[[]],[[]],[[]],null,null,[[["move",3]],["bool",15]],[[["boardnode",3]],["bool",15]],[[["brdidx",3],["brdidx",3],["movetype",4]],["move",3]],[[["board",3],["isize",15]],["boardnode",3]],[[["usize",15],["team",4],["f64",15]],["computer",3]],null,[[["arena",3,[["boardnode",3]]],["nodeid",3]],["arena",3,[["boardnode",3]]]],[[["arena",3],["vec",3,[["nodeid",3]]],["threadrng",3]],["board",3]],null,null,null,null,[[]],[[]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[]],[[]],[[]],null,null,null,[[]],[[]],[[]],[[]],null,[[],["board",3]],[[]],[[],["usize",15]],[[["brdidx",3]],["square",3]],[[],["team",4]],[[]],[[]],[[["brdidx",3],["brdidx",3]]],[[["brdidx",3],["brdidx",3]]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[]],[[["u32",15]]],[[],["option",4,[["team",4]]]],[[]],[[],["u32",15]],[[],["bool",15]],null,[[["brdidx",3],["brdidx",3]],["moveable",4]],[[["usize",15],["usize",15],["usize",15],["team",4],["usize",15]],["game",3]],[[["usize",15],["usize",15],["usize",15],["team",4],["usize",15],["str",15],["u32",15],["u32",15]],["game",3]],[[]],null,null,[[["usize",15]],["board",3]],null,[[["board",3]]],[[]],[[]],[[]],[[],["isize",15]],null,null,[[["board",3]]],[[["painter",3]]],[[["f64",15]]],[[["usize",15]]],[[["brdidx",3]]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[]],[[],["option",4,[["team",4]]]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[]],[[]],null,null,[[]],[[["board",3]]],null,[[["formatter",3]],["result",6]],[[]],[[["u32",15]]],[[["str",15]],["htmlcanvaselement",3]],[[["htmlcanvaselement",3]],["canvasrenderingcontext2d",3]],null,[[]],[[],["u32",15]],[[],["bool",15]],null,[[["u32",15],["u32",15],["str",15]],["painter",3]],[[["u32",15],["u32",15],["htmlcanvaselement",3]],["painter",3]],[[]],null,null,null,[[]],[[]],[[]],[[]],null,null,null,[[["bool",15]]],[[["f64",15]]],[[["option",4]]],[[["jsvalue",3]]],null,[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[["board",3]],["bool",15]],[[]],null,null,null,null,[[]]],"p":[[3,"Board"],[3,"Piece"],[3,"Direction"],[3,"Square"],[3,"BrdIdx"],[4,"Moveable"],[4,"Team"],[4,"SquareState"],[4,"MoveType"],[4,"Strength"],[3,"RowIndexIterator"],[3,"RowSquareIterator"],[3,"PieceIterator"],[3,"Computer"],[3,"BoardNode"],[3,"Move"],[3,"Game"],[3,"Painter"]]}\ }'); if (window.initSearch) {window.initSearch(searchIndex)}; \ No newline at end of file diff --git a/doc/search.js b/doc/search.js index b2fd05d..6f612fa 100644 --- a/doc/search.js +++ b/doc/search.js @@ -1 +1 @@ -(function(){var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function printTab(nb){if(nb===0||nb===1||nb===2){searchState.currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){elem.style.display=""}else{elem.style.display="none"}nb-=1})}function removeEmptyStringsFromArray(x){for(var i=0,len=x.length;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(hasOwnProperty(results,entry)){ar.push(results[entry])}}results=ar;var i,len,result;for(i=0,len=results.length;ib?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});for(i=0,len=results.length;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function getObjectNameFromId(id){if(typeof id==="number"){return searchIndex[id].name}return id}function checkGenerics(obj,val){var tmp_lev,elem_name;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=Object.create(null);var elength=object[GENERICS_DATA].length;for(var x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=Object.create(null);len=obj[GENERICS_DATA].length;for(x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}else{return 0}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){return obj[GENERICS_DATA].some(function(name){return name===val.name})}return false}lev_distance=Math.min(levenshtein(obj[NAME],val.name),lev_distance);if(lev_distance<=MAX_LEV_DISTANCE){lev_distance=Math.ceil((checkGenerics(obj,val)+lev_distance)/2)}else if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x0){var length=obj.type[INPUTS_DATA].length;for(var i=0;iOUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(var x=0,len=ret.length;xlength){return MAX_LEV_DISTANCE+1}for(var i=0;ilength){break}var lev_total=0;var aborted=false;for(var x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(aborted===false){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates){var aliases=[];var crateAliases=[];if(filterCrates!==undefined){if(ALIASES[filterCrates]&&ALIASES[filterCrates][query.search]){var query_aliases=ALIASES[filterCrates][query.search];var len=query_aliases.length;for(var i=0;iMAX_RESULTS){ret.others.pop()}};onEach(aliases,pushFunc);onEach(crateAliases,pushFunc)}var nSearchWords=searchWords.length;var i,it;var ty;var fullId;var returned;var in_args;var len;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0,len=inputs.length;i1?paths.length-1:1);var lev,j;for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=ty.id;if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||ty.normalizedName.indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=ty.normalizedName.indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1}else{lev+=1}}in_args=findArg(ty,valGenerics,false,typeFilter);returned=checkReturned(ty,valGenerics,false,typeFilter);lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};handleAliases(ret,query,filterCrates);return ret}function validateResult(name,path,keys,parent){for(var i=0,len=keys.length;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return}dst=dst[0];if(window.location.pathname===dst.pathname){searchState.hideResults();document.location.href=dst.href}};var mouseover_func=function(e){if(searchState.mouseMovedAfterSearch){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted")})});addClass(el,"highlighted")},20)}};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func})});searchState.input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(h_e){actives[current].push(h_e)});current+=1});var SHIFT=16;var CTRL=17;var ALT=18;var currentTab=searchState.currentTab;if(e.which===38){if(e.ctrlKey){printTab(currentTab>0?currentTab-1:2)}else{if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}e.preventDefault()}else if(e.which===40){if(e.ctrlKey){printTab(currentTab>1?0:currentTab+1)}else if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted")}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}e.preventDefault()}else if(e.which===13){if(actives[currentTab].length){var elem=actives[currentTab][0].getElementsByTagName("a")[0];document.location.href=elem.href}}else if([SHIFT,CTRL,ALT].indexOf(e.which)!==-1){}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted")}}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=window.rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=window.rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=window.rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var enumNameIdx=item.path.lastIndexOf("::");var enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=window.rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=window.rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\""}var output="";var duplicates={};var length=0;if(array.length>0){output="";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}length+=1;output+=""});output+="
"+""+(item.is_alias===true?(""+item.alias+"  - see "):"")+item.displayPath+""+name+""+""+""+item.desc+" 
"}else{output="
No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:
"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results){var search=searchState.outputElement();if(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText)){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click();return}var query=getQuery(searchState.input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"
";search.innerHTML=output;searchState.showResults(search);initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0,len=positions.length;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0,arrays_len=arrays.length;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0,len=queries.length;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnProperty(rawSearchIndex,elem.value)){return elem.value}return undefined}function search(e,forced){var params=searchState.getQueryStringParams();var query=getQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(forced!==true&&query.id===currentResults){if(query.query.length>0){searchState.putBackSearch(searchState.input)}return}searchState.title="Results for "+query.query+" - Rust";if(searchState.browserSupportsHistoryApi()){var newURL=getNakedUrl()+"?search="+encodeURIComponent(query.raw)+window.location.hash;if(!history.state&&!params.search){history.pushState(query,"",newURL)}else{history.replaceState(query,"",newURL)}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates))}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i,word;var currentIndex=0;var id=0;for(var crate in rawSearchIndex){if(!hasOwnProperty(rawSearchIndex,crate)){continue}var crateSize=0;searchWords.push(crate);var normalizedName=crate.indexOf("_")===-1?crate:crate.replace(/_/g,"");var crateRow={crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,parent:undefined,type:null,id:id,normalizedName:normalizedName,};id+=1;searchIndex.push(crateRow);currentIndex+=1;var itemTypes=rawSearchIndex[crate].t;var itemNames=rawSearchIndex[crate].n;var itemPaths=rawSearchIndex[crate].q;var itemDescs=rawSearchIndex[crate].d;var itemParentIdxs=rawSearchIndex[crate].i;var itemFunctionSearchTypes=rawSearchIndex[crate].f;var paths=rawSearchIndex[crate].p;var aliases=rawSearchIndex[crate].a;var len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:itemFunctionSearchTypes[i],id:id,normalizedName:normalizedName,};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]={};var j,local_aliases;for(var alias_name in aliases){if(!aliases.hasOwnProperty(alias_name)){continue}if(!ALIASES[crate].hasOwnProperty(alias_name)){ALIASES[crate][alias_name]=[]}local_aliases=aliases[alias_name];for(j=0,len=local_aliases.length;j0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=function(){var qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}index=buildIndex(rawSearchIndex);registerSearchEvents();if(searchState.getQueryStringParams().search){search()}};if(window.searchIndex!==undefined){initSearch(window.searchIndex)}})() \ No newline at end of file +(function(){var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function printTab(nb){if(nb===0||nb===1||nb===2){searchState.currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){addClass(elem,"active")}else{removeClass(elem,"active")}nb-=1})}function removeEmptyStringsFromArray(x){for(var i=0,len=x.length;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(hasOwnPropertyRustdoc(results,entry)){ar.push(results[entry])}}results=ar;var i,len,result;for(i=0,len=results.length;ib?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});for(i=0,len=results.length;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function checkGenerics(obj,val){var tmp_lev,elem_name;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=Object.create(null);var elength=obj[GENERICS_DATA].length;for(var x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length>0){var elems=Object.create(null);len=obj[GENERICS_DATA].length;for(x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length!==0){tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}}}else if(literalSearch){if((!val.generics||val.generics.length===0)&&obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){return obj[GENERICS_DATA].some(function(gen){return gen[NAME]===val.name})}return false}lev_distance=Math.min(levenshtein(obj[NAME],val.name),lev_distance);if(lev_distance<=MAX_LEV_DISTANCE){lev_distance=Math.ceil((checkGenerics(obj,val)+lev_distance)/2)}if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x0){var length=obj.type[INPUTS_DATA].length;for(var i=0;iOUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(var x=0,len=ret.length;xlength){return MAX_LEV_DISTANCE+1}for(var i=0;ilength){break}var lev_total=0;var aborted=false;for(var x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates){var aliases=[];var crateAliases=[];if(filterCrates!==undefined){if(ALIASES[filterCrates]&&ALIASES[filterCrates][query.search]){var query_aliases=ALIASES[filterCrates][query.search];var len=query_aliases.length;for(var i=0;iMAX_RESULTS){ret.others.pop()}};onEach(aliases,pushFunc);onEach(crateAliases,pushFunc)}var nSearchWords=searchWords.length;var i,it;var ty;var fullId;var returned;var in_args;var len;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0,len=inputs.length;i1?paths.length-1:1);var lev,j;for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=ty.id;if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||ty.normalizedName.indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=ty.normalizedName.indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)){lev+=1}else{lev=MAX_LEV_DISTANCE+1}}in_args=findArg(ty,valGenerics,false,typeFilter);returned=checkReturned(ty,valGenerics,false,typeFilter);lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(typePassesFilter(typeFilter,ty.ty)&&(index!==-1||lev<=MAX_LEV_DISTANCE)){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results,false),};handleAliases(ret,query,filterCrates);return ret}function validateResult(name,path,keys,parent){for(var i=0,len=keys.length;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function nextTab(direction){var next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){var target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=window.rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=window.rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=window.rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var enumNameIdx=item.path.lastIndexOf("::");var enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=window.rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=window.rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraClass="";if(display===true){extraClass=" active"}var output=document.createElement("div");var duplicates={};var length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(function(item){if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}var name=item.name;var type=itemTypes[item.ty];length+=1;var extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}var link=document.createElement("a");link.className="result-"+type;link.href=item.href;var wrapper=document.createElement("div");var resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){var alias=document.createElement("span");alias.className="alias";var bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);var description=document.createElement("div");description.className="desc";var spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else{output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first){var search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText))){var elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}var query=getQuery(searchState.input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
";var resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;search.appendChild(resultsElem);searchState.focusedByTab=[null,null,null];searchState.showResults(search);var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0,len=positions.length;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0,arrays_len=arrays.length;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}function tokenizeQuery(raw){var i,matched;var l=raw.length;var depth=0;var nextAngle=/(<|>)/g;var ret=[];var start=0;for(i=0;i'){depth+=1}break;case">":if(depth>0){depth-=1}break;case",":if(depth===0){ret.push(raw.substring(start,i));start=i+1}break}}if(start!==i){ret.push(raw.substring(start,i))}return ret}var queries=tokenizeQuery(query.raw);var results={"in_args":[],"returned":[],"others":[],};for(var i=0,len=queries.length;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return undefined}function search(e,forced){var params=searchState.getQueryStringParams();var query=getQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(!forced&&query.id===currentResults){if(query.query.length>0){searchState.putBackSearch(searchState.input)}return}searchState.title="Results for "+query.query+" - Rust";if(searchState.browserSupportsHistoryApi()){var newURL=getNakedUrl()+"?search="+encodeURIComponent(query.raw)+window.location.hash;if(!history.state&&!params.search){history.pushState(query,"",newURL)}else{history.replaceState(query,"",newURL)}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates),params.go_to_first)}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i,word;var currentIndex=0;var id=0;for(var crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}var crateSize=0;searchWords.push(crate);var crateRow={crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),};id+=1;searchIndex.push(crateRow);currentIndex+=1;var itemTypes=rawSearchIndex[crate].t;var itemNames=rawSearchIndex[crate].n;var itemPaths=rawSearchIndex[crate].q;var itemDescs=rawSearchIndex[crate].d;var itemParentIdxs=rawSearchIndex[crate].i;var itemFunctionSearchTypes=rawSearchIndex[crate].f;var paths=rawSearchIndex[crate].p;var aliases=rawSearchIndex[crate].a;var len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:itemFunctionSearchTypes[i],id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]={};var j,local_aliases;for(var alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}if(!hasOwnPropertyRustdoc(ALIASES[crate],alias_name)){ALIASES[crate][alias_name]=[]}local_aliases=aliases[alias_name];for(j=0,len=local_aliases.length;j0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=function(){var qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}index=buildIndex(rawSearchIndex);registerSearchEvents();if(searchState.getQueryStringParams().search){search()}};if(window.searchIndex!==undefined){initSearch(window.searchIndex)}})() \ No newline at end of file diff --git a/doc/settings.html b/doc/settings.html index 27e0a8b..20fc315 100644 --- a/doc/settings.html +++ b/doc/settings.html @@ -1,6 +1,4 @@ -Rustdoc settings - -

Rustdoc settings

Theme preferences
Use system theme
Preferred dark theme
Preferred light theme
-
Auto-hide item contents for large items.
Auto-hide item methods' documentation
Auto-hide trait implementation documentation
Auto-hide implementors of a trait
Directly go to item in search if there is only one result
Show line numbers on code examples
Disable keyboard shortcuts
- \ No newline at end of file +Rustdoc settings +

Rustdoc settings

Theme preferences
Use system theme
Preferred dark theme
Preferred light theme
+
Auto-hide item contents for large items.
Auto-hide item methods' documentation
Auto-hide trait implementation documentation
Directly go to item in search if there is only one result
Show line numbers on code examples
Disable keyboard shortcuts
+ \ No newline at end of file diff --git a/doc/sidebar-items.js b/doc/sidebar-items.js deleted file mode 100644 index 431587a..0000000 --- a/doc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -initSidebarItems({}) \ No newline at end of file diff --git a/doc/source-script.js b/doc/source-script.js index 67f62a1..5dc8fee 100644 --- a/doc/source-script.js +++ b/doc/source-script.js @@ -1 +1 @@ -function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0,len=rootPathParts.length;i"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild);var selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}} \ No newline at end of file +(function(){function getCurrentFilePath(){var parts=window.location.pathname.split("/");var rootPathParts=window.rootPath.split("/");for(var i=0,len=rootPathParts.length;i"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(!window.rootPath.endsWith("/")){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild);var selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}var lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(scrollTo,match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(tocur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",function(){var match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(false,match)}});onEachLazy(document.getElementsByClassName("line-numbers"),function(el){el.addEventListener("click",handleSourceHighlight)});highlightSourceLines(true);window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file diff --git a/doc/src/draught/board/enums.rs.html b/doc/src/draught/board/enums.rs.html index c0008af..ae482d1 100644 --- a/doc/src/draught/board/enums.rs.html +++ b/doc/src/draught/board/enums.rs.html @@ -1,7 +1,5 @@ -enums.rs - source - -
 1
+enums.rs - source
+    
 1
  2
  3
  4
@@ -87,8 +85,7 @@
 84
 85
 86
-
-extern crate wasm_bindgen;
+
extern crate wasm_bindgen;
 use wasm_bindgen::prelude::*;
 
 use std::fmt::{Display};
@@ -113,19 +110,19 @@
 
 impl Team {
     /// Get opposing team
-    pub fn opponent(&self) -> Team{
+    pub fn opponent(&self) -> Team{
         match self {
-            Team::White => Team::Black,
-            Team::Black => Team::White,
+            Team::White => Team::Black,
+            Team::Black => Team::White,
         }
     }
 }
 
 impl Display for Team {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         match self {
-            Team::White => write!(f, "{}", 'W'),
-            Team::Black => write!(f, "{}", 'B'),
+            Team::White => write!(f, "{}", 'W'),
+            Team::Black => write!(f, "{}", 'B'),
         }
     }
 }
@@ -150,11 +147,11 @@
 }
 
 impl Display for SquareState {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         match self {
-            SquareState::Empty => write!(f, "{}", 'E'),
-            SquareState::Occupied => write!(f, "{}", 'O'),
-            SquareState::Unplayable => write!(f, "{}", 'U'),
+            SquareState::Empty => write!(f, "{}", 'E'),
+            SquareState::Occupied => write!(f, "{}", 'O'),
+            SquareState::Unplayable => write!(f, "{}", 'U'),
         }
     }
 }
@@ -173,6 +170,6 @@
     IllegalTrajectory = 6,
     NoJumpablePiece = 7,
     JumpingSameTeam = 8,
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/board/iter.rs.html b/doc/src/draught/board/iter.rs.html index e76fcd8..5ddfb32 100644 --- a/doc/src/draught/board/iter.rs.html +++ b/doc/src/draught/board/iter.rs.html @@ -1,7 +1,5 @@ -iter.rs - source - -
  1
+iter.rs - source
+    
  1
   2
   3
   4
@@ -196,9 +194,8 @@
 193
 194
 195
-
-use crate::board::{Board, Square};
-use crate::board::enums::*;
+
use crate::board::{Board, Square};
+use crate::board::enums::*;
 
 pub struct RowIndexIterator<'a> {
     board: &'a Board,
@@ -206,7 +203,7 @@
 }
 
 impl<'a> RowIndexIterator<'a> {
-    pub fn new(board: &'a Board) -> Self {
+    pub fn new(board: &'a Board) -> Self {
         Self { 
             board, 
             row_cursor: 0 
@@ -218,7 +215,7 @@
     type Item = Vec<usize>;
     
     /// Get next item from the iterator
-    fn next(&mut self) -> Option<Vec<usize>> {
+    fn next(&mut self) -> Option<Vec<usize>> {
         if self.row_cursor >= self.board.height {
             return None
         }
@@ -240,7 +237,7 @@
 }
 
 impl<'a> RowSquareIterator<'a> {
-    pub fn new(board: &'a Board) -> Self {
+    pub fn new(board: &'a Board) -> Self {
         Self { 
             board, 
             index_iter: RowIndexIterator::new(board)
@@ -252,17 +249,17 @@
     type Item = Vec<Square>;
     
     /// Get next item from the iterator
-    fn next(&mut self) -> Option<Vec<Square>> {
+    fn next(&mut self) -> Option<Vec<Square>> {
 
         match self.index_iter.next() {
-            Some(x) => {
+            Some(x) => {
                 let mut holder: Vec<Square> = Vec::with_capacity(self.board.width);
                 for i in x {
                     holder.push(self.board.cell(i));
                 }
                 Some(holder)
             },
-            None => None
+            None => None
         }
     }
 }
@@ -273,7 +270,7 @@
 }
 
 impl<'a> PieceIterator<'a> {
-    pub fn new(board: &'a Board) -> Self {
+    pub fn new(board: &'a Board) -> Self {
         Self { 
             board, 
             index_cursor: 0
@@ -285,13 +282,13 @@
     type Item = (usize, Square);
     
     /// Get next item from the iterator
-    fn next(&mut self) -> Option<(usize, Square)> {
+    fn next(&mut self) -> Option<(usize, Square)> {
 
         while self.index_cursor < self.board.num_cells() - 1 {
             self.index_cursor += 1;
             match self.board.cell(self.index_cursor).state {
-                SquareState::Empty | SquareState::Unplayable => continue,
-                SquareState::Occupied => return Some((self.index_cursor, self.board.cell(self.index_cursor))),
+                SquareState::Empty | SquareState::Unplayable => continue,
+                SquareState::Occupied => return Some((self.index_cursor, self.board.cell(self.index_cursor))),
             }
         }
 
@@ -302,8 +299,8 @@
 #[cfg(test)]
 pub mod tests {
     use super::*;
-    use crate::board::enums::SquareState;
-    use crate::board::Piece;
+    use crate::board::enums::SquareState;
+    use crate::board::Piece;
     use wasm_bindgen_test::*;
 
     // use crate::log;
@@ -391,6 +388,6 @@
         assert_eq!(collected[2], (5, board.cell(5)));
     }
 
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/board/mod.rs.html b/doc/src/draught/board/mod.rs.html index f682514..4b1aa91 100644 --- a/doc/src/draught/board/mod.rs.html +++ b/doc/src/draught/board/mod.rs.html @@ -1,7 +1,5 @@ -mod.rs - source - -
  1
+mod.rs - source
+    
  1
   2
   3
   4
@@ -851,8 +849,7 @@
 848
 849
 850
-
-//! Board module for components related to the checkers board and game structure
+
//! Board module for components related to the checkers board and game structure
 
 #[cfg(test)] pub mod tests;
 
@@ -868,7 +865,7 @@
 use std::fmt::{Display, Write};
 use std::option::Option;
 
-use crate::log;
+use crate::log;
 
 extern crate wasm_bindgen;
 use wasm_bindgen::prelude::*;
@@ -889,7 +886,7 @@
 #[wasm_bindgen]
 impl Piece {
     #[wasm_bindgen(constructor)]
-    pub fn new(team: Team, strength: Strength) -> Piece {
+    pub fn new(team: Team, strength: Strength) -> Piece {
         Piece {
             team, strength
         }
@@ -915,7 +912,7 @@
 
 impl<T: Clone + Copy> Direction<T> {
     /// Create an empty direction full of [`Option::None`]
-    pub fn empty() -> Direction<T> {
+    pub fn empty() -> Direction<T> {
         Direction {
             nw: Option::None,
             ne: Option::None,
@@ -939,7 +936,7 @@
 impl Square {
     /// Standard constructor function to form square from state and occupant
     #[wasm_bindgen(constructor)]
-    pub fn new(state: SquareState, occupant: Option<Piece>) -> Square{
+    pub fn new(state: SquareState, occupant: Option<Piece>) -> Square{
         Square {
             occupant,
             state
@@ -947,7 +944,7 @@
     }
 
     /// Helper function for a well-formed piece square by team and strength
-    pub fn pc(team: Team, strength: Strength) -> Square {
+    pub fn pc(team: Team, strength: Strength) -> Square {
         Square {
             occupant: Some(Piece::new(team, strength)),
             state: Occupied,
@@ -955,7 +952,7 @@
     }
 
     /// Helper function for a well-formed empty square
-    pub fn empty() -> Square {
+    pub fn empty() -> Square {
         Square {
             occupant: None,
             state: Empty,
@@ -963,7 +960,7 @@
     }
 
     /// Helper function for a well-formed unplayable square
-    pub fn unplay() -> Square {
+    pub fn unplay() -> Square {
         Square {
             occupant: None,
             state: Unplayable,
@@ -982,19 +979,19 @@
 #[wasm_bindgen]
 impl BrdIdx {
     #[wasm_bindgen(constructor)]
-    pub fn from(row: usize, col: usize) -> BrdIdx {
+    pub fn from(row: usize, col: usize) -> BrdIdx {
         BrdIdx{
             row, col
         }
     }
 
-    pub fn eq (&self, other: &BrdIdx) -> bool {
-        *self == *other
+    pub fn eq (&self, other: &BrdIdx) -> bool {
+        *self == *other
     }
 }
 
 impl Display for BrdIdx {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         write!(f, "({}, {})", self.row, self.col)
     }
 }
@@ -1021,8 +1018,8 @@
 
 impl Board {
     /// Get a mutable reference to a board square by 1D array index
-    pub fn cell_mut(&mut self, idx: usize) -> &mut Square {
-        &mut self.cells[idx]
+    pub fn cell_mut(&mut self, idx: usize) -> &mut Square {
+        &mut self.cells[idx]
     }
 
     /// Get the 1D array indices for the diagonally adjacent squares of a given board square
@@ -1032,8 +1029,8 @@
     /// 
     /// Some(Vec<usize>): A variable length vector of 1D indices for diagonally adjacent squares. 
     /// Vector may be between 1 and 4 items long depending on the location of the given square
-    pub fn adjacent_indices(&self, idx: BrdIdx) -> Option<Vec<usize>> {
-        if self.cell_state(self.cell_idx(idx)) == Unplayable {
+    pub fn adjacent_indices(&self, idx: BrdIdx) -> Option<Vec<usize>> {
+        if self.cell_state(self.cell_idx(idx)) == Unplayable {
             return None;
         }
 
@@ -1082,8 +1079,8 @@
     /// [`None`]: If the given square is unplayable
     /// 
     /// Some(Direction<Square>): A [`Direction`] structure for the diagonally adjacent squares.
-    pub fn adjacent_dir(&self, idx: BrdIdx) -> Option<Direction<Square>> {
-        if self.cell_state(self.cell_idx(idx)) == Unplayable {
+    pub fn adjacent_dir(&self, idx: BrdIdx) -> Option<Direction<Square>> {
+        if self.cell_state(self.cell_idx(idx)) == Unplayable {
             return None;
         }
 
@@ -1116,19 +1113,19 @@
     }
 
     /// Filter an array of diagonal indices (Like those from [`Board::adjacent_indices`], [`Board::jumpable_indices`]) for those that are legal for a team's man, i.e. solely up or down the board
-    pub fn filter_indices(&self, idx: BrdIdx, player: Team, indices: Vec<usize>) -> Vec<usize> {
+    pub fn filter_indices(&self, idx: BrdIdx, player: Team, indices: Vec<usize>) -> Vec<usize> {
         indices.into_iter().filter(|i| {
             match player {
-                Black => self.board_index(*i).row < idx.row,
-                White => self.board_index(*i).row > idx.row,
+                Black => self.board_index(*i).row < idx.row,
+                White => self.board_index(*i).row > idx.row,
             }
         }).collect()
     }
 
-    pub fn player_adjacent_indices(&self, idx: BrdIdx, player: Team) -> Option<Vec<usize>> {
+    pub fn player_adjacent_indices(&self, idx: BrdIdx, player: Team) -> Option<Vec<usize>> {
         match self.adjacent_indices(idx) {
-            Some(x) => Some(self.filter_indices(idx, player, x)),
-            None => None
+            Some(x) => Some(self.filter_indices(idx, player, x)),
+            None => None
         }
     }
 
@@ -1139,8 +1136,8 @@
     /// 
     /// Some(Vec<usize>): A variable length vector of 1D indices for diagonally jumpable squares. 
     /// Vector may be between 1 and 4 items long depending on the location of the given square
-    pub fn jumpable_indices(&self, idx: BrdIdx) -> Option<Vec<usize>> {
-        if self.cell_state(self.cell_idx(idx)) == Unplayable {
+    pub fn jumpable_indices(&self, idx: BrdIdx) -> Option<Vec<usize>> {
+        if self.cell_state(self.cell_idx(idx)) == Unplayable {
             return None;
         }
 
@@ -1189,8 +1186,8 @@
     /// [`None`]: If the given square is unplayable
     /// 
     /// Some(Direction<Square>): A [`Direction`] structure for the diagonally jumpable squares.
-    pub fn jumpable_dir(&self, idx: BrdIdx) -> Option<Direction<Square>> {
-        if self.cell_state(self.cell_idx(idx)) == Unplayable {
+    pub fn jumpable_dir(&self, idx: BrdIdx) -> Option<Direction<Square>> {
+        if self.cell_state(self.cell_idx(idx)) == Unplayable {
             return None;
         }
 
@@ -1222,15 +1219,15 @@
         Some(dir)
     }
 
-    pub fn player_jumpable_indices(&self, idx: BrdIdx, player: Team) -> Option<Vec<usize>> {
+    pub fn player_jumpable_indices(&self, idx: BrdIdx, player: Team) -> Option<Vec<usize>> {
         match self.jumpable_indices(idx) {
-            Some(x) => Some(self.filter_indices(idx, player, x)),
-            None => None
+            Some(x) => Some(self.filter_indices(idx, player, x)),
+            None => None
         }
     }
 
     /// Get the difference between two [`BrdIdx`] objects
-    pub fn idx_diffs(from: BrdIdx, to: BrdIdx) -> (isize, isize) {
+    pub fn idx_diffs(from: BrdIdx, to: BrdIdx) -> (isize, isize) {
         // cast to signed ints so that -1 will work for black moves
         (to.row as isize - from.row as isize, to.col as isize - from.col as isize)
     }
@@ -1243,12 +1240,12 @@
 #[wasm_bindgen]
 impl Board {
     /// Get a copy of a board square by 1D array index
-    pub fn cell(&self, idx: usize) -> Square {
+    pub fn cell(&self, idx: usize) -> Square {
         self.cells[idx]
     }
 
     /// Get a copy of a board square by 1D array index
-    pub fn set_cell(&mut self, idx: usize, square: Square) {
+    pub fn set_cell(&mut self, idx: usize, square: Square) {
         // TODO: handle this error better?
         if idx >= self.num_cells() {
             panic!("Given index is too large, idx: {}, square: {:?}", idx, square);
@@ -1257,29 +1254,29 @@
     }
 
     /// Get a copy of a board square by 2D [`BrdIdx`] index
-    pub fn grid_cell(&self, idx: BrdIdx) -> Square {
+    pub fn grid_cell(&self, idx: BrdIdx) -> Square {
         self.cell(self.cell_idx(idx))
     }
     
     /// Transform a 2D row/column board index into a single 1D index for use with [`Board::cells`]
-    pub fn cell_index(&self, row: usize, col: usize) -> usize {
+    pub fn cell_index(&self, row: usize, col: usize) -> usize {
         (row * self.width) + col
     }
 
     /// 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`]
-    pub fn cell_idx(&self, idx: BrdIdx) -> usize {
+    pub fn cell_idx(&self, idx: BrdIdx) -> usize {
         self.cell_index(idx.row, idx.col)
     }
 
     /// Transform a 1D array index (for [`Board::cells`]) into a 2D game board index (by row/col)
-    pub fn board_index(&self, idx: usize) -> BrdIdx {
+    pub fn board_index(&self, idx: usize) -> BrdIdx {
         let row = idx / self.width;
         let col = idx - (row * self.width);
         BrdIdx::from(row, col)
     }
 
     /// Check whether a move given by source and destination indices is legal 
-    pub fn can_move(&self, from: BrdIdx, to: BrdIdx) -> Moveable {
+    pub fn can_move(&self, from: BrdIdx, to: BrdIdx) -> Moveable {
 
         if from.row > self.height - 1 || from.col > self.width - 1 {
             return Moveable::OutOfBounds;
@@ -1293,15 +1290,15 @@
 
         // check source square is occupied
         match from_square.state {
-            Empty => return Moveable::UnoccupiedSrc,
-            Unplayable => return Moveable::Unplayable,
-            Occupied => {
+            Empty => return Moveable::UnoccupiedSrc,
+            Unplayable => return Moveable::Unplayable,
+            Occupied => {
 
                 // if its not the current teams piece then error
                 match from_square.occupant {
                     // weird error, shouldn't happen
-                    None => panic!("Square is apparently occupied, but no occupant was found from: {}, to: {}, square: {:?}", from, to, from_square),
-                    Some(from_square_occupant) => {
+                    None => panic!("Square is apparently occupied, but no occupant was found from: {}, to: {}, square: {:?}", from, to, from_square),
+                    Some(from_square_occupant) => {
 
                         // piece in the source square is not for the current turn's player
                         if from_square_occupant.team != self.current_turn {
@@ -1317,13 +1314,13 @@
                         // the destination square
                         // TODO: refactor to a IsMove()/IsJump() to check whether the move has a legal trajectory
                         match from_square_occupant.strength {
-                            Man => {
+                            Man => {
                                 let strength_check = self.validate_man_move(from, to, from_square_occupant);
                                 if strength_check != Moveable::Allowed {
                                     return strength_check;
                                 }
                             },
-                            King => {
+                            King => {
                                 let strength_check = self.validate_king_move(from, to, from_square_occupant);
                                 if strength_check != Moveable::Allowed {
                                     return strength_check;
@@ -1333,11 +1330,11 @@
 
                         let to_square = self.cell(self.cell_idx(to));
                         match to_square.state {
-                            Empty => {
+                            Empty => {
                                 return Moveable::Allowed;
                             },
-                            Unplayable => return Moveable::Unplayable,
-                            Occupied => return Moveable::OccupiedDest,
+                            Unplayable => return Moveable::Unplayable,
+                            Occupied => return Moveable::OccupiedDest,
                         }
                     }
                 }
@@ -1346,19 +1343,19 @@
     }
 
     /// Check that given move trajectory is valid for a man piece 
-    pub fn validate_man_move(&self, from: BrdIdx, to: BrdIdx, from_square_occupant: Piece) -> Moveable {
+    pub fn validate_man_move(&self, from: BrdIdx, to: BrdIdx, from_square_occupant: Piece) -> Moveable {
         let (row_diff, col_diff) = Board::idx_diffs(from, to);
 
         // men can only move forwards, below is row difference for each team
         let idx_scale: isize = match self.current_turn {
-            Black => -1,
-            White => 1,
+            Black => -1,
+            White => 1,
         };
 
         // legal standard move 
-        if row_diff == idx_scale {
+        if row_diff == idx_scale {
             // destination is directly to the left or right
-            if col_diff.abs() == 1 {
+            if col_diff.abs() == 1 {
                 return Moveable::Allowed;
             } 
             // illegal, not adjacently diagional
@@ -1367,16 +1364,16 @@
             }
         }
         // legal jump move trajectory
-        else if row_diff == 2 * idx_scale {
+        else if row_diff == 2 * idx_scale {
             // destination is directly to the left or right
-            if col_diff.abs() == 2 {
+            if col_diff.abs() == 2 {
 
                 // piece to be jumped over
                 let jumpee = self.cell(self.jumpee_idx(from, to));
                 match jumpee.state {
-                    Empty => Moveable::NoJumpablePiece,
-                    Unplayable => panic!("Found an unplayable piece to try to jump over, from: {}, to: {}, jumpee: {:?}", from, to, jumpee),
-                    Occupied => {
+                    Empty => Moveable::NoJumpablePiece,
+                    Unplayable => panic!("Found an unplayable piece to try to jump over, from: {}, to: {}, jumpee: {:?}", from, to, jumpee),
+                    Occupied => {
 
                         // check whether jumpee is an opponent's piece
                         return Board::validate_jumpee(jumpee, from_square_occupant);
@@ -1395,13 +1392,13 @@
     }
 
     /// Check that given move trajectory is valid for a king piece 
-    pub fn validate_king_move(&self, from: BrdIdx, to: BrdIdx, from_square_occupant: Piece) -> Moveable {
+    pub fn validate_king_move(&self, from: BrdIdx, to: BrdIdx, from_square_occupant: Piece) -> Moveable {
         let (row_diff, col_diff) = Board::idx_diffs(from, to);
 
         // legal standard move 
-        if row_diff.abs() == 1 {
+        if row_diff.abs() == 1 {
             // destination is directly to the left or right
-            if col_diff.abs() == 1 {
+            if col_diff.abs() == 1 {
                 return Moveable::Allowed;
             } 
             // illegal, not adjacently diagional
@@ -1410,16 +1407,16 @@
             }
         }
         // legal jump move trajectory
-        else if row_diff.abs() == 2 {
+        else if row_diff.abs() == 2 {
             // destination is directly to the left or right
-            if col_diff.abs() == 2 {
+            if col_diff.abs() == 2 {
 
                 // piece to be jumped over
                 let jumpee = self.cell(self.jumpee_idx(from, to));
                 match jumpee.state {
-                    Empty => Moveable::NoJumpablePiece,
-                    Unplayable => panic!("Found an unplayable piece to try to jump over, from: {}, to: {}, jumpee: {:?}", from, to, jumpee),
-                    Occupied => {
+                    Empty => Moveable::NoJumpablePiece,
+                    Unplayable => panic!("Found an unplayable piece to try to jump over, from: {}, to: {}, jumpee: {:?}", from, to, jumpee),
+                    Occupied => {
 
                         // check whether jumpee is an opponent's piece
                         return Board::validate_jumpee(jumpee, from_square_occupant);
@@ -1438,7 +1435,7 @@
     }
 
     /// Get cell index of jumpee square given from and to locations
-    pub fn jumpee_idx(&self, from: BrdIdx, to: BrdIdx) -> usize {
+    pub fn jumpee_idx(&self, from: BrdIdx, to: BrdIdx) -> usize {
         let (row_diff, col_diff) = Board::idx_diffs(from, to);
         self.cell_idx(
             BrdIdx::from(
@@ -1448,29 +1445,29 @@
     }
 
     /// Get a pointer to the backing array of board squares, [`Board::cells`]
-    pub fn cells(&self) -> *const Square {
+    pub fn cells(&self) -> *const Square {
         self.cells.as_ptr()
     }
 
     /// Get the number of board squares
-    pub fn num_cells(&self) -> usize {
+    pub fn num_cells(&self) -> usize {
         self.cells.len()
     }
 
     /// Get the number of remaining pieces
-    pub fn num_pieces(&self) -> usize {
+    pub fn num_pieces(&self) -> usize {
         let pieces: Vec<_> = PieceIterator::new(self).collect();
         pieces.len()
     }
 
     /// Get the number of remaining pieces for a player
-    pub fn num_player(&self, team: Team) -> usize {
+    pub fn num_player(&self, team: Team) -> usize {
         let mut total = 0;
         for (_, square) in PieceIterator::new(self) {
             match square.occupant {
-                None => {},
-                Some(x) => {
-                    if x.team == team {
+                None => {},
+                Some(x) => {
+                    if x.team == team {
                         total += 1;
                     }
                 },
@@ -1480,7 +1477,7 @@
     }
 
     /// Get the score value, Black - White pieces
-    pub fn score(&self) -> isize {
+    pub fn score(&self) -> isize {
         let mut black: isize = 0;
         let mut white: isize = 0;
 
@@ -1489,15 +1486,15 @@
                 
                 // kings are move valuable than men
                 let increment = match piece.strength {
-                    Man => 1,
-                    King => 2,
+                    Man => 1,
+                    King => 2,
                 };
 
                 match piece.team {
-                    Black => {
+                    Black => {
                         black += increment;
                     },
-                    White => {
+                    White => {
                         white += increment;
                     },
                 }
@@ -1508,12 +1505,12 @@
     }
 
     /// Get the state of a board square by 1D array index
-    pub fn cell_state(&self, idx: usize) -> SquareState {
+    pub fn cell_state(&self, idx: usize) -> SquareState {
         self.cell(idx).state
     }
 
     /// Get new board derived from current with given move applied
-    pub fn apply_move(&self, from: BrdIdx, to: BrdIdx) -> Board {
+    pub fn apply_move(&self, from: BrdIdx, to: BrdIdx) -> Board {
         let mut new = self.clone();
 
         let from_idx = self.cell_idx(from);
@@ -1531,7 +1528,7 @@
             Square::empty() // empty piece
         );
 
-        Board::check_kinged(&mut new, to);
+        Board::check_kinged(&mut new, to);
 
         // board has been changed, update player turn
         new.current_turn = new.current_turn.opponent();
@@ -1540,7 +1537,7 @@
     }
 
     /// Get new board derived from current with given jump applied
-    pub fn apply_jump(&self, from: BrdIdx, to: BrdIdx) -> Board {
+    pub fn apply_jump(&self, from: BrdIdx, to: BrdIdx) -> Board {
         let mut new = self.clone();
 
         let from_idx = self.cell_idx(from);
@@ -1564,7 +1561,7 @@
             Square::empty() // empty piece
         );
 
-        Board::check_kinged(&mut new, to);
+        Board::check_kinged(&mut new, to);
 
         // board has been changed, update player turn
         new.current_turn = new.current_turn.opponent();
@@ -1573,10 +1570,10 @@
     }
 
     /// Get row index for current team, top row for black, bottom row for white
-    pub fn king_row_idx(&self) -> usize {
+    pub fn king_row_idx(&self) -> usize {
         match self.current_turn {
-            White => self.height - 1,
-            Black => 0,
+            White => self.height - 1,
+            Black => 0,
         }
     }
 }
@@ -1588,11 +1585,11 @@
 #[wasm_bindgen]
 impl Board {
     /// Unwrap the jumpee piece from the square and [`Board::check_jumpee_team`] with [`Moveable`] response
-    pub fn validate_jumpee(jumpee: Square, from_occ: Piece) -> Moveable {
+    pub fn validate_jumpee(jumpee: Square, from_occ: Piece) -> Moveable {
         // check whether jumpee is an opponent's piece
         match jumpee.occupant {
-            None => panic!("No occupant found when checking the from: {:?} , jumpee: {:?}", from_occ, jumpee),
-            Some(jumpee_occupant_uw) => {
+            None => panic!("No occupant found when checking the from: {:?} , jumpee: {:?}", from_occ, jumpee),
+            Some(jumpee_occupant_uw) => {
                 if Board::check_jumpee_team(from_occ, jumpee_occupant_uw) {
                     return Moveable::Allowed;
                 }
@@ -1604,20 +1601,20 @@
     }
 
     /// Check that the source piece and the jumpee are of opposing teams
-    pub fn check_jumpee_team(from: Piece, jumpee: Piece) -> bool {
-        return from.team.opponent() == jumpee.team
+    pub fn check_jumpee_team(from: Piece, jumpee: Piece) -> bool {
+        return from.team.opponent() == jumpee.team
     }
 
     /// Check and apply king strength
-    fn check_kinged(new_board: &mut Board, idx: BrdIdx) {
-        if new_board.king_row_idx() == idx.row {
+    fn check_kinged(new_board: &mut Board, idx: BrdIdx) {
+        if new_board.king_row_idx() == idx.row {
             let cell_idx = new_board.cell_idx(idx);
             let cell = new_board.cell(cell_idx);
             match cell.occupant {
-                Some(piece) => {
+                Some(piece) => {
                     new_board.set_cell(cell_idx, Square::pc(piece.team, King));
                 },
-                None => {
+                None => {
                     panic!("No piece found when checking king, idx: {}", idx);
                 },
             }
@@ -1626,7 +1623,7 @@
 
     /// Initialise a game board without game pieces
     #[wasm_bindgen(constructor)]
-    pub fn new(width: usize, height: usize, current_turn: Team) -> Board {
+    pub fn new(width: usize, height: usize, current_turn: Team) -> Board {
         let total_cells = width * height;
 
         let mut cells: Vec<Square>  = Vec::with_capacity(total_cells);
@@ -1642,7 +1639,7 @@
                 }
                 playable = !playable;
             }
-            playable = i % 2 == 0;
+            playable = i % 2 == 0;
         }
 
         Board {
@@ -1655,12 +1652,12 @@
     }
 
     /// Reset the given board to a starting layout with 3 rows of opposing pieces
-    pub fn init_game(board: Board, piece_rows: usize) -> Board {
+    pub fn init_game(board: Board, piece_rows: usize) -> Board {
         let mut new_board = board.clone();
         for (idx, row) in RowSquareIterator::new(&board).enumerate() {
             for (jdx, square) in row.iter().enumerate() {
 
-                if square.state == Empty || square.state == Occupied {
+                if square.state == Empty || square.state == Occupied {
                     if idx < piece_rows {
                         let cell_idx = new_board.cell_index(idx, jdx);
                         new_board.cells[cell_idx] = Square::pc(White, Man);
@@ -1680,7 +1677,7 @@
 }
 
 impl Display for Board {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result{
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result{
         let mut string = String::new();
 
         for i in 0..self.height {
@@ -1688,9 +1685,9 @@
                 let idx = self.cell_index(i, j);
 
                 let result = match self.cell_state(idx) {
-                    Empty => write!(string, "_ "),
-                    Occupied => write!(string, "{} ", self.cell(idx).occupant.unwrap().team),
-                    Unplayable => write!(string, ". "),
+                    Empty => write!(string, "_ "),
+                    Occupied => write!(string, "{} ", self.cell(idx).occupant.unwrap().team),
+                    Unplayable => write!(string, ". "),
                 };
                 if let Err(err) = result {
                     log!("Error printing cell state, ({}, {}), {}", i, j, err);
@@ -1701,6 +1698,6 @@
 
         write!(f, "{}", string)
     }
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/comp/mod.rs.html b/doc/src/draught/comp/mod.rs.html index 7bc0f3c..17c6ceb 100644 --- a/doc/src/draught/comp/mod.rs.html +++ b/doc/src/draught/comp/mod.rs.html @@ -1,7 +1,5 @@ -mod.rs - source - -
  1
+mod.rs - source
+    
  1
   2
   3
   4
@@ -426,8 +424,7 @@
 423
 424
 425
-
-//! AI player logic
+
//! AI player logic
 
 use indextree::{Arena, Node, NodeId, NodeEdge};
 
@@ -437,12 +434,12 @@
 extern crate wasm_bindgen;
 // use wasm_bindgen::prelude::*;
 
-use crate::log;
-use crate::log_error;
+use crate::log;
+use crate::log_error;
 
-use crate::board::{Board, BrdIdx};
-use crate::board::enums::{MoveType, Moveable, Team};
-use crate::board::iter::{PieceIterator};
+use crate::board::{Board, BrdIdx};
+use crate::board::enums::{MoveType, Moveable, Team};
+use crate::board::iter::{PieceIterator};
 
 use Team::*;
 // use Strength::*;
@@ -461,7 +458,7 @@
 }
 
 impl Move {
-    pub fn new(from: BrdIdx, to: BrdIdx, mv_type: MoveType) -> Move {
+    pub fn new(from: BrdIdx, to: BrdIdx, mv_type: MoveType) -> Move {
         Move {
             from, to, mv_type
         }
@@ -476,13 +473,13 @@
 }
 
 impl BoardNode {
-    pub fn new(board: Board, score: isize) -> BoardNode {
+    pub fn new(board: Board, score: isize) -> BoardNode {
         BoardNode {
             board, score
         }
     }
 
-    pub fn brd(board: Board) -> BoardNode {
+    pub fn brd(board: Board) -> BoardNode {
         BoardNode {
             board, score: 0
         }
@@ -499,7 +496,7 @@
 }
 
 impl Computer {
-    pub fn new(search_depth: usize, team: Team, perfect_chance: f64) -> Computer {
+    pub fn new(search_depth: usize, team: Team, perfect_chance: f64) -> Computer {
         Computer {
             search_depth,
             team,
@@ -509,7 +506,7 @@
     }
 
     /// Get vector of available moves for a given board
-    fn available_turns(&self, board: &Board) -> Vec<Move> {
+    fn available_turns(&self, board: &Board) -> Vec<Move> {
 
         // allocate capacity for 2 moves per piece, likely too much but will be shrunk
         // to reduce memory re-allocations
@@ -519,11 +516,11 @@
         for (idx, square) in PieceIterator::new(board) {
 
             match square.occupant {
-                None => continue,
-                Some(piece) => {
+                None => continue,
+                Some(piece) => {
 
                     // filter for current team's pieces
-                    if piece.team == board.current_turn {
+                    if piece.team == board.current_turn {
                         let from_brd_idx = board.board_index(idx);
                         let adj_op = board.adjacent_indices(from_brd_idx);
                         let jump_op = board.jumpable_indices(from_brd_idx);
@@ -534,7 +531,7 @@
                                 let to_brd_idx = board.board_index(i);
 
                                 // check if can move
-                                if board.can_move(from_brd_idx, to_brd_idx) == Moveable::Allowed {
+                                if board.can_move(from_brd_idx, to_brd_idx) == Moveable::Allowed {
                                     moves.push(Move::new(from_brd_idx, to_brd_idx, MoveType::Move));
                                 }
                             }
@@ -548,7 +545,7 @@
                                 let to_brd_idx = board.board_index(i);
 
                                 // check if can move
-                                if board.can_move(from_brd_idx, to_brd_idx) == Moveable::Allowed {
+                                if board.can_move(from_brd_idx, to_brd_idx) == Moveable::Allowed {
                                     moves.push(Move::new(from_brd_idx, to_brd_idx, MoveType::Jump));
                                 }
                             }
@@ -565,7 +562,7 @@
     }
 
     /// Generate tree of boards to given search depth, return root node
-    fn gen_tree(&mut self, tree: &mut Arena<BoardNode>, board: Board) -> NodeId {
+    fn gen_tree(&mut self, tree: &mut Arena<BoardNode>, board: Board) -> NodeId {
 
         // root node of tree
         let root = tree.new_node(BoardNode::brd(board));
@@ -573,7 +570,7 @@
         let mut nodes = vec!(root);
 
         for _ in 0..self.search_depth {
-            if nodes.len() == 0 {
+            if nodes.len() == 0 {
                 break;
             }
 
@@ -584,7 +581,7 @@
     }
 
     /// Propagate scores up the tree employing MiniMax algorithm
-    fn propagate_scores(tree: Arena<BoardNode>, root: NodeId) -> Arena<BoardNode> {
+    fn propagate_scores(tree: Arena<BoardNode>, root: NodeId) -> Arena<BoardNode> {
 
         // need to clone tree because we iterate over it and edit it at the same time
         let mut new_tree = tree.clone();
@@ -629,14 +626,14 @@
     }
 
     /// Get best of given scores for given team
-    fn best_score(board: &Board, children_scores: Vec<isize>) -> isize {
+    fn best_score(board: &Board, children_scores: Vec<isize>) -> isize {
         match board.current_turn { // MiniMax algorithm here
             // whether maximised or minimsed is based on current player
-            White => children_scores
+            White => children_scores
                 .into_iter()
                 .min()
                 .expect("Couldn't unwrap min score value"),
-            Black => children_scores
+            Black => children_scores
                 .into_iter()
                 .max()
                 .expect("Couldn't unwrap max score value"),
@@ -645,14 +642,14 @@
 
     /// For given NodeIDs, insert score of board into tree
     /// Used for leaf nodes ready for propagating up tree
-    fn insert_board_scores(&mut self, tree: &mut Arena<BoardNode>, nodes: Vec<NodeId>) {
+    fn insert_board_scores(&mut self, tree: &mut Arena<BoardNode>, nodes: Vec<NodeId>) {
         for i in nodes.into_iter() {
             match tree.get_mut(i) {
-                Some(node) => {
+                Some(node) => {
                     let board_node = node.get_mut();
                     board_node.score = board_node.board.score();
                 },
-                None => {
+                None => {
                     panic!("Failed to get node when inserting board scores");
                 }
             }
@@ -660,7 +657,7 @@
     }
 
     /// Traverse tree from given root ID and get NodeIDs of leaf nodes (those without children)
-    fn get_leaf_nodes(&mut self, tree: &mut Arena<BoardNode>, root: NodeId) -> Vec<NodeId> {
+    fn get_leaf_nodes(&mut self, tree: &mut Arena<BoardNode>, root: NodeId) -> Vec<NodeId> {
 
         let mut leaves = Vec::with_capacity(self.search_depth * 30);
 
@@ -671,7 +668,7 @@
 
                 let children: Vec<NodeId> = node_id.children(tree).collect();
 
-                if children.len() == 0 {
+                if children.len() == 0 {
                     leaves.push(node_id);
                 }
             }
@@ -681,7 +678,7 @@
     }
 
     /// Expand all given nodes and return newly inserted layer of nodes
-    fn expand_layer(&mut self, tree: &mut Arena<BoardNode>, nodes: Vec<NodeId>) -> Vec<NodeId> {
+    fn expand_layer(&mut self, tree: &mut Arena<BoardNode>, nodes: Vec<NodeId>) -> Vec<NodeId> {
 
         nodes
             .into_iter().map(
@@ -691,11 +688,11 @@
     }
 
     /// Insert all possible next boards as children of given board node
-    fn expand_node(&mut self, tree: &mut Arena<BoardNode>, node: NodeId) -> Vec<NodeId> {
+    fn expand_node(&mut self, tree: &mut Arena<BoardNode>, node: NodeId) -> Vec<NodeId> {
         let node_board: Option<&Node<BoardNode>> = tree.get(node);
         
         match node_board {
-            Some(node_ref) => {
+            Some(node_ref) => {
 
                 let board: &BoardNode = &*node_ref.get();
 
@@ -709,14 +706,14 @@
                 
                 return ids;
             },
-            None => {
+            None => {
                 panic!("No board retrieved from tree, node: {:?}", node);
             },
         }
     }
 
     /// Insert given boards into tree
-    fn insert_boards(&mut self, tree: &mut Arena<BoardNode>, boards: Vec<BoardNode>) -> Vec<NodeId> {
+    fn insert_boards(&mut self, tree: &mut Arena<BoardNode>, boards: Vec<BoardNode>) -> Vec<NodeId> {
         
         boards
             .into_iter().map(
@@ -725,16 +722,16 @@
     }
 
     /// Get all possible next boards from given board
-    fn get_move_boards(&self, board: &BoardNode) -> Vec<BoardNode> {
+    fn get_move_boards(&self, board: &BoardNode) -> Vec<BoardNode> {
 
         self.available_turns(&board.board)
             .into_iter().map(
                 |m| {
                     match m.mv_type {
-                        MoveType::Move => BoardNode::brd(
+                        MoveType::Move => BoardNode::brd(
                             board.board.apply_move(m.from, m.to)
                         ),
-                        MoveType::Jump => BoardNode::brd(
+                        MoveType::Jump => BoardNode::brd(
                             board.board.apply_jump(m.from, m.to)
                         ),
                     }
@@ -743,20 +740,20 @@
     }
 
     /// Get a new board based on the given using MiniMax to make decisions 
-    pub fn get_move(&mut self, brd: Board) -> Option<Board> {
+    pub fn get_move(&mut self, brd: Board) -> Option<Board> {
 
         let mut tree = Arena::new();
 
         // generate a tree to given depth for the given board
-        let root_node = self.gen_tree(&mut tree, brd);
+        let root_node = self.gen_tree(&mut tree, brd);
 
         self.last_node_count = tree.count() - 1;
 
         // get the leaf nodes to insert the board scores with
-        let lowest_nodes = self.get_leaf_nodes(&mut tree, root_node);
+        let lowest_nodes = self.get_leaf_nodes(&mut tree, root_node);
 
         // insert the board scores for the leaf nodes
-        self.insert_board_scores(&mut tree, lowest_nodes);
+        self.insert_board_scores(&mut tree, lowest_nodes);
 
         // propagate the scores up the tree, the root node has the best score
         let tree = Computer::propagate_scores(tree, root_node);
@@ -770,7 +767,7 @@
         // node ids of available next moves
         let possible_moves: Vec<NodeId> = root_node.children(&tree).collect();
 
-        if possible_moves.len() == 0 {
+        if possible_moves.len() == 0 {
             return None;
         }
 
@@ -806,26 +803,26 @@
                 )
                 .filter(
                     // filter for only scores of root node which are perfect moves
-                    |b| b.score == root_board_node.score
+                    |b| b.score == root_board_node.score
                 )
                 .collect();
 
             // weird error, no child nodes have same score as root node
             // this is odd because the root nodes score is either the max or min of it's children
-            if possible_perfect_moves.len() == 0 {
+            if possible_perfect_moves.len() == 0 {
                 log_error!("No next moves matched the score of the root node, picking randomly instead");
                 
-                Some(Computer::random_choice(&tree, possible_moves, &mut rng))
+                Some(Computer::random_choice(&tree, possible_moves, &mut rng))
             }
             // only one possible move, use that
-            else if possible_perfect_moves.len() == 1 {
+            else if possible_perfect_moves.len() == 1 {
                 Some(possible_perfect_moves[0].board.clone())
             }
             // more than one possible perfect move to make, choose one randomly
             else {
                 Some(
                     possible_perfect_moves
-                        .choose(&mut rng) // random choice
+                        .choose(&mut rng) // random choice
                         .unwrap() // unwrap Option
                         .board
                         .clone()
@@ -837,12 +834,12 @@
             #[cfg(feature = "debug_logs")]
             log!("Making random move");
 
-            Some(Computer::random_choice(&tree, possible_moves, &mut rng))
+            Some(Computer::random_choice(&tree, possible_moves, &mut rng))
         }
     }
 
     /// Get a random board from possible node IDs and associated tree
-    fn random_choice(tree: &Arena<BoardNode>, possible_moves: Vec<NodeId>, rng: &mut ThreadRng) -> Board {
+    fn random_choice(tree: &Arena<BoardNode>, possible_moves: Vec<NodeId>, rng: &mut ThreadRng) -> Board {
         let chosen_move = possible_moves.choose(rng).unwrap();
         tree
             .get(*chosen_move)
@@ -851,6 +848,6 @@
             .board
             .clone()
     }
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/game/mod.rs.html b/doc/src/draught/game/mod.rs.html index 0715850..1e434b8 100644 --- a/doc/src/draught/game/mod.rs.html +++ b/doc/src/draught/game/mod.rs.html @@ -1,7 +1,5 @@ -mod.rs - source - -
  1
+mod.rs - source
+    
  1
   2
   3
   4
@@ -252,20 +250,19 @@
 249
 250
 251
-
-//! Top-level object for managing [`Board`]s, applying and managing turns
+
//! Top-level object for managing [`Board`]s, applying and managing turns
 
-use crate::board::Board;
+use crate::board::Board;
 
 extern crate wasm_bindgen;
 use wasm_bindgen::prelude::*;
 
-use crate::log;
+use crate::log;
 
-use crate::board::{Square, BrdIdx};
-use crate::board::enums::{SquareState, Moveable, Team};
-use crate::paint::Painter;
-use crate::comp::Computer;
+use crate::board::{Square, BrdIdx};
+use crate::board::enums::{SquareState, Moveable, Team};
+use crate::paint::Painter;
+use crate::comp::Computer;
 
 use Team::*;
 use SquareState::*;
@@ -289,12 +286,12 @@
 
 impl Game {
     /// Get a read-only copy of a previous turn's board
-    pub fn previous_board(&self, turn: usize) -> &Board {
+    pub fn previous_board(&self, turn: usize) -> &Board {
         &self.previous_boards[turn]
     }
 
     /// Set current board to given
-    pub fn current_board(&self) -> &Board {
+    pub fn current_board(&self) -> &Board {
         &self.current
     }
 }
@@ -302,32 +299,32 @@
 #[wasm_bindgen]
 impl Game {
     /// Get pointer to current board's squares
-    pub fn current_board_cells(&self) -> *const Square {
+    pub fn current_board_cells(&self) -> *const Square {
         self.current.cells()
     }
 
     /// Get pointer to current board's squares
-    pub fn current_board_len(&self) -> usize {
+    pub fn current_board_len(&self) -> usize {
         self.current.num_cells()
     }
 
     /// Current turn's team
-    pub fn current_turn(&self) -> Team {
+    pub fn current_turn(&self) -> Team {
         self.current.current_turn
     }
 
     /// Current board's score
-    pub fn score(&self) -> isize {
+    pub fn score(&self) -> isize {
         self.current.score()
     }
 
     /// Get currently winning player
-    pub fn winning(&self) -> Option<Team> {
+    pub fn winning(&self) -> Option<Team> {
         let current_score = self.score();
 
         if current_score < 0 {
             Some(White)
-        } else if current_score == 0 {
+        } else if current_score == 0 {
             None
         } else {
             Some(Black)
@@ -335,11 +332,11 @@
     }
 
     /// Check if a player has won
-    pub fn has_won(&self) -> Option<Team> {
+    pub fn has_won(&self) -> Option<Team> {
 
-        if self.current.num_player(White) == 0 {
+        if self.current.num_player(White) == 0 {
             Some(Black)
-        } else if self.current.num_player(Black) == 0 {
+        } else if self.current.num_player(Black) == 0 {
             Some(White)
         } else {
             None
@@ -347,52 +344,52 @@
     }
 
     /// Get square on current board for given index
-    pub fn current_cell_state(&self, idx: &BrdIdx) -> Square {
+    pub fn current_cell_state(&self, idx: &BrdIdx) -> Square {
         self.current.cell(self.current.cell_idx(*idx))
     }
 
     /// Set tree depth for AI to search to
-    pub fn set_search_depth(&mut self, search_depth: usize) {
+    pub fn set_search_depth(&mut self, search_depth: usize) {
         self.search_depth = search_depth;
     }
 
     /// Set given index as selected piece
     /// TODO: Check whether valid square?
-    pub fn set_selected(&mut self, idx: &BrdIdx) {
+    pub fn set_selected(&mut self, idx: &BrdIdx) {
         
         if self.current.cell(self.current.cell_idx(*idx)).state != Occupied {
             panic!("Tried to select an unoccupied or empty square");
         } 
 
         self.selected_piece = Some(*idx);
-        match &mut self.painter {
-            Some(p) => p.set_selected(&Some(*idx)),
-            None => {},
+        match &mut self.painter {
+            Some(p) => p.set_selected(&Some(*idx)),
+            None => {},
         }
     }
 
     /// Set proportion of perfect moves from AI
-    pub fn set_perfect_chance(&mut self, new_chance: f64) {
+    pub fn set_perfect_chance(&mut self, new_chance: f64) {
         self.perfect_chance = new_chance;
     }
 
     /// Clear currently selected piece
-    pub fn clear_selected(&mut self) {
+    pub fn clear_selected(&mut self) {
         self.selected_piece = None;
-        match &mut self.painter {
-            Some(p) => p.set_selected(&None),
-            None => {},
+        match &mut self.painter {
+            Some(p) => p.set_selected(&None),
+            None => {},
         }
     }
 
     /// Attempt to make a move given a source and destination index
-    pub fn make_move(&mut self, from: BrdIdx, to: BrdIdx) -> Moveable {
+    pub fn make_move(&mut self, from: BrdIdx, to: BrdIdx) -> Moveable {
         let able = self.current.can_move(from, to);
 
         if let Moveable::Allowed = able {
             let (_, col_diff) = Board::idx_diffs(from, to);
             // MOVE
-            if col_diff.abs() == 1 {
+            if col_diff.abs() == 1 {
                 self.execute_move(from, to);
             } 
             // JUMP
@@ -408,31 +405,31 @@
     }
 
     /// Update board state with given move and push new board into current state
-    pub fn execute_move(&mut self, from: BrdIdx, to: BrdIdx) {
+    pub fn execute_move(&mut self, from: BrdIdx, to: BrdIdx) {
         // set new board to current and push current to stack
         self.push_new_board(self.current.apply_move(from, to));
     }
 
     /// Update board state with given jump move and push new board into current state
-    pub fn execute_jump(&mut self, from: BrdIdx, to: BrdIdx) {
+    pub fn execute_jump(&mut self, from: BrdIdx, to: BrdIdx) {
         // set new board to current and push current to stack
         self.push_new_board(self.current.apply_jump(from, to));
     }
 
     /// Push current board into the previous turns and set given board to current
-    pub fn push_new_board(&mut self, board: Board) {
+    pub fn push_new_board(&mut self, board: Board) {
         self.previous_boards.push(self.current.clone());
         self.set_current(board);
     }
 
     /// Set current board to given
-    pub fn set_current(&mut self, board: Board) {
+    pub fn set_current(&mut self, board: Board) {
         self.current = board;
     }
 
     /// Get new game without board renderer
     #[wasm_bindgen(constructor)]
-    pub fn new(width: usize, height: usize, piece_rows: usize, first_turn: Team, search_depth: usize) -> Game {
+    pub fn new(width: usize, height: usize, piece_rows: usize, first_turn: Team, search_depth: usize) -> Game {
         Game {
             current: Board::init_game(
                 Board::new(width, height, first_turn), piece_rows,
@@ -447,7 +444,7 @@
     }
 
     /// Get a new game with canvas ID and dimensions
-    pub fn new_with_canvas(width: usize, height: usize, piece_rows: usize, first_turn: Team, search_depth: usize, canvas_id: &str, canvas_width: u32, canvas_height: u32) -> Game {
+    pub fn new_with_canvas(width: usize, height: usize, piece_rows: usize, first_turn: Team, search_depth: usize, canvas_id: &str, canvas_width: u32, canvas_height: u32) -> Game {
         Game {
             current: Board::init_game(
                 Board::new(width, height, first_turn), piece_rows,
@@ -464,20 +461,20 @@
     }
 
     /// Set painter for rendering boards
-    pub fn set_painter(&mut self, value: Painter) {
+    pub fn set_painter(&mut self, value: Painter) {
         self.painter = Some(value);
     }
 
     /// Draw current board using painter if exists
     pub fn draw(&self) {
         match &self.painter {
-            Some(p) => p.draw(&self.current),
-            None => log!("No painter to draw board with")
+            Some(p) => p.draw(&self.current),
+            None => log!("No painter to draw board with")
         }
     }
 
     /// Create computer, get move from current board and update current board
-    pub fn ai_move(&mut self) {
+    pub fn ai_move(&mut self) {
         
         let mut comp = Computer::new(self.search_depth, self.current.current_turn, self.perfect_chance);
 
@@ -486,8 +483,8 @@
         self.last_node_count = comp.last_node_count;
 
         match new_brd {
-            Some(brd) => self.push_new_board(brd),
-            None => {
+            Some(brd) => self.push_new_board(brd),
+            None => {
                 log!("No possible moves, re-pushing current board");
 
                 let mut new_brd = self.current.clone();
@@ -500,10 +497,10 @@
 }
 
 impl Display for Game {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result{
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result{
         write!(f, "{}", self.current)
     }
 }
-
+
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/lib.rs.html b/doc/src/draught/lib.rs.html index 88a6f66..eacf766 100644 --- a/doc/src/draught/lib.rs.html +++ b/doc/src/draught/lib.rs.html @@ -1,7 +1,5 @@ -lib.rs - source - -
 1
+lib.rs - source
+    
 1
  2
  3
  4
@@ -44,8 +42,7 @@
 41
 42
 43
-
-//! Draught
+
//! Draught
 //! 
 //! An implementation of checkers/draughts in Rust WebAssembly with a minimax AI player
 
@@ -72,13 +69,13 @@
 /// Wrap the [`web_sys`] access to the browser console in a macro for easy logging
 #[macro_export]
 macro_rules! log {
-    ( $( $t:tt )* ) => {
+    ( $( $t:tt )* ) => {
         web_sys::console::log_1(&format!( $( $t )* ).into());
     }
 }
 #[macro_export]
 macro_rules! log_error {
-    ( $( $t:tt )* ) => {
+    ( $( $t:tt )* ) => {
         web_sys::console::error_1(&format!( $( $t )* ).into());
     }
 }
@@ -87,6 +84,6 @@
 pub fn init_wasm() {
     log!("Initialising WebAssembly");
     utils::set_panic_hook();
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/paint.rs.html b/doc/src/draught/paint.rs.html index 5b5090d..6e2c079 100644 --- a/doc/src/draught/paint.rs.html +++ b/doc/src/draught/paint.rs.html @@ -1,7 +1,5 @@ -paint.rs - source - -
  1
+paint.rs - source
+    
  1
   2
   3
   4
@@ -392,8 +390,7 @@
 389
 390
 391
-
-//! Components for painting board states onto HTML canvases
+
//! Components for painting board states onto HTML canvases
  
 extern crate wasm_bindgen;
 use wasm_bindgen::prelude::*;
@@ -404,12 +401,12 @@
 
 use std::f64;
 
-use crate::log;
-use crate::board::{Board, BrdIdx};
-use crate::board::iter::PieceIterator;
+use crate::log;
+use crate::board::{Board, BrdIdx};
+use crate::board::iter::PieceIterator;
 
-use crate::board::enums::Team::*;
-use crate::board::enums::Strength::*;
+use crate::board::enums::Team::*;
+use crate::board::enums::Strength::*;
 
 /// Default hex colour value for white square background
 const WHITE_SQUARE: &str = "#FFFFFF";
@@ -479,52 +476,52 @@
 
 impl Painter {
     /// Set selected piece by board index
-    pub fn set_selected(&mut self, idx: &Option<BrdIdx>) {
+    pub fn set_selected(&mut self, idx: &Option<BrdIdx>) {
         self.selected_idx = *idx;
     }
 
     /// Get a canvas by element ID
-    fn get_canvas(canvas_id: &str) -> HtmlCanvasElement {
+    fn get_canvas(canvas_id: &str) -> HtmlCanvasElement {
         // JS WINDOW
         let window = match web_sys::window(){
-            Some(win) => win,
-            None => panic!("No Js window returned"),
+            Some(win) => win,
+            None => panic!("No Js window returned"),
         };
         // JS DOCUMENT
         let document = match window.document() {
-            Some(doc) => doc,
-            None => panic!("No Js window document returned"),
+            Some(doc) => doc,
+            None => panic!("No Js window document returned"),
         };
 
         // CANVAS
         let canvas = match document.get_element_by_id(canvas_id) {
-            Some(el) => el,
-            None => panic!("No element found for {}", canvas_id),
+            Some(el) => el,
+            None => panic!("No element found for {}", canvas_id),
         };
         let canvas = match canvas.dyn_into::<web_sys::HtmlCanvasElement>() {
-            Ok(el) => el,
-            Err(err) => panic!("Failed to cast canvas {:?}", err),
+            Ok(el) => el,
+            Err(err) => panic!("Failed to cast canvas {:?}", err),
         };
 
         canvas
     }
 
     /// Get a 2D canvas context for a given canvas
-    fn get_canvas_context(canvas: &HtmlCanvasElement) -> CanvasRenderingContext2d {
+    fn get_canvas_context(canvas: &HtmlCanvasElement) -> CanvasRenderingContext2d {
 
         // CANVAS CONTEXT
         let context = match canvas.get_context("2d") {
-            Ok(op) => match op {
+            Ok(op) => match op {
                 // UNWRAP OPTION
-                Some(object) => object,
-                None => panic!("Nothing found when unwrapping canvas context"),
+                Some(object) => object,
+                None => panic!("Nothing found when unwrapping canvas context"),
             },
-            Err(err) => panic!("Error when getting canvas context: {:?}", err),
+            Err(err) => panic!("Error when getting canvas context: {:?}", err),
         };
         // CAST CONTEXT
         let context = match context.dyn_into::<web_sys::CanvasRenderingContext2d>() {
-            Ok(dyn_cast) => dyn_cast,
-            Err(cast_err) => panic!("Error when casting canvas context: {:?}", cast_err)
+            Ok(dyn_cast) => dyn_cast,
+            Err(cast_err) => panic!("Error when casting canvas context: {:?}", cast_err)
         };
 
         context
@@ -536,7 +533,7 @@
 
     /// Default constructor which queries for canvas by ID
     #[wasm_bindgen(constructor)]
-    pub fn new(width: u32, height: u32, canvas_id: &str) -> Painter {
+    pub fn new(width: u32, height: u32, canvas_id: &str) -> Painter {
 
         let canvas = Painter::get_canvas(canvas_id);
 
@@ -572,7 +569,7 @@
     }
 
     /// Constructor with given canvas element
-    pub fn new_with_canvas(width: u32, height: u32, canvas: HtmlCanvasElement) -> Painter {
+    pub fn new_with_canvas(width: u32, height: u32, canvas: HtmlCanvasElement) -> Painter {
         canvas.set_width(width);
         canvas.set_height(height);
 
@@ -605,17 +602,17 @@
     }
 
     /// Set new square outline colour value
-    pub fn set_square_outline(&mut self, value: JsValue) {
+    pub fn set_square_outline(&mut self, value: JsValue) {
         self.square_outline = value;
     }
 
     /// Set new line width for outlining squares
-    pub fn set_outline_width(&mut self, value: f64) {
+    pub fn set_outline_width(&mut self, value: f64) {
         self.outline_width = value;
     }
 
     /// Set whether squares are outlined
-    pub fn set_draw_outline(&mut self, value: bool) {
+    pub fn set_draw_outline(&mut self, value: bool) {
         self.draw_outline = value;
     }
 
@@ -626,7 +623,7 @@
     }
 
     /// Check whether given canvas dimensions divide evenly by given board dimenions
-    pub fn validate_board_dim(&self, board: &Board) -> bool {
+    pub fn validate_board_dim(&self, board: &Board) -> bool {
         let mut ans = true;
 
         if self.height as usize % board.height != 0 {
@@ -668,8 +665,8 @@
         for i in 0..board.height {
             for j in 0..board.width {
 
-                if i % 2 == 0 {
-                    if j % 2 == 1 {
+                if i % 2 == 0 {
+                    if j % 2 == 1 {
                         self.context.fill_rect(
                             (j * cell_width) as f64, 
                             (i * cell_height) as f64, 
@@ -688,7 +685,7 @@
                     }
                 }
                 else {
-                    if j % 2 == 0 {
+                    if j % 2 == 0 {
                         self.context.fill_rect(
                             (j * cell_width) as f64, 
                             (i * cell_height) as f64, 
@@ -712,22 +709,22 @@
         // Draw pieces onto canvas
         for (idx, square) in PieceIterator::new(board) {
             match square.occupant {
-                Some(piece) => {
+                Some(piece) => {
 
                     let brd_idx = board.board_index(idx);
 
                     match piece.team {
-                        Black => {
+                        Black => {
                             self.context.set_fill_style(&self.black_piece);
                             self.context.set_stroke_style(&self.black_piece_line);
                         },
-                        White => {
+                        White => {
                             self.context.set_fill_style(&self.white_piece);
                             self.context.set_stroke_style(&self.white_piece_line);
                         },
                     }
 
-                    if piece.strength == King {
+                    if piece.strength == King {
                         self.context.set_stroke_style(&self.king_line);
                     }
 
@@ -742,8 +739,8 @@
                         0.0, // start angle
                         f64::consts::PI * 2.0) // end angle
                     {
-                        Ok(res) => res,
-                        Err(err) => log!("Failed to draw piece, idx: {}, square: {:?}, {:?}", idx, square, err),
+                        Ok(res) => res,
+                        Err(err) => log!("Failed to draw piece, idx: {}, square: {:?}, {:?}", idx, square, err),
                     };
                     self.context.fill();
 
@@ -753,7 +750,7 @@
                     }
 
                 },
-                None => panic!("No piece found when attempting to draw, idx: {}, square: {:?}", idx, square),
+                None => panic!("No piece found when attempting to draw, idx: {}, square: {:?}", idx, square),
             }
         }
 
@@ -772,8 +769,8 @@
                 0.0, // start angle
                 f64::consts::PI * 2.0) // end angle
             {
-                Ok(res) => res,
-                Err(err) => log!("Failed to paint selected piece, idx: {}, {:?}", selected_idx, err),
+                Ok(res) => res,
+                Err(err) => log!("Failed to paint selected piece, idx: {}, {:?}", selected_idx, err),
             };
             self.context.fill();
 
@@ -783,6 +780,6 @@
             }
         }
     }
-}
+}
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/src/draught/utils.rs.html b/doc/src/draught/utils.rs.html index bff7bf9..e37329a 100644 --- a/doc/src/draught/utils.rs.html +++ b/doc/src/draught/utils.rs.html @@ -1,7 +1,5 @@ -utils.rs - source - -
 1
+utils.rs - source
+    
 1
  2
  3
  4
@@ -11,8 +9,7 @@
  8
  9
 10
-
-pub fn set_panic_hook() {
+
pub fn set_panic_hook() {
     // When the `console_error_panic_hook` feature is enabled, we can call the
     // `set_panic_hook` function at least once during initialization, and then
     // we will get better error messages if our code ever panics.
@@ -22,6 +19,6 @@
     #[cfg(feature = "console_error_panic_hook")]
     console_error_panic_hook::set_once();
 }
-
+
- \ No newline at end of file + \ No newline at end of file diff --git a/doc/storage.js b/doc/storage.js index 9a98fff..6b16cbd 100644 --- a/doc/storage.js +++ b/doc/storage.js @@ -1 +1 @@ -var resourcesSuffix="";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed!==true){for(i=0;i=0;--i){if(func(arr[i])===true){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function hasOwnProperty(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function updateLocalStorage(name,value){try{window.localStorage.setItem(name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem(name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var fullBasicCss="rustdoc"+resourcesSuffix+".css";var fullNewTheme=newTheme+resourcesSuffix+".css";var newHref=mainStyleElem.href.replace(fullBasicCss,fullNewTheme);if(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found===true){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("rustdoc-use-system-theme",value);var toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}var updateSystemTheme=(function(){if(!window.matchMedia){return function(){var cssTheme=getComputedStyle(document.documentElement).getPropertyValue('content');switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}var mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){if(getSettingValue("use-system-theme")!=="false"){var lightTheme=getSettingValue("preferred-light-theme")||"light";var darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){switchTheme(window.currentTheme,window.mainTheme,darkTheme,true)}else{switchTheme(window.currentTheme,window.mainTheme,lightTheme,true)}}}mql.addListener(handlePreferenceChange);return function(){handlePreferenceChange(mql)}})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} \ No newline at end of file +var resourcesSuffix="";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} \ No newline at end of file diff --git a/doc/toggle-minus.svg b/doc/toggle-minus.svg new file mode 100644 index 0000000..7315478 --- /dev/null +++ b/doc/toggle-minus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/doc/toggle-plus.svg b/doc/toggle-plus.svg new file mode 100644 index 0000000..08b1703 --- /dev/null +++ b/doc/toggle-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file