diff options
| author | Charlie Blake | 2018-06-10 00:30:55 +0100 |
|---|---|---|
| committer | GitHub | 2018-06-10 00:30:55 +0100 |
| commit | d82642305dbcf53262ff41705a41c6e7c1591161 (patch) | |
| tree | b2bbe8c0aadaec16280f020e55eb55955be43d3f /src/main/game/move.cpp | |
| parent | Merge pull request #58 from thecharlesblake/fin (diff) | |
| parent | Finish refactoring game state class (diff) | |
| download | metasol-d82642305dbcf53262ff41705a41c6e7c1591161.tar.gz metasol-d82642305dbcf53262ff41705a41c6e7c1591161.zip | |
Merge pull request #59 from thecharlesblake/paper-tidy-up
Paper tidy up
Diffstat (limited to 'src/main/game/move.cpp')
| -rw-r--r-- | src/main/game/move.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/game/move.cpp b/src/main/game/move.cpp new file mode 100644 index 0000000..ff8269c --- /dev/null +++ b/src/main/game/move.cpp @@ -0,0 +1,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 ); +} |
