/***************************************************************************
 *   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.             *
 ***************************************************************************/
#include "unit.h"
Unit::~Unit()
{
	qDebug("destroy unit");
}

Unit::Unit( const QString & name ) : m_name(name)
{
	qDebug("new unit");
	m_damage = 0;
	m_hitpoints = 0;
	m_xPosition = 0;
	m_yPosition = 0;
	m_gold = 0;
}


int Unit::xPosition() const
{
	return m_xPosition;
}


void Unit::setXPosition ( int theValue )
{
	m_xPosition = theValue;
}


int Unit::yPosition() const
{
	return m_yPosition;
}


void Unit::setYPosition ( int theValue )
{
	m_yPosition = theValue;
}


int Unit::gold() const
{
	return m_gold;
}


void Unit::setGold( int theValue )
{
	m_gold = theValue;
}


QList< Item *> Unit::items() const
{
	return m_items;
}

void Unit::addItem( Item * value )
{
	m_items << value;
}

void Unit::removeItem( Item * value )
{
	m_items.removeAll( value );
}

