eliot/game/player.cpp

82 lines
1.9 KiB
C++
Raw Normal View History

/*****************************************************************************
2005-02-09 23:33:56 +01:00
* Copyright (C) 2004-2005 Eliot
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*****************************************************************************/
#include "tile.h"
#include "rack.h"
#include "pldrack.h"
#include "round.h"
#include "results.h"
#include "board.h"
#include "player.h"
#include "turn.h"
#include "history.h"
#include "debug.h"
Player::Player(int iId)
{
m_id = iId;
m_score = 0;
}
Player::~Player()
{
}
2005-02-09 23:33:56 +01:00
const PlayedRack & Player::getCurrentRack() const
{
return m_history.getCurrentRack();
}
2005-02-09 23:33:56 +01:00
void Player::setCurrentRack(const PlayedRack &iPld)
{
m_history.setCurrentRack(iPld);
2005-02-09 23:33:56 +01:00
}
const PlayedRack & Player::getLastRack() const
{
return m_history.getPreviousTurn().getPlayedRack();
}
const Round & Player::getLastRound() const
{
return m_history.getPreviousTurn().getRound();
}
void Player::endTurn(const Round &iRound, int iTurn)
{
m_history.playRound(m_id,iTurn,iRound);
}
/****************************************************************/
/****************************************************************/
/// Local Variables:
/// mode: c++
/// mode: hs-minor
/// c-basic-offset: 4
/// End: