59 lines
1.3 KiB
Rust
59 lines
1.3 KiB
Rust
//! Test harness. Module 1 surface only; later modules add functions
|
|
//! (see course/harness.md). Replace each `todo!()` by delegating to your engine.
|
|
#![allow(unused_variables)]
|
|
|
|
pub type Id = u32;
|
|
pub type Player = u8;
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum Zone {
|
|
Deck,
|
|
Hand,
|
|
Board,
|
|
Graveyard,
|
|
}
|
|
|
|
#[derive(Debug, Default, Clone)]
|
|
pub struct GameOpts {
|
|
pub decks: Option<[Vec<String>; 2]>,
|
|
}
|
|
|
|
pub struct Game {}
|
|
|
|
pub fn new_game(opts: GameOpts) -> Game {
|
|
todo!()
|
|
}
|
|
|
|
impl Game {
|
|
/// Put `card` at the right end of `player`'s board.
|
|
pub fn summon(&mut self, card: &str, player: Player) -> Id {
|
|
todo!()
|
|
}
|
|
pub fn add_to_hand(&mut self, card: &str, player: Player) -> Id {
|
|
todo!()
|
|
}
|
|
pub fn add_to_deck(&mut self, card: &str, player: Player) -> Id {
|
|
todo!()
|
|
}
|
|
/// Play a card from hand (Expansion Drop).
|
|
pub fn play(&mut self, hand_id: Id) {
|
|
todo!()
|
|
}
|
|
pub fn zone_of(&self, id: Id) -> Zone {
|
|
todo!()
|
|
}
|
|
/// Board ids, left to right.
|
|
pub fn board(&self, player: Player) -> Vec<Id> {
|
|
todo!()
|
|
}
|
|
pub fn hand(&self, player: Player) -> Vec<Id> {
|
|
todo!()
|
|
}
|
|
pub fn order_of_play(&self, id: Id) -> u32 {
|
|
todo!()
|
|
}
|
|
pub fn name_of(&self, id: Id) -> String {
|
|
todo!()
|
|
}
|
|
}
|