mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 17:47:42 +00:00
CProjectileWeaponDataFactory: Make GetGeneratorDesc() return a unique_ptr
Same behavior, but with safer memory management.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Runtime/CFactoryMgr.hpp"
|
||||
#include "Runtime/CToken.hpp"
|
||||
#include "Runtime/IOStreams.hpp"
|
||||
@@ -7,14 +9,15 @@
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
|
||||
namespace urde {
|
||||
class CWeaponDescription;
|
||||
class CSimplePool;
|
||||
class CWeaponDescription;
|
||||
|
||||
class CProjectileWeaponDataFactory {
|
||||
static CWeaponDescription* CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
|
||||
static std::unique_ptr<CWeaponDescription> CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
|
||||
static bool CreateWPSM(CWeaponDescription* desc, CInputStream& in, CSimplePool* resPool);
|
||||
|
||||
public:
|
||||
static CWeaponDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
|
||||
static std::unique_ptr<CWeaponDescription> GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
|
||||
};
|
||||
|
||||
CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
||||
|
||||
Reference in New Issue
Block a user