refactor: split board logic into logic module

This commit is contained in:
2026-08-13 22:44:10 +02:00
parent 3b854b9b2f
commit 11ae3d9760
5 changed files with 10 additions and 11 deletions

View File

@@ -1,14 +1,13 @@
use crate::logic::{
field::Field,
board::{
field::Field,
pawn::{CapturePath, Pawn, PawnState},
},
math::{position::Position, vector::Vector2D},
pawn::{CapturePath, Pawn, PawnState},
player::Player,
};
use std::{
backtrace::BacktraceStatus::Captured,
ops::{Index, IndexMut},
};
use std::ops::{Index, IndexMut};
use log::{debug, info, warn};
@@ -463,7 +462,6 @@ impl IndexMut<Position> for Board {
#[cfg(test)]
mod tests {
use crate::logic::pawn::PawnState;
use super::*;

View File

@@ -1,6 +1,6 @@
use std::fmt;
use crate::logic::{math::position::Position, pawn::Pawn};
use crate::logic::{board::pawn::Pawn, math::position::Position};
#[derive(Debug, PartialEq, Eq)]
pub struct Field {

3
src/logic/board/mod.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod board;
mod field;
mod pawn;

View File

@@ -1,5 +1,3 @@
mod board;
mod field;
pub mod board;
mod math;
mod pawn;
mod player;