36 lines
1.2 KiB
Rust
36 lines
1.2 KiB
Rust
use glib::ExitCode;
|
|
use rdraught::{DraughtsBoard, DraughtsGame, Move, Piece, Player, Position};
|
|
use rdraught_gtk::run;
|
|
use std::collections::HashMap;
|
|
|
|
fn main() -> ExitCode {
|
|
println!("move: {}", size_of::<Move>());
|
|
println!("game: {}", size_of::<DraughtsGame>());
|
|
|
|
// let boards = [[(Position::new(2, 4), Piece::CrownedRedPawn)]];
|
|
|
|
// for pieces in boards.into_iter() {
|
|
// let map = pieces.into_iter().collect::<HashMap<Position, Piece>>();
|
|
// let board = DraughtsBoard::new(|p| match map.get(&p) {
|
|
// None => Piece::NoPiece,
|
|
// Some(piece) => *piece,
|
|
// });
|
|
// println!("{:?}", board);
|
|
// for (pos, piece) in map.iter() {
|
|
// assert_eq!(*piece, board.get(*pos));
|
|
// }
|
|
// }
|
|
ExitCode::SUCCESS
|
|
// let mut pieces = HashMap::<Position, Piece>::new();
|
|
// pieces.insert(Position::new(2, 4), Piece::CrownedRedPawn);
|
|
// pieces.insert(Position::new(5, 5), Piece::CrownedWhitePawn);
|
|
// let game = DraughtsGame::new(
|
|
// |p| match pieces.get(&p) {
|
|
// None => Piece::NoPiece,
|
|
// Some(piece) => *piece,
|
|
// },
|
|
// Player::Red,
|
|
// );
|
|
// run(game)
|
|
}
|