aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/move.cpp
blob: c51a120005a0dc6ce2137c3548a8257f380d03d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
// Created by thecharlesblake on 07/06/18.
//

#include "move.h"

move::move(mtype ty, pile::ref f, pile::ref t, pile::size_type i, bool reveal_move_) :
        type(ty), from(f), to(t), count(i), reveal_move(reveal_move_) {
#ifndef NDEBUG
    if (ty == mtype::regular) assert(i == 1);
    else if (ty != mtype::stock_to_waste) assert(i >= 1);
#endif
}

void move::make_reveal_move() {
    reveal_move = true;
}

bool operator==(const move& a, const move& b) {
    return    (a.from     == b.from )
              && (a.to    == b.to   )
              && (a.count == b.count)
              && (a.type  == b.type )
              && (a.reveal_move == b.reveal_move);
}