// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include namespace Nz { template ObjectRef ObjectLibrary::Get(const String& name) { ObjectRef ref = Query(name); if (!ref) NazaraError("Object \"" + name + "\" is not present"); return ref; } template bool ObjectLibrary::Has(const String& name) { return Type::s_library.find(name) != Type::s_library.end(); } template void ObjectLibrary::Register(const String& name, ObjectRef object) { Type::s_library.emplace(name, object); } template ObjectRef ObjectLibrary::Query(const String& name) { auto it = Type::s_library.find(name); if (it != Type::s_library.end()) return it->second; else return nullptr; } template void ObjectLibrary::Unregister(const String& name) { Type::s_library.erase(name); } template bool ObjectLibrary::Initialize() { return true; // Que faire } template void ObjectLibrary::Uninitialize() { Type::s_library.clear(); } } #include