card game stuff

This commit is contained in:
2026-05-15 06:53:18 -07:00
parent 09edadc822
commit 77b38608d9
5 changed files with 428 additions and 4 deletions
+17 -3
View File
@@ -1,3 +1,4 @@
use crate::Rng;
use crate::card_game::{Card, Game, Stack};
struct Pile {
@@ -24,7 +25,7 @@ enum KlondikePileId {
Tableau6,
Tableau7,
}
struct KlondikeMove {
pub struct KlondikeInstruction {
src: KlondikePileId,
dst: KlondikePileId,
}
@@ -33,8 +34,21 @@ pub struct Klondike {
state: KlondikeState,
}
impl Klondike {
pub fn new() -> Self {
let deck = Stack::full_deck(0);
pub fn new(mut seed: Rng) -> Self {
let mut deck = Stack::full_deck(0);
deck.shuffle(&mut seed);
unimplemented!()
}
}
impl Game for Klondike {
type Instruction = KlondikeInstruction;
fn enumerate_instructions(&self) -> impl Iterator<Item = Self::Instruction> {
vec![].into_iter()
}
fn validate_instruction(&self, instruction: Self::Instruction) -> bool {
todo!()
}
fn process_instruction(&mut self, instruction: Self::Instruction) {
todo!()
}
}