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

#include "move.h"

const pile::size_type move::dominance_flag = pile::max_size_type;

move::move(pile::ref f, pile::ref t, pile::size_type i) : from(f), to(t), count(i) {
    assert(i >= 1);
}

// Returns true is the move has been flagged as a special 'dominance' move
bool move::is_dominance() const {
    return count == dominance_flag;
}

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