move parts to new common component to avoid circular dependency of zonecommon and objcommon

This commit is contained in:
Jan
2021-03-03 12:56:15 -08:00
parent d616738be4
commit 12461d27e7
38 changed files with 70 additions and 22 deletions

View File

@ -1,13 +1,13 @@
#include "ObjContainerReferenceable.h"
void ObjContainerReferenceable::AddReference(Zone* referencer)
void ObjContainerReferenceable::AddReference(void* referencer)
{
m_references.insert(referencer);
}
bool ObjContainerReferenceable::RemoveReference(Zone* zone)
bool ObjContainerReferenceable::RemoveReference(void* referencer)
{
return m_references.erase(zone) > 0;
return m_references.erase(referencer) > 0;
}
bool ObjContainerReferenceable::IsReferenced() const

View File

@ -1,16 +1,15 @@
#pragma once
#include "IObjContainer.h"
#include "Zone/Zone.h"
#include <set>
class ObjContainerReferenceable : public IObjContainer
{
std::set<Zone*> m_references;
std::set<void*> m_references;
public:
void AddReference(Zone* referencer);
bool RemoveReference(Zone* zone);
void AddReference(void* referencer);
bool RemoveReference(void* referencer);
bool IsReferenced() const;
};