/***************************************************************************
 *   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 <QApplication>
#include <QTableView>

#include "boardmodel.h"
#include <player.h>
#include <human.h>
#include <warrior.h>
#include <leather.h>
#include <shortsword.h>
#include <bandit.h>
#include "reference.h"

int main( int argc, char ** argv )
{
	qRegisterMetaType<Bandit>("Bandit");
	QApplication app( argc, argv);
	Player *pl = new Player("Blackfoot", new HumanMale(), new Warrior());
	pl->wield( new ShortSword() );
	pl->wear( new Leather() );

	Monster *bn = Monster::monsterFactory("Bandit");

	qDebug("Your HP: %d", pl->hitpoints() );
	qDebug("Monster HP: %d", bn->hitpoints() );

	BoardModel model;
	model.addPlayer(pl, 1,1 );
	model.addMonster(bn, 2,1 );
	model.movePlayerRight();

	while (pl->hitpoints() > 0 && pl->xPosition() != 2)
	{
// 		qDebug("Your HP: %d", pl->hitpoints() );
// 		qDebug("Monster HP: %d", bn->hitpoints() );

		model.movePlayerRight();
	}

	if( pl->hitpoints() > 0 )
		qDebug("Pos: %d, %d", pl->xPosition(), pl->yPosition());
	return 1;
}

