You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
58 lines
1.1 KiB
C++
58 lines
1.1 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StatsViewerPrivatePCH.h"
|
|
#include "StatsPageManager.h"
|
|
#include "IStatsPage.h"
|
|
|
|
|
|
FStatsPageManager& FStatsPageManager::Get()
|
|
{
|
|
static FStatsPageManager* Instance = NULL;
|
|
if( Instance == NULL )
|
|
{
|
|
Instance = new FStatsPageManager;
|
|
}
|
|
return *Instance;
|
|
}
|
|
|
|
void FStatsPageManager::RegisterPage( TSharedRef<IStatsPage> InPage )
|
|
{
|
|
StatsPages.Add( InPage );
|
|
}
|
|
|
|
void FStatsPageManager::UnregisterPage( TSharedRef<IStatsPage> InPage )
|
|
{
|
|
StatsPages.Remove( InPage );
|
|
}
|
|
|
|
void FStatsPageManager::UnregisterAllPages()
|
|
{
|
|
StatsPages.Empty();
|
|
}
|
|
|
|
int32 FStatsPageManager::NumPages() const
|
|
{
|
|
return StatsPages.Num();
|
|
}
|
|
|
|
TSharedRef<IStatsPage> FStatsPageManager::GetPage( int32 InPageIndex )
|
|
{
|
|
check(StatsPages.IsValidIndex(InPageIndex));
|
|
|
|
return StatsPages[InPageIndex];
|
|
}
|
|
|
|
TSharedPtr<IStatsPage> FStatsPageManager::GetPage( const FName& InPageName )
|
|
{
|
|
for( auto Iter = StatsPages.CreateIterator(); Iter; Iter++ )
|
|
{
|
|
TSharedRef<class IStatsPage> Page = *Iter;
|
|
if(Page.Get().GetName() == InPageName)
|
|
{
|
|
return Page;
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|