tweaks
This commit is contained in:
@@ -6,6 +6,11 @@ pub trait Game {
|
|||||||
fn process_instruction(&mut self, instruction: Self::Instruction);
|
fn process_instruction(&mut self, instruction: Self::Instruction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// An identifier which specifies the deck id, suit, and card value.
|
||||||
|
/// 2 bits for deck ID
|
||||||
|
/// 2 bits for suit ID
|
||||||
|
/// 4 bits for card Value
|
||||||
|
/// TODO: better encoding for slightly more decks
|
||||||
pub struct Card(u8);
|
pub struct Card(u8);
|
||||||
pub struct CardValue(deranged::RangedU8<1, 13>);
|
pub struct CardValue(deranged::RangedU8<1, 13>);
|
||||||
pub enum Suit {
|
pub enum Suit {
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ struct KlondikeMove {
|
|||||||
src: KlondikePileId,
|
src: KlondikePileId,
|
||||||
dst: KlondikePileId,
|
dst: KlondikePileId,
|
||||||
}
|
}
|
||||||
pub struct KlondikeGame {
|
pub struct Klondike {
|
||||||
config: KlondikeConfig,
|
config: KlondikeConfig,
|
||||||
state: KlondikeState,
|
state: KlondikeState,
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -1,2 +1,7 @@
|
|||||||
mod card_game;
|
pub mod card_game;
|
||||||
mod klondike;
|
pub mod klondike;
|
||||||
|
|
||||||
|
// test readme
|
||||||
|
#[doc = include_str!("../README.md")]
|
||||||
|
#[cfg(doctest)]
|
||||||
|
struct ReadmeDoctests;
|
||||||
|
|||||||
Reference in New Issue
Block a user