// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Math/BoxSphereBounds.h" #include "UObject/ObjectPtr.h" #include "PocketLevelInstance.generated.h" #define UE_API POCKETWORLDS_API class UPocketLevelSubsystem; class ULevelStreamingDynamic; class ULocalPlayer; class UPocketLevel; class UPocketLevelInstance; class UWorld; struct FFrame; DECLARE_MULTICAST_DELEGATE_OneParam(FPocketLevelInstanceEvent, UPocketLevelInstance*); /** * */ UCLASS(MinimalAPI, Within = PocketLevelSubsystem, BlueprintType) class UPocketLevelInstance : public UObject { GENERATED_BODY() public: UE_API UPocketLevelInstance(); UE_API virtual void BeginDestroy() override; UE_API void StreamIn(); UE_API void StreamOut(); UE_API FDelegateHandle AddReadyCallback(FPocketLevelInstanceEvent::FDelegate Callback); UE_API void RemoveReadyCallback(FDelegateHandle CallbackToRemove); virtual class UWorld* GetWorld() const override { return World; } private: UE_API bool Initialize(ULocalPlayer* LocalPlayer, UPocketLevel* PocketLevel, FVector SpawnPoint); UFUNCTION() UE_API void HandlePocketLevelLoaded(); UFUNCTION() UE_API void HandlePocketLevelShown(); private: UPROPERTY() TObjectPtr LocalPlayer; UPROPERTY() TObjectPtr PocketLevel; UPROPERTY() TObjectPtr World; UPROPERTY() TObjectPtr StreamingPocketLevel; FPocketLevelInstanceEvent OnReadyEvent; FBoxSphereBounds Bounds; friend class UPocketLevelSubsystem; }; #undef UE_API