You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904 #ROBOMERGE-BOT: (v613-10869866) [CL 10870586 by ryan durand in Main branch]
69 lines
1.7 KiB
C++
69 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "IStatsPage.h"
|
|
|
|
/**
|
|
* A class which manages a the collection of known stats pages
|
|
*/
|
|
class FStatsPageManager
|
|
{
|
|
public:
|
|
FStatsPageManager(const FName& InName = NAME_None) : Name( InName ) {}
|
|
virtual ~FStatsPageManager() {}
|
|
|
|
/** Gets the instance of this manager */
|
|
static FStatsPageManager& Get();
|
|
|
|
const FName& GetName() const { return Name; }
|
|
|
|
/**
|
|
* Register a page with the manager
|
|
* @param PageId Use specific page id (must be unique)
|
|
* @param InPage The page to register
|
|
*/
|
|
void RegisterPage( int32 PageId, TSharedRef<class IStatsPage> InPage );
|
|
|
|
/**
|
|
* Register a page with the manager
|
|
* @param InPage The page to register
|
|
*/
|
|
void RegisterPage( TSharedRef<class IStatsPage> InPage );
|
|
|
|
/**
|
|
* Unregister a page from the manager
|
|
* @param InPage The page to unregister
|
|
*/
|
|
void UnregisterPage( TSharedRef<class IStatsPage> InPage );
|
|
|
|
/** Unregister & delete all registered pages */
|
|
void UnregisterAllPages();
|
|
|
|
/** Get the number of stats pages we have */
|
|
int32 NumPages() const;
|
|
|
|
/** Get the page at the specified index */
|
|
TSharedRef<class IStatsPage> GetPageByIndex( int32 InPageIndex );
|
|
|
|
/** Get page by its type */
|
|
TSharedRef<class IStatsPage> GetPage( int32 InPageId );
|
|
|
|
/** Get the factory with the specified name */
|
|
TSharedPtr<class IStatsPage> GetPage( const FName& InPageName );
|
|
|
|
private:
|
|
int GetPageIndex(int32 PageId) const;
|
|
int GetPageIndex(TSharedRef< IStatsPage > InPage) const;
|
|
|
|
private:
|
|
static const int32 PageIdNone; // = -1;
|
|
|
|
/** The registered pages */
|
|
TArray< TSharedRef<class IStatsPage> > StatsPages;
|
|
TArray< int32 > StatsPageIds;
|
|
|
|
FName Name;
|
|
};
|