chore: add moving the pawn

This commit is contained in:
2026-08-11 22:49:23 +02:00
parent 52a9d795c0
commit 0d1a9cafbb
4 changed files with 188 additions and 24 deletions

View File

@@ -5,10 +5,26 @@ use uuid::Uuid;
pub struct Player {
pub name: String,
pub id: Uuid,
/// Row where players pawns turn into dames
pub end_row: usize,
}
impl Player {
pub fn new(name: String) -> Self {
Player {
name,
id: Uuid::new_v4(),
end_row: 0,
}
}
}
impl Display for Player {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "(name: {}, id, {})", self.name, self.id)
write!(
f,
"(name: {}, id: {}, end_row: {})",
self.name, self.id, self.end_row
)
}
}