/***************************************************************************
 *   Copyright (C) 2004 by ian reinhart geiser                             *
 *   ian@geiseri.com                                                       *
 *                                                                         *
 *   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.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef PLAYER_H
#define PLAYER_H
#include <qmap.h>
#include <qstring.h>

#include <util.h>
#include <unit.h>
#include "reference.h"

class Race;
class Group;
class Wepon;
class Armor;
class Monster;
/**
This is the main player class.  It contains all information to manipulate the player in the game.

@author ian reinhart geiser
*/
class Player : public Unit
{
	public:
		Player( QString name, Race *race, Group *group);

		~Player();

		int strength() const;
		int dexterity() const;
		int wisdom() const;
		int experiance() const;
		int manna() const;
		int karma() const;
		bool save(const QString &vs) const;

		int skill( const QString &skill )const;
		void train( const QString &skill, int points = 1 );

		void rest();
		void pray();

		int toHit(Attack at, Armor *ac ) const;
		bool cast( Monster *mon, const QString &spell) const;
		bool melee( Unit *unit, Attack at ) const;

		bool wield(  Wepon *wep );
		bool wear(  Armor *arm );

		int morale() const;
		QPixmap sprite() const;


	private:
		int m_strength;
		int m_dexterity;
		int m_wisdom;
		int m_experiance;
		int m_manna;
		int m_karma;
		int m_gold;

		int m_karmaUsed;
		int m_mannaUsed;

		QString m_name;
		Race *m_race;
		Group *m_group;

		QMap<QString, int> m_skills;
		QMap<QString, int> m_saves;

};

#endif

