#include "doorkeeper/doorkeeper2d.hpp"
#include "doorkeeper/helpers/maploader.hpp"
#include "doorkeeper/helpers/asciimapsource.hpp"
#include "doorkeeper/helpers/typename_native.hpp"
#include "gameConfig.h"
#include <iostream>

int main() {
	using dk::Tyler2d;
	using dk::coords2;
	using dk::Viewport2d;
	using dk::Layer2d;
	typedef dkh::MapLoaderPool2d<std::function<dk::BaseMapSource2d*(const std::string&)>> IntPoolType;

	std::cout << "Welcome to " GAME_NAME " v" << GAME_VER_MAJOR << '.' << GAME_VER_MINOR << '.' << GAME_VER_PATCH << '\n';

	IntPoolType pool;
	pool.opener = [](const std::string& parName) { std::cout << "Opening " << parName << std::endl; return new dkh::AsciiMapSource(parName, coords2(10, 8), dk::MapType_IsometricStaggered, coords2(64, 64)); };
	dkh::PushLayerMapType<2> pushers;
	pushers.insert(std::make_pair(dk::type_name_hash<int>(), &Tyler2d::push_layer_void<int>));
	Tyler2d tiler(dkh::call_map_load(pool, std::string("test_level.dk"), pushers));

	return 0;
}
