mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
refactor: split board logic into logic module
This commit is contained in:
@@ -1,14 +1,13 @@
|
|||||||
use crate::logic::{
|
use crate::logic::{
|
||||||
field::Field,
|
board::{
|
||||||
|
field::Field,
|
||||||
|
pawn::{CapturePath, Pawn, PawnState},
|
||||||
|
},
|
||||||
math::{position::Position, vector::Vector2D},
|
math::{position::Position, vector::Vector2D},
|
||||||
pawn::{CapturePath, Pawn, PawnState},
|
|
||||||
player::Player,
|
player::Player,
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::{
|
use std::ops::{Index, IndexMut};
|
||||||
backtrace::BacktraceStatus::Captured,
|
|
||||||
ops::{Index, IndexMut},
|
|
||||||
};
|
|
||||||
|
|
||||||
use log::{debug, info, warn};
|
use log::{debug, info, warn};
|
||||||
|
|
||||||
@@ -463,7 +462,6 @@ impl IndexMut<Position> for Board {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::logic::pawn::PawnState;
|
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use crate::logic::{math::position::Position, pawn::Pawn};
|
use crate::logic::{board::pawn::Pawn, math::position::Position};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub struct Field {
|
pub struct Field {
|
||||||
3
src/logic/board/mod.rs
Normal file
3
src/logic/board/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
pub mod board;
|
||||||
|
mod field;
|
||||||
|
mod pawn;
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
mod board;
|
pub mod board;
|
||||||
mod field;
|
|
||||||
mod math;
|
mod math;
|
||||||
mod pawn;
|
|
||||||
mod player;
|
mod player;
|
||||||
|
|||||||
Reference in New Issue
Block a user