Files
integration/Source/Integration/IntegrationGameModeBase.h

59 lines
1.4 KiB
C
Raw Normal View History

2023-06-08 17:10:14 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "enginewrapper.hpp"
#include "engineutil.hpp"
2023-06-09 14:36:47 -04:00
#include "IntegrationGameModeBase.generated.h"
2023-06-08 17:10:14 -04:00
/**
*
*/
UCLASS()
class INTEGRATION_API AIntegrationGameModeBase : public AGameModeBase, public FRunnable
2023-06-08 17:10:14 -04:00
{
GENERATED_BODY()
public:
2023-06-09 14:36:47 -04:00
AIntegrationGameModeBase();
~AIntegrationGameModeBase();
2023-06-08 17:10:14 -04:00
virtual void BeginPlay() override;
virtual void Tick(float) override;
2023-06-09 16:47:46 -04:00
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason);
2023-06-08 17:10:14 -04:00
// Thread start and shutdown.
void LaunchThread();
void WaitForThread();
// Methods of FRunnable, for the thread to use.
virtual bool Init() override;
virtual uint32 Run() override;
virtual void Stop() override;
// Return true if luprex was successfully initialized.
2023-06-08 17:10:14 -04:00
inline bool luprex_initialized() {
return Luprex.play_initialize != nullptr;
}
// Set the entire contents of the console output box.
UFUNCTION(BlueprintImplementableEvent)
void ConsoleSetOutput(const FString& text);
// This is called by the GUI whenever the user hits enter.
2023-06-08 17:10:14 -04:00
UFUNCTION(BlueprintCallable)
void ConsoleSendInput(const FString& text);
void HandleConsoleOutput();
2023-06-09 16:47:46 -04:00
// The worker thread is responsible for networking and event_update
2023-06-09 16:47:46 -04:00
FRunnableThread* Thread;
bool ThreadStopRequested;
2023-06-08 17:10:14 -04:00
engineutil::ConsoleOutput ConsoleOutput;
static EngineWrapper Luprex;
float EngineSeconds;
};