Refactor project structure to use submodules

This commit is contained in:
stefiosif
2024-08-14 21:58:20 +03:00
parent 69cabd5b58
commit ed711f905d
21 changed files with 121 additions and 89 deletions

31
src/board/game.rs Normal file
View File

@@ -0,0 +1,31 @@
use crate::board::fen::from_fen;
use String as FenError;
use super::board::Board;
#[derive(Debug, PartialEq, Eq)]
pub struct Game {
pub board: Board,
}
impl Game {
pub const fn new() -> Self {
Self {
board: Board::new(),
}
}
pub fn new_from_fen(fen: &str) -> Result<Self, FenError> {
from_fen(fen)
}
pub const fn run(&self) {
Board::new();
}
}
impl Default for Game {
fn default() -> Self {
Self::new()
}
}