mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-18 01:15:26 +00:00
CDependencyTree: Make use of unique_ptr
Makes the ownership semantics explicit in the interface.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#define CANIMEVENTDATA
|
||||
|
||||
#include "Core/Resource/CResource.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class CAnimEventData : public CResource
|
||||
{
|
||||
@@ -36,8 +38,7 @@ public:
|
||||
|
||||
if (ID.IsValid() && !pTree->HasDependency(ID))
|
||||
{
|
||||
auto *pDep = new CAnimEventDependency(ID, event.mCharacterIndex);
|
||||
pTree->AddChild(pDep);
|
||||
pTree->AddChild(std::make_unique<CAnimEventDependency>(ID, event.mCharacterIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,9 +124,9 @@ public:
|
||||
// Character dependencies
|
||||
for (const auto& character : mCharacters)
|
||||
{
|
||||
CSetCharacterDependency *pCharTree = CSetCharacterDependency::BuildTree(character);
|
||||
auto pCharTree = CSetCharacterDependency::BuildTree(character);
|
||||
ASSERT(pCharTree);
|
||||
pTree->AddChild(pCharTree);
|
||||
pTree->AddChild(std::move(pCharTree));
|
||||
}
|
||||
|
||||
// Animation dependencies
|
||||
@@ -134,9 +134,9 @@ public:
|
||||
{
|
||||
for (uint32 iAnim = 0; iAnim < mAnimations.size(); iAnim++)
|
||||
{
|
||||
CSetAnimationDependency *pAnimTree = CSetAnimationDependency::BuildTree(this, iAnim);
|
||||
auto pAnimTree = CSetAnimationDependency::BuildTree(this, iAnim);
|
||||
ASSERT(pAnimTree);
|
||||
pTree->AddChild(pAnimTree);
|
||||
pTree->AddChild(std::move(pAnimTree));
|
||||
}
|
||||
}
|
||||
else if (Game() <= EGame::Corruption)
|
||||
|
||||
Reference in New Issue
Block a user