Files
integration/Source/Integration/TangibleManager.h

74 lines
1.6 KiB
C
Raw Normal View History

2023-09-02 01:33:11 -04:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "CommonTypes.h"
#include "Tangible.h"
2023-09-02 01:33:11 -04:00
#include "TangibleManager.generated.h"
2023-09-25 14:25:24 -04:00
UCLASS()
class INTEGRATION_API UlxTangibleManager : public UObject
2023-09-02 01:33:11 -04:00
{
GENERATED_BODY()
2023-09-25 14:25:24 -04:00
public:
2023-09-26 19:26:09 -04:00
// Types used frequently.
using IdView = CommonTypes::IdView;
2023-09-26 19:26:09 -04:00
using IdArray = CommonTypes::IdArray;
using TanArray = TArray<UlxTangible*>;
2023-09-02 01:33:11 -04:00
// A pointer to our world.
UPROPERTY()
TWeakObjectPtr<UWorld> World;
2023-09-02 01:33:11 -04:00
// A pointer to uclass TangibleActor. This is the class
// of actors that we create (for now).
UPROPERTY()
TSubclassOf<AActor> ClassTangibleActor;
2023-09-02 01:33:11 -04:00
// Given a tangible ID, look up the TangibleComponent of that actor.
UPROPERTY()
TMap<int64, UlxTangible*> IdToTangible;
2023-09-02 01:33:11 -04:00
public:
UlxTangibleManager();
// Initialize the tangible manager.
//
void Init(UWorld *world, UClass* tanact);
2023-09-02 01:33:11 -04:00
// Get a pointer to our world.
//
UWorld* GetWorld() const override { return World.Get(); }
// Get the tangible if it exists, otherwise return NULL
2023-09-26 19:26:09 -04:00
//
UlxTangible* GetTangible(int64 id) const;
2023-09-02 01:33:11 -04:00
// Get the tangible if it exists, otherwise create it.
2023-09-26 19:26:09 -04:00
//
UlxTangible* MakeTangible(int64 id);
2023-09-02 01:33:11 -04:00
// Delete the tangible.
2023-09-26 19:26:09 -04:00
//
void DeleteTangible(int64 id);
2023-09-26 19:26:09 -04:00
// Get an array of all tangibles.
//
2023-09-26 19:26:09 -04:00
TanArray GetAllTangibles() const;
// Update the 'NearAccordingToLuprex' flags.
//
// Also creates any tangibles that are in the near-list,
// if they don't already exist.
//
2023-09-26 19:26:09 -04:00
void UpdateNear(IdView near);
// Given an array of tangibles, return an array of tangible Ids.
//
2023-09-26 19:26:09 -04:00
static IdArray GetIds(const TanArray &tans);
2023-09-02 01:33:11 -04:00
};