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

Diff of /eliot/game/player.cpp

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

revision 1.7 by ipkiss, Sat Nov 5 23:57:41 2005 UTC revision 1.8 by ipkiss, Sun Nov 6 14:53:15 2005 UTC
# Line 24  Line 24 
24  #include "results.h"  #include "results.h"
25  #include "board.h"  #include "board.h"
26  #include "player.h"  #include "player.h"
27    #include "turn.h"
28    
29  #include "debug.h"  #include "debug.h"
30    
# Line 36  Player::Player() Line 37  Player::Player()
37    
38  Player::~Player()  Player::~Player()
39  {  {
40      for (unsigned int i = 0; i < m_playedRacks.size(); i++)      for (unsigned int i = 0; i < m_history.size(); i++)
41          delete m_playedRacks[i];          delete m_history[i];
     for (unsigned int i = 0; i < m_rounds.size(); i++)  
         delete m_rounds[i];  
42  }  }
43    
44    
# Line 57  void Player::setCurrentRack(const Played Line 56  void Player::setCurrentRack(const Played
56    
57  const PlayedRack & Player::getLastRack() const  const PlayedRack & Player::getLastRack() const
58  {  {
59      return *m_playedRacks.back();      return m_history.back()->getPlayedRack();
60  }  }
61    
62    
63  const Round & Player::getLastRound() const  const Round & Player::getLastRound() const
64  {  {
65      return *m_rounds.back();      return m_history.back()->getRound();
66  }  }
67    
68    
# Line 74  const Round & Player::getLastRound() con Line 73  const Round & Player::getLastRound() con
73   */   */
74  void Player::endTurn(const Round &iRound, int iTurn)  void Player::endTurn(const Round &iRound, int iTurn)
75  {  {
76      m_turns.push_back(iTurn);      // FIXME: the number of the player is wrong here!
77      m_rounds.push_back(new Round(iRound));      m_history.push_back(new Turn(iTurn, iTurn, m_pldrack, iRound));
     m_playedRacks.push_back(new PlayedRack(m_pldrack));  
78    
79      Rack rack;      Rack rack;
80      m_pldrack.getRack(rack);      m_pldrack.getRack(rack);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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