play state and menu state are separate now

This commit is contained in:
LinlyBoi
2023-05-06 17:50:59 +03:00
parent e42a30a4c6
commit 5bebf782eb

View File

@@ -1,14 +1,16 @@
use raylib::prelude::Color;
use crate::gamedata::{Board, Disk};
#[cfg(test)]
mod tests;
pub struct GameState {
pub struct PlayState {
pub circles: Vec<(i32, i32, Disk)>,
pub bottom: Vec<i32>,
pub player_turn: bool,
pub board: Board,
}
impl Default for GameState {
impl Default for PlayState {
fn default() -> Self {
Self {
circles: vec![],
@@ -18,3 +20,21 @@ impl Default for GameState {
}
}
}
pub struct MenuState {
difficulty: i32,
p1: (Color, Disk),
p2: (Color, Disk),
}
impl Default for MenuState {
fn default() -> Self {
Self {
difficulty: 3,
p1: (Color::RED, Disk::P1),
p2: (Color::YELLOW, Disk::P2),
}
}
}
pub enum GameState {
Play(PlayState),
MainMenu(MenuState),
}