00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _ROUND_H_
00022 #define _ROUND_H_
00023
00024 #include <vector>
00025 #include "tile.h"
00026 #include "coord.h"
00027
00028 using namespace std;
00029
00030
00031
00032
00033
00034
00035
00036
00037 class Round
00038 {
00039 public:
00040
00041
00042
00043
00044 Round();
00045 virtual ~Round() {}
00046 void init();
00047
00048
00049
00050
00051 void addRightFromBoard(Tile);
00052 void removeRightToBoard(Tile);
00053 void addRightFromRack(Tile, bool);
00054 void removeRightToRack(Tile, bool);
00055
00056
00057
00058
00059 void setPoints(int iPoints) { m_points = iPoints; }
00060 void setBonus(bool iBonus) { m_bonus = iBonus; }
00061 void setTile(int iIndex, const Tile &iTile) { m_word[iIndex] = iTile; }
00062 void setWord(const vector<Tile> &iTiles);
00063 void setFromRack(int iIndex);
00064 void setFromBoard(int iIndex);
00065 void setJoker(int iIndex, bool value = true);
00066
00067
00068
00069
00070 bool isJoker (int iIndex) const;
00071 bool isPlayedFromRack(int iIndex) const;
00072 const Tile& getTile (int iIndex) const;
00073
00074 string getWord() const;
00075 int getWordLen() const;
00076 int getPoints() const { return m_points; }
00077 int getBonus() const { return m_bonus; }
00078
00079
00080
00081
00082 const Coord& getCoord() const { return m_coord; }
00083 Coord& accessCoord() { return m_coord; }
00084
00085 string toString() const;
00086
00087 private:
00088 vector<Tile> m_word;
00089 vector<char> m_tileOrigin;
00090 Coord m_coord;
00091 int m_points;
00092 int m_bonus;
00093 };
00094
00095 #endif
00096
00097
00098
00099
00100
00101
00102