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

#include "move.h"

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

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 );
}