Core: Add ObjectLibrary::Clear
This commit is contained in:
parent
217d971fe7
commit
eeaaebb15c
|
|
@ -118,6 +118,7 @@ Nazara Engine:
|
||||||
- SocketPoller will now silently ignore "interrupt errors"
|
- SocketPoller will now silently ignore "interrupt errors"
|
||||||
- Added RigidBody2D::ClosestPointQuery
|
- Added RigidBody2D::ClosestPointQuery
|
||||||
- Fix Sprite copy constructor not copying corner colors
|
- Fix Sprite copy constructor not copying corner colors
|
||||||
|
- Added ObjectLibrary::Clear method
|
||||||
|
|
||||||
Nazara Development Kit:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ namespace Nz
|
||||||
ObjectLibrary() = delete;
|
ObjectLibrary() = delete;
|
||||||
~ObjectLibrary() = delete;
|
~ObjectLibrary() = delete;
|
||||||
|
|
||||||
|
static void Clear();
|
||||||
|
|
||||||
static ObjectRef<Type> Get(const String& name);
|
static ObjectRef<Type> Get(const String& name);
|
||||||
static bool Has(const String& name);
|
static bool Has(const String& name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Core module"
|
// This file is part of the "Nazara Engine - Core module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/ObjectLibrary.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
|
@ -9,10 +10,19 @@ namespace Nz
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \class Nz::ObjectRef
|
* \class Nz::ObjectLibrary
|
||||||
* \brief Core class that represents a reference to an object
|
* \brief Core class containing a collection of objects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Clears the library, freeing every object it contains
|
||||||
|
*/
|
||||||
|
template<typename Type>
|
||||||
|
void ObjectLibrary<Type>::Clear()
|
||||||
|
{
|
||||||
|
Type::s_library.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Gets the ObjectRef object by name
|
* \brief Gets the ObjectRef object by name
|
||||||
* \return Optional reference
|
* \return Optional reference
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue