wip
This commit is contained in:
parent
a3bcdb8912
commit
ff5ff74282
5 changed files with 25 additions and 0 deletions
|
|
@ -315,6 +315,7 @@ impl GameState {
|
|||
if self.turn_stage != TurnStage::Move
|
||||
&& self.turn_stage != TurnStage::HoldOrGoChoice
|
||||
{
|
||||
error!("bad stage {:?}", self.turn_stage);
|
||||
return false;
|
||||
}
|
||||
let color = &self.players[player_id].color;
|
||||
|
|
@ -326,6 +327,7 @@ impl GameState {
|
|||
*moves
|
||||
};
|
||||
if !rules.moves_follow_rules(&moves) {
|
||||
error!("rules not followed ");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ impl MoveRules {
|
|||
|
||||
/// ---- moves_possibles : First of three checks for moves
|
||||
fn moves_possible(&self, moves: &(CheckerMove, CheckerMove)) -> bool {
|
||||
println!("possible ???");
|
||||
let color = &Color::White;
|
||||
if let Ok(chained_move) = moves.0.chain(moves.1) {
|
||||
// Check intermediary move and chained_move : "Tout d'une"
|
||||
|
|
@ -84,6 +85,7 @@ impl MoveRules {
|
|||
|| !self.board.move_possible(color, &moves.1)
|
||||
{
|
||||
// Move is not physically possible
|
||||
println!("no phys! {} {:?}", self.board, moves);
|
||||
return false;
|
||||
}
|
||||
true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue