#include <Engine\GGEMain.h>
#include <Resource\DataArray.h>
#include <Human.h>
#include <Object.h>
#include <Tile.h>
#include <CitizenClass.h>
#include <iostream>
#include <Utils\Point2D.h>


int Application(std::vector<std::string> &arguments) { return EXIT_SUCCESS; }

int main()
{
	gge::Main.InitializeResource();

	gge::resource::File resource;
	resource.AddGameLoaders();
	resource.LoadFile("Resource.gor");
	resource.Prepare();
	gge::resource::DataArray &humanInfo = resource.Root().Get<gge::resource::DataArray>(0);
	gge::resource::DataArray &townfolksInfo = resource.Root().Get<gge::resource::DataArray>(1);
	gge::resource::DataArray &objectInfo = resource.Root().Get<gge::resource::DataArray>(2);
	gge::resource::DataArray &baseTileInfo = resource.Root().Get<gge::resource::DataArray>(3);
	gge::resource::DataArray &tileInfo = resource.Root().Get<gge::resource::DataArray>(4);
	gge::resource::DataArray &predefinedStatsInfo = resource.Root().Get<gge::resource::DataArray>(5);
	gge::resource::DataArray &buildingInfo = resource.Root().Get<gge::resource::DataArray>(6);

	assets::Townfolks townfolk;
	assets::Object object;
	assets::BaseTile baseTile;
	assets::Tile tile;
	assets::TownBuilding building;

	assets::human::load(humanInfo);
	assets::human::loadGenderStats(predefinedStatsInfo);
	townfolk.load(townfolksInfo);
	object.load(objectInfo);
	baseTile.load(baseTileInfo);
	tile.load(tileInfo);
	building.load(buildingInfo);

	std::cout << assets::human::HPBase				   << std::endl
			  << assets::human::HPVitMultiplier		   << std::endl
			  << assets::human::HPLvlMultiplier		   << std::endl
			  << assets::human::staminaBase			   << std::endl
			  << assets::human::staminaVitMultiplier	   << std::endl
			  << assets::human::staminaStrMultiplier	   << std::endl
			  << assets::human::staminaLvlMultiplier	   << std::endl
			  << assets::human::movementBase			   << std::endl
			  << assets::human::movementSpdMultiplier   << std::endl
			  << assets::human::movementLvlMultiplier   << std::endl
			  << assets::human::daySightBase			   << std::endl
			  << assets::human::daySightVitMultiplier   << std::endl
			  << assets::human::daySightIntlMultiplier  << std::endl
			  << assets::human::daySightLvlMultiplier   << std::endl
			  << assets::human::nightSightBase		   << std::endl
			  << assets::human::nightSightVitMultiplier << std::endl
			  << assets::human::nightSightLvlMultiplier << std::endl
			  << "//" << std::endl
			  << townfolk.name << std::endl
			  << townfolk.odds << std::endl
			  << townfolk.totalStats.value << std::endl
			  << townfolk.totalStats.range << std::endl;


	for(int i = 0; i < object.nonPassablePoints.size(); ++i)
	{
		gge::utils::Point a = object.nonPassablePoints[i];
		std::cout << a.x << " " << a.y << std::endl;
	}

	std::cout << baseTile.ID << std::endl << baseTile.movementModifier << std::endl << baseTile.isWalkable << std::endl;
	std::cout << tile.ID << std::endl << tile.forceNotWalkable << std::endl;

	std::cout << assets::human::maleStats.str << std::endl <<
			assets::human::maleStats.dex << std::endl <<
			assets::human::maleStats.acc <<std::endl <<
			assets::human::maleStats.spe <<std::endl <<
			assets::human::maleStats.intl <<std::endl <<
			assets::human::maleStats.vit <<std::endl;

	std::cout << assets::human::femaleStats.str << std::endl <<
		assets::human::femaleStats.dex << std::endl <<
		assets::human::femaleStats.acc <<std::endl <<
		assets::human::femaleStats.spe <<std::endl <<
		assets::human::femaleStats.intl <<std::endl <<
		assets::human::femaleStats.vit <<std::endl;

	std::cout << "building info" << std::endl;
	std::cout << building.ID << std::endl
		<< building.size.x <<"  "<<building.size.y << std::endl
		<< building.spacingRequirement << std::endl
		<< building.odds << std::endl
		<< building.HP.value << std::endl
		<< building.HP.range << std::endl;
	for(int i = 0; i < building.nonPassablePoints.size(); ++i)
	{
		gge::utils::Point a = object.nonPassablePoints[i];
		std::cout << a.x << " " << a.y << std::endl;
	}


	std::cin.sync();
	std::cin.ignore();
	return EXIT_SUCCESS;
}