/[eliot]/eliot/game/turn.cpp
ViewVC logotype

Diff of /eliot/game/turn.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.1 by afrab, Sun Oct 23 17:16:24 2005 UTC revision 1.2.2.2 by ipkiss, Sun Oct 23 20:58:20 2005 UTC
# Line 17  Line 17 
17  /* along with this program; if not, write to the Free Software               */  /* along with this program; if not, write to the Free Software               */
18  /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */  /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
19    
 /* $Id$ */  
   
20  /**  /**
21   *  \file   turn.cpp   *  \file   turn.cpp
22   *  \brief  Game turn (= id + pldrack + round)   *  \brief  Game turn (= id + pldrack + round)
23   *  \author Antoine Fraboulet   *  \author Antoine Fraboulet
24   *  \date   2005   *  \date   2005
25   */   */
# Line 34  Line 32 
32    
33  Turn::Turn()  Turn::Turn()
34  {  {
35      num     = 0;      m_num     = 0;
36      player  = 0;      m_player  = 0;
37      pldrack = PlayedRack();      m_pldrack = PlayedRack();
38      round   = Round();      m_round   = Round();
39  }  }
40        
41    
42  Turn::~Turn()  Turn::~Turn()
43  {  {
# Line 48  Turn::~Turn() Line 46  Turn::~Turn()
46    
47  void Turn::setNum(int n)  void Turn::setNum(int n)
48  {  {
49      num = n;      m_num = n;
50  }  }
51    
52    
53  void Turn::setPlayer(int p)  void Turn::setPlayer(int p)
54  {  {
55      player = p;      m_player = p;
56  }  }
57    
58    
59  void Turn::setPlayedRack(const PlayedRack &r)  void Turn::setPlayedRack(const PlayedRack &r)
60  {  {
61      pldrack = r;      m_pldrack = r;
62  }  }
63    
64  void Turn::setRound(const Round &r)  void Turn::setRound(const Round &r)
65  {  {
66      round = r;      m_round = r;
67  }  }
68    
69    
70  int Turn::getNum() const  int Turn::getNum() const
71  {  {
72      return num;      return m_num;
73  }  }
74    
75    
76  int Turn::getPlayer() const  int Turn::getPlayer() const
77  {  {
78      return player;      return m_player;
79  }  }
80    
81    
82  const PlayedRack& Turn::getPlayedRack() const  const PlayedRack& Turn::getPlayedRack() const
83  {  {
84      return pldrack;      return m_pldrack;
85  }  }
86    
87    
88  const Round& Turn::getRound() const  const Round& Turn::getRound() const
89  {  {
90      return round;      return m_round;
91  }  }
92    
93    
94  void  void Turn::operator=(const Turn &iOther)
 Turn::operator=(const Turn &iOther)  
95  {  {
96      num     = iOther.num;      m_num     = iOther.m_num;
97      pldrack = iOther.pldrack;      m_pldrack = iOther.m_pldrack;
98      round   = iOther.round;      m_round   = iOther.m_round;
99  }  }
100    
101    
102  std::string  std::string
103  Turn::toString(bool showExtraSigns) const  Turn::toString(bool showExtraSigns) const
104  {  {
105      std::string rs = "";      std::string rs = "";
106  #ifdef DEBUG  #ifdef DEBUG
107      char buff[10];      char buff[10];
108      sprintf(buff,"[n:%d,p:%d] ",num,player);      sprintf(buff, "[n:%d,p:%d] ", m_num, m_player);
109      rs += std::string(buff);      rs += std::string(buff);
110  #endif  #endif
111      rs += pldrack.toString(10,PlayedRack::RACK_EXTRA);      rs += m_pldrack.toString(10, PlayedRack::RACK_EXTRA);
112      rs += round.toString();      rs += m_round.toString();
113      return rs;      return rs;
114  }  }
115    
116    
117    
118  /// Local Variables:  /// Local Variables:
119  /// mode: hs-minor  /// mode: hs-minor
120  /// c-basic-offset: 4  /// c-basic-offset: 4

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26