Class Tangible can now recreate its Actor

This commit is contained in:
2023-09-26 17:00:30 -04:00
parent cc6509a69c
commit 0efd0dd3ad
12 changed files with 261 additions and 207 deletions

View File

@@ -5,11 +5,11 @@
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "CommonTypes.h"
#include "TangibleComponent.h"
#include "Tangible.h"
#include "TangibleManager.generated.h"
UCLASS()
class INTEGRATION_API UTangibleManager : public UObject
class INTEGRATION_API UlxTangibleManager : public UObject
{
GENERATED_BODY()
@@ -27,9 +27,9 @@ public:
UPROPERTY()
TSubclassOf<AActor> ClassTangibleActor;
// Given a tangible ID, look up actor pointer (or NULL if actor was deleted)
// Given a tangible ID, look up the TangibleComponent of that actor.
UPROPERTY()
TMap<int64, AActor*> IdToActor;
TMap<int64, UlxTangible*> IdToTangible;
// Player's tangible Id.
int64 Player;
@@ -38,7 +38,7 @@ public:
IdView Near;
public:
UTangibleManager();
UlxTangibleManager();
// Initialize the tangible manager.
//
@@ -49,10 +49,10 @@ public:
UWorld* GetWorld() const override { return World.Get(); }
// Get the tangible if it exists, otherwise return NULL
UTangibleComponent* GetTangible(int64 id);
UlxTangible* GetTangible(int64 id);
// Get the tangible if it exists, otherwise create it.
UTangibleComponent* MakeTangible(int64 id);
UlxTangible* MakeTangible(int64 id);
// Delete the tangible.
void DeleteTangible(int64 id);