Fix forward classes declaration in kpat/dealer.h

This resolves FTBFS for cmake build with clang

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 7 years ago
parent 32b39efd3f
commit 9f2d40bba0

@ -679,42 +679,6 @@ void Dealer::enlargeCanvas(TQCanvasRectangle *c)
resizeEvent(0);
}
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 class TQValueList<CardState> CardStateList;
bool operator==( const State & st1, const State & st2) {

@ -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;

Loading…
Cancel
Save