TangibleManager is a stub now
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"Engine"
|
||||
"Engine",
|
||||
"CoreUObject"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
#include "IntegrationGameModeBase.h"
|
||||
#include "drvutil.hpp"
|
||||
#include "engineutil.hpp"
|
||||
#include "TangibleManager.h"
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
|
||||
AIntegrationGameModeBase::AIntegrationGameModeBase()
|
||||
{
|
||||
Thread = nullptr;
|
||||
@@ -192,10 +192,9 @@ void AIntegrationGameModeBase::BeginPlay()
|
||||
Thread = FRunnableThread::Create(this, TEXT("Worker Thread"));
|
||||
}
|
||||
|
||||
// Create a tangible.
|
||||
UWorld* w = GetWorld();
|
||||
AActor* aa = engineutil::CreateTangible(w, ClassTangibleActor);
|
||||
Tangibles.Add(aa);
|
||||
//// Create a tangible.
|
||||
//TangibleManager.Init(GetWorld(), ClassTangibleActor);
|
||||
//TangibleManager.MakeTangible(123);
|
||||
}
|
||||
|
||||
void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "enginewrapper.hpp"
|
||||
#include "engineutil.hpp"
|
||||
#include "TangibleManager.h"
|
||||
#include "LuprexSockets.hpp"
|
||||
#include "IntegrationGameModeBase.generated.h"
|
||||
|
||||
@@ -46,8 +47,8 @@ public:
|
||||
// Transfer console output from the Luprex engine to unreal.
|
||||
void HandleLuprexConsoleOutput();
|
||||
|
||||
// Array of tangibles.
|
||||
TArray<AActor*> Tangibles;
|
||||
//UPROPERTY()
|
||||
//FTangibleManager TangibleManager;
|
||||
|
||||
// This stores the entire text currently visible in the console.
|
||||
engineutil::ConsoleOutput ConsoleOutput;
|
||||
|
||||
39
Source/Integration/TangibleManager.cpp
Normal file
39
Source/Integration/TangibleManager.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "TangibleManager.h"
|
||||
|
||||
//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
|
||||
//}
|
||||
|
||||
42
Source/Integration/TangibleManager.h
Normal file
42
Source/Integration/TangibleManager.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "UObject/NoExportTypes.h"
|
||||
#include "TangibleManager.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
USTRUCT()
|
||||
struct INTEGRATION_API FTangibleManager
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
//// A pointer to the UWorld.
|
||||
//UWorld* world;
|
||||
|
||||
//// A pointer to uclass TangibleActor.
|
||||
//UPROPERTY()
|
||||
//TSubclassOf<AActor> ClassTangibleActor;
|
||||
|
||||
//// Given a tangible ID, look up actor pointer (or NULL if actor was deleted)
|
||||
//UPROPERTY()
|
||||
//TMap<int64, AActor*> IdToActor;
|
||||
|
||||
public:
|
||||
//// Initialize the tangible manager.
|
||||
////
|
||||
//void Init(UWorld *world, UClass* tanact);
|
||||
|
||||
//// Get the tangible if it exists, otherwise return NULL
|
||||
//AActor* GetTangible(int64 id);
|
||||
|
||||
//// Get the tangible if it exists, otherwise create it.
|
||||
//AActor* MakeTangible(int64 id);
|
||||
|
||||
//// Delete the tangible.
|
||||
//void DeleteTangible(int64 id);
|
||||
};
|
||||
@@ -76,13 +76,5 @@ void ConsoleOutput::Truncate() {
|
||||
}
|
||||
}
|
||||
|
||||
AActor* CreateTangible(UWorld *w, UClass* uclass) {
|
||||
FVector location;
|
||||
FRotator rotation;
|
||||
FActorSpawnParameters params;
|
||||
AActor *result = w->SpawnActor(uclass, &location, &rotation, params);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace engineutil
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
void ClearDirty() { Dirty = false; }
|
||||
};
|
||||
|
||||
AActor* CreateTangible(UWorld *w, UClass* uclass);
|
||||
|
||||
} // namespace engineutil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user