game start

This commit is contained in:
Adam 2024-04-12 02:35:35 -04:00
parent e393e1ad99
commit 48a968d800
2 changed files with 19 additions and 2 deletions

View file

@ -163,7 +163,10 @@ impl CAHGame {
/// Create a new player and add them to the game. /// Create a new player and add them to the game.
pub fn create_player(&mut self, mut player: CAHPlayer) -> Result<()> { pub fn create_player(&mut self, mut player: CAHPlayer) -> Result<()> {
println!("Creating player {} as {:?}", &player.player_name, &player.role); println!(
"Creating player {} as {:?}",
&player.player_name, &player.role
);
let mut hand_buf = vec![]; let mut hand_buf = vec![];
for _ in 0..10 { for _ in 0..10 {
@ -176,4 +179,17 @@ impl CAHGame {
Ok(()) Ok(())
} }
pub fn game_start(&mut self) -> Result<()> {
self.game_active = true;
println!("Game Active!");
if let Some(black) = &self.current_black {
println!("{}", black.text);
} else {
println!("YOU DONE FUCKED UP (no current black card)");
}
Ok(())
}
} }

View file

@ -45,6 +45,7 @@ fn main() -> Result<()> {
// ready player 1 // ready player 1
let _ = games[0].create_player(test_player1); let _ = games[0].create_player(test_player1);
// start round
let _ = games[0].game_start();
Ok(()) Ok(())
} }