summaryrefslogtreecommitdiffstats
path: root/kpat/dealer.h
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2017-03-21 20:34:50 +0100
committerSlávek Banko <[email protected]>2017-03-21 20:37:55 +0100
commitb5698a72640862e4011b7cb06ccfc0dabde71bdd (patch)
tree511a08a9094b827ec13787d37cc715c7afad75ca /kpat/dealer.h
parent3114a44afde1b52fe206dbe6bf72401d276d3e88 (diff)
downloadtdegames-b5698a72640862e4011b7cb06ccfc0dabde71bdd.tar.gz
tdegames-b5698a72640862e4011b7cb06ccfc0dabde71bdd.zip
Fix forward classes declaration in kpat/dealer.h
This resolves FTBFS for cmake build with clang Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 9f2d40bba0a57d4a28f8bb47b5a5dde4e8742444)
Diffstat (limited to 'kpat/dealer.h')
-rw-r--r--kpat/dealer.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/kpat/dealer.h b/kpat/dealer.h
index 7dfc5825..0704433b 100644
--- a/kpat/dealer.h
+++ b/kpat/dealer.h
@@ -3,6 +3,7 @@
#include "pile.h"
#include "hint.h"
+#include <tqdom.h>
#include <krandomsequence.h>
class TQDomDocument;
@@ -38,7 +39,41 @@ public:
virtual Dealer *createGame(TDEMainWindow *parent) = 0;
};
-class CardState;
+class CardState {
+public:
+ Card *it;
+ Pile *source;
+ double x;
+ double y;
+ double z;
+ bool faceup;
+ bool tookdown;
+ int source_index;
+ CardState() {}
+public:
+ // as every card is only once we can sort after the card.
+ // < is the same as <= in that context. == is different
+ bool operator<(const CardState &rhs) const { return it < rhs.it; }
+ bool operator<=(const CardState &rhs) const { return it <= rhs.it; }
+ bool operator>(const CardState &rhs) const { return it > rhs.it; }
+ bool operator>=(const CardState &rhs) const { return it > rhs.it; }
+ bool operator==(const CardState &rhs) const {
+ return (it == rhs.it && source == rhs.source && x == rhs.x &&
+ y == rhs.y && z == rhs.z && faceup == rhs.faceup
+ && source_index == rhs.source_index && tookdown == rhs.tookdown);
+ }
+ void fillNode(TQDomElement &e) const {
+ e.setAttribute("value", it->rank());
+ e.setAttribute("suit", it->suit());
+ e.setAttribute("source", source->index());
+ e.setAttribute("x", x);
+ e.setAttribute("y", y);
+ e.setAttribute("z", z);
+ e.setAttribute("faceup", faceup);
+ e.setAttribute("tookdown", tookdown);
+ e.setAttribute("source_index", source_index);
+ }
+};
typedef TQValueList<CardState> CardStateList;