Bare minimum tangible manager functionality OK
This commit is contained in:
@@ -3,37 +3,37 @@
|
||||
|
||||
#include "TangibleManager.h"
|
||||
|
||||
//using AActorPtr = AActor*;
|
||||
using AActorPtr = AActor*;
|
||||
|
||||
void FTangibleManager::Init(UWorld *world, UClass* tanact) {
|
||||
World = world;
|
||||
ClassTangibleActor = tanact;
|
||||
}
|
||||
|
||||
//AActorPtr FTangibleManager::GetTangible(int64 id) {
|
||||
// AActorPtr *p = IdToActor.Find(id);
|
||||
// if (p == nullptr) {
|
||||
// return nullptr;
|
||||
// } else {
|
||||
// return *p;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//// Get the tangible if it exists, otherwise create it.
|
||||
//AActorPtr FTangibleManager::MakeTangible(int64 id) {
|
||||
// AActorPtr& p = IdToActor.FindOrAdd(id);
|
||||
// if (p == nullptr) {
|
||||
// FVector location;
|
||||
// FRotator rotation;
|
||||
// FActorSpawnParameters params;
|
||||
// p = w->SpawnActor(ClassTangibleActor, &location, &rotation, params);
|
||||
// assert(p != nullptr);
|
||||
// }
|
||||
// return p;
|
||||
//}
|
||||
//
|
||||
//// Delete the tangible.
|
||||
//void FTangibleManager::DeleteTangible(int64 id) {
|
||||
// // IMPLEMENT ME
|
||||
//}
|
||||
AActorPtr FTangibleManager::GetTangible(int64 id) {
|
||||
AActorPtr *p = IdToActor.Find(id);
|
||||
if (p == nullptr) {
|
||||
return nullptr;
|
||||
} else {
|
||||
return *p;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the tangible if it exists, otherwise create it.
|
||||
AActorPtr FTangibleManager::MakeTangible(int64 id) {
|
||||
AActorPtr& p = IdToActor.FindOrAdd(id);
|
||||
if (p == nullptr) {
|
||||
FVector location;
|
||||
FRotator rotation;
|
||||
FActorSpawnParameters params;
|
||||
p = World->SpawnActor(ClassTangibleActor, &location, &rotation, params);
|
||||
check(p != nullptr);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
// Delete the tangible.
|
||||
void FTangibleManager::DeleteTangible(int64 id) {
|
||||
// IMPLEMENT ME
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user