mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
27 lines
425 B
Rust
27 lines
425 B
Rust
use uuid::Uuid;
|
|
|
|
use crate::logic::{player::Player, utils::Position};
|
|
|
|
#[derive(PartialEq, Eq, Debug)]
|
|
pub enum PawnState {
|
|
Man,
|
|
Dame,
|
|
Captured,
|
|
}
|
|
|
|
/// Basic pawn
|
|
#[derive(Debug, PartialEq, Eq)]
|
|
pub struct Pawn {
|
|
pub state: PawnState,
|
|
pub owner: Uuid,
|
|
}
|
|
|
|
impl Pawn {
|
|
pub fn new(owner: &Player) -> Self {
|
|
Self {
|
|
state: PawnState::Man,
|
|
owner: owner.id,
|
|
}
|
|
}
|
|
}
|