Skip to content

Commit

Permalink
upgrade to shakmaty 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvitali001 committed Nov 13, 2017
1 parent 5dc081b commit 2aee468
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rsvg = "0.2.0"
time = "0.1"
relm = "0.10"
relm-derive = "0.10"
shakmaty = "0.3"
shakmaty = "0.4"

[dev-dependencies]
rand = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion src/ground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl Update for Ground {
GroundMsg::UserMove(orig, dest, None) if state.board_state.valid_move(orig, dest) => {
if state.board_state.legals().iter().any(|m| m.from() == Some(orig) && m.to() == dest && m.promotion().is_some()) {
let color = state.pieces.figurine_at(orig).map_or_else(|| {
Color::from_bool(dest.rank() > 4)
Color::from_white(dest.rank() > 4)
}, |figurine| figurine.piece().color);
state.promotable.start(color, orig, dest);
self.drawing_area.queue_draw();
Expand Down
2 changes: 1 addition & 1 deletion src/promotable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl Promotable {

impl Promoting {
fn orientation(&self) -> Color {
Color::from_bool(self.dest.rank() > 4)
Color::from_white(self.dest.rank() > 4)
}

fn draw(&self, cr: &Context, state: &BoardState) {
Expand Down

0 comments on commit 2aee468

Please sign in to comment.