summaryrefslogtreecommitdiffstats
path: root/kbackgammon/kbgstatus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbackgammon/kbgstatus.cpp')
-rw-r--r--kbackgammon/kbgstatus.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp
index e9e8d4e5..824ff721 100644
--- a/kbackgammon/kbgstatus.cpp
+++ b/kbackgammon/kbgstatus.cpp
@@ -29,7 +29,7 @@
/*
* Parse a rawboard description from FIBS and initialize members.
*/
-KBgtqStatus::KBgtqStatus(const TQString &rawboard)
+KBgStatus::KBgStatus(const TQString &rawboard)
{
/*
* This is the format string from hell...
@@ -116,7 +116,7 @@ KBgtqStatus::KBgtqStatus(const TQString &rawboard)
* Constructor initializes the status to an empty board with cube one
* and empty dice.
*/
-KBgtqStatus::KBgtqStatus()
+KBgStatus::KBgStatus()
: TQObject()
{
/*
@@ -146,7 +146,7 @@ KBgtqStatus::KBgtqStatus()
/*
* Copy constructor calls private utility function.
*/
-KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs)
+KBgStatus::KBgStatus(const KBgStatus &rhs)
: TQObject()
{
copy(rhs);
@@ -155,7 +155,7 @@ KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs)
/*
* Destructor
*/
-KBgtqStatus::~KBgtqStatus()
+KBgStatus::~KBgStatus()
{
// nothing to do
}
@@ -164,14 +164,14 @@ KBgtqStatus::~KBgtqStatus()
* Assignment operator shares a lot of code with the copy
* constructor.
*/
-KBgtqStatus& KBgtqStatus::operator=(const KBgtqStatus &rhs)
+KBgStatus& KBgStatus::operator=(const KBgStatus &rhs)
{
if (this == &rhs) return *this;
copy(rhs);
return *this;
}
-void KBgtqStatus::copy(const KBgtqStatus &rhs)
+void KBgStatus::copy(const KBgStatus &rhs)
{
for (int i = 0; i < 26; i++)
board_[i] = rhs.board_[i];
@@ -199,32 +199,32 @@ void KBgtqStatus::copy(const KBgtqStatus &rhs)
/*
* Access functions
*/
-int KBgtqStatus::board(const int &i) const
+int KBgStatus::board(const int &i) const
{
return ((0 < i && i < 25) ? color_*board_[i] : 0);
}
-int KBgtqStatus::home(const int &w) const
+int KBgStatus::home(const int &w) const
{
return ((w == US || w == THEM) ? color_*home_[w] : 0);
}
-int KBgtqStatus::bar(const int &w) const
+int KBgStatus::bar(const int &w) const
{
return ((w == US || w == THEM) ? color_*bar_[w] : 0);
}
-int KBgtqStatus::color(const int &w) const
+int KBgStatus::color(const int &w) const
{
return ((w == THEM) ? -color_ : color_);
}
-int KBgtqStatus::direction() const
+int KBgStatus::direction() const
{
return direction_;
}
-int KBgtqStatus::dice(const int &w, const int &n) const
+int KBgStatus::dice(const int &w, const int &n) const
{
if ((w == US || w == THEM) && (n == 0 || n == 1))
return dice_[w][n];
@@ -232,34 +232,34 @@ int KBgtqStatus::dice(const int &w, const int &n) const
return 0;
}
-int KBgtqStatus::cube(const int &w) const
+int KBgStatus::cube(const int &w) const
{
if (w == US || w == THEM)
return ((maydouble_[w]) ? cube_ : -cube_);
return 0;
}
-int KBgtqStatus::points(const int& w) const
+int KBgStatus::points(const int& w) const
{
return ((w == US || w == THEM) ? points_[w] : -1);
}
-TQString KBgtqStatus::player(const int &w) const
+TQString KBgStatus::player(const int &w) const
{
return ((w == US || w == THEM) ? player_[w] : TQString());
}
-int KBgtqStatus::length() const
+int KBgStatus::length() const
{
return length_;
}
-int KBgtqStatus::turn() const
+int KBgStatus::turn() const
{
return turn_;
}
-bool KBgtqStatus::doubled() const
+bool KBgStatus::doubled() const
{
return doubled_;
}
@@ -268,7 +268,7 @@ bool KBgtqStatus::doubled() const
/*
* Assignment functions
*/
-void KBgtqStatus::setBoard(const int &i, const int &w, const int &v)
+void KBgStatus::setBoard(const int &i, const int &w, const int &v)
{
if (0 < i && i < 25) {
if (w == US)
@@ -278,7 +278,7 @@ void KBgtqStatus::setBoard(const int &i, const int &w, const int &v)
}
}
-void KBgtqStatus::setHome(const int &w, const int &v)
+void KBgStatus::setHome(const int &w, const int &v)
{
if (w == US)
home_[w] = abs(v);
@@ -286,7 +286,7 @@ void KBgtqStatus::setHome(const int &w, const int &v)
home_[w] = -abs(v);
}
-void KBgtqStatus::setBar(const int& w, const int& v)
+void KBgStatus::setBar(const int& w, const int& v)
{
if (w == US)
bar_[w] = abs(v);
@@ -294,7 +294,7 @@ void KBgtqStatus::setBar(const int& w, const int& v)
bar_[w] = -abs(v);
}
-void KBgtqStatus::setColor(const int &c, const int &w)
+void KBgStatus::setColor(const int &c, const int &w)
{
if (w == US)
color_ = ((c < 0) ? Black : White);
@@ -302,12 +302,12 @@ void KBgtqStatus::setColor(const int &c, const int &w)
color_ = ((c < 0) ? White : Black);
}
-void KBgtqStatus::setDirection(const int &dir)
+void KBgStatus::setDirection(const int &dir)
{
direction_ = ((dir < 0) ? -1 : +1);
}
-void KBgtqStatus::setDice(const int &w, const int &n, const int &v)
+void KBgStatus::setDice(const int &w, const int &n, const int &v)
{
if ((w == US || w == THEM) && (n == 0 || n == 1)) {
if (0 <= v && v <= 6)
@@ -317,7 +317,7 @@ void KBgtqStatus::setDice(const int &w, const int &n, const int &v)
}
}
-void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them)
+void KBgStatus::setCube(const int &c, const bool &us, const bool &them)
{
int w = NONE;
if (us) w = US;
@@ -326,7 +326,7 @@ void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them)
setCube(c, w);
}
-void KBgtqStatus::setCube(const int &c, const int &w)
+void KBgStatus::setCube(const int &c, const int &w)
{
// assume that int has at least 32 bits...
for (int i = 0; i < 31; i++) {
@@ -337,24 +337,24 @@ void KBgtqStatus::setCube(const int &c, const int &w)
maydouble_[THEM] = (w == THEM || w == BOTH);
}
-void KBgtqStatus::setPoints(const int &w, const int &p)
+void KBgStatus::setPoints(const int &w, const int &p)
{
if (w == US || w == THEM)
points_[w] = p;
}
-void KBgtqStatus::setPlayer(const int &w, const TQString &name)
+void KBgStatus::setPlayer(const int &w, const TQString &name)
{
if (w == US || w == THEM)
player_[w] = name;
}
-void KBgtqStatus::setLength(const int &l)
+void KBgStatus::setLength(const int &l)
{
length_ = l;
}
-void KBgtqStatus::setTurn(const int &w)
+void KBgStatus::setTurn(const int &w)
{
if (w == US || w == THEM || w == BOTH)
turn_ = w;
@@ -364,7 +364,7 @@ void KBgtqStatus::setTurn(const int &w)
/*
* Utility functions
*/
-int KBgtqStatus::moves() const
+int KBgStatus::moves() const
{
int start, dir;
@@ -407,7 +407,7 @@ int KBgtqStatus::moves() const
* Get a copy of ourselves. That way we can mess around with
* the internals of the game.
*/
- KBgtqStatus sc(*this);
+ KBgStatus sc(*this);
/*
* Start with getting all checkers off the bar
@@ -490,7 +490,7 @@ int KBgtqStatus::moves() const
}
}
-bool KBgtqStatus::movePossible(KBgtqStatus &sc, int a, int start, int dir) const
+bool KBgStatus::movePossible(KBgStatus &sc, int a, int start, int dir) const
{
/*
* Determine where the first checker in moving direction is