TangibleManager is a stub now

This commit is contained in:
2023-09-02 01:33:11 -04:00
parent 3ac39c2aaf
commit ac132862de
7 changed files with 90 additions and 17 deletions

View File

@@ -9,7 +9,8 @@
"Type": "Runtime", "Type": "Runtime",
"LoadingPhase": "Default", "LoadingPhase": "Default",
"AdditionalDependencies": [ "AdditionalDependencies": [
"Engine" "Engine",
"CoreUObject"
] ]
} }
], ],

View File

@@ -3,10 +3,10 @@
#include "IntegrationGameModeBase.h" #include "IntegrationGameModeBase.h"
#include "drvutil.hpp" #include "drvutil.hpp"
#include "engineutil.hpp" #include "engineutil.hpp"
#include "TangibleManager.h"
#include <string> #include <string>
#include <string_view> #include <string_view>
AIntegrationGameModeBase::AIntegrationGameModeBase() AIntegrationGameModeBase::AIntegrationGameModeBase()
{ {
Thread = nullptr; Thread = nullptr;
@@ -192,10 +192,9 @@ void AIntegrationGameModeBase::BeginPlay()
Thread = FRunnableThread::Create(this, TEXT("Worker Thread")); Thread = FRunnableThread::Create(this, TEXT("Worker Thread"));
} }
// Create a tangible. //// Create a tangible.
UWorld* w = GetWorld(); //TangibleManager.Init(GetWorld(), ClassTangibleActor);
AActor* aa = engineutil::CreateTangible(w, ClassTangibleActor); //TangibleManager.MakeTangible(123);
Tangibles.Add(aa);
} }
void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason) void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)

View File

@@ -6,6 +6,7 @@
#include "GameFramework/GameModeBase.h" #include "GameFramework/GameModeBase.h"
#include "enginewrapper.hpp" #include "enginewrapper.hpp"
#include "engineutil.hpp" #include "engineutil.hpp"
#include "TangibleManager.h"
#include "LuprexSockets.hpp" #include "LuprexSockets.hpp"
#include "IntegrationGameModeBase.generated.h" #include "IntegrationGameModeBase.generated.h"
@@ -46,8 +47,8 @@ public:
// Transfer console output from the Luprex engine to unreal. // Transfer console output from the Luprex engine to unreal.
void HandleLuprexConsoleOutput(); void HandleLuprexConsoleOutput();
// Array of tangibles. //UPROPERTY()
TArray<AActor*> Tangibles; //FTangibleManager TangibleManager;
// This stores the entire text currently visible in the console. // This stores the entire text currently visible in the console.
engineutil::ConsoleOutput ConsoleOutput; engineutil::ConsoleOutput ConsoleOutput;

View 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
//}

View 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);
};

View File

@@ -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 } // namespace engineutil

View File

@@ -43,7 +43,6 @@ public:
void ClearDirty() { Dirty = false; } void ClearDirty() { Dirty = false; }
}; };
AActor* CreateTangible(UWorld *w, UClass* uclass);
} // namespace engineutil } // namespace engineutil