Refactor project structure to use submodules
This commit is contained in:
31
src/board/game.rs
Normal file
31
src/board/game.rs
Normal 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user