#include <core/engine.h>
#include <modules/detour/detour-navmesh.h>
#include "register_types.h"
#include "world_generator.h"
#include "density_map.h"
#include "world_map_data.h"
#include "characters.h"
#include "smart_object.h"
#include "road_map.h"
#include "world_height_map.h"
#include "road_grid.h"
#include "roads.h"
#include "spawner.h"
#include "traffic.h"

void register_world_types()
{
	RoadMap::create_singleton();
	Engine::get_singleton()->add_singleton(Engine::Singleton("RoadMap", RoadMap::get_singleton()));
	WorldMapData::create_singleton();
	Engine::get_singleton()->add_singleton(Engine::Singleton("WorldMapData", WorldMapData::get_singleton()));
	RoadsData::create_singleton();
	Engine::get_singleton()->add_singleton(Engine::Singleton("RoadsData", RoadsData::get_singleton()));
	Spawner::create_singleton();
	Engine::get_singleton()->add_singleton(Engine::Singleton("Spawner", Spawner::get_singleton()));
	Traffic::create_singleton();
	Engine::get_singleton()->add_singleton(Engine::Singleton("Traffic", Traffic::get_singleton()));
	ClassDB::register_class<WorldGenerator>();
	ClassDB::register_class<WorldHeightMap>();
	ClassDB::register_class<DensityMap>();
	ClassDB::register_class<Characters_>();
	ClassDB::register_class<SmartObject>();
	ClassDB::register_class<SmartObjectManager>();
	ClassDB::register_class<SmartObjectGroup>();
	ClassDB::register_virtual_class<RoadGrid>();
	ClassDB::register_class<Roads>();
}

void unregister_world_types()
{
	RoadsData::destroy_singleton();
	Spawner::destroy_singleton();
	Traffic::destroy_singleton();
	WorldMapData::destroy_singleton();
}

