Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Aug 21, 2024
1 parent c5dfc5e commit d3c5422
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion Source/UEST/Private/ScopedGameTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ TEST(UEST, ScopedGame, Simple)
Tester.CreateClientFor(Server);
}


// You can access game worlds
UWorld* ServerWorld = Server->GetWorld();
ASSERT_THAT(ServerWorld, Is::Not::Null);
Expand Down
10 changes: 6 additions & 4 deletions Source/UEST/Private/UESTGameInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
// UGameInstance::WorldContext is not public, and neither InitializeStandalone nor InitializeForPlayInEditor is suitable for us.
// So we use this template hack to access WorldContext field.
// Source: https://ledas.com/post/857-how-to-hack-c-with-templates-and-friends/
template<FWorldContext* UGameInstance::* WorldContext>
struct Stealer {
static friend FWorldContext*& FieldGetter(UGameInstance& GameInstance) {
template<FWorldContext* UGameInstance::*WorldContext>
struct Stealer
{
static friend FWorldContext*& FieldGetter(UGameInstance& GameInstance)
{
return GameInstance.*WorldContext;
}
};
Expand All @@ -31,6 +33,6 @@ void IUESTGameInstance::DefaultInitializeForTests(UGameInstance& GameInstance, c
auto* DummyWorld = UWorld::CreateWorld(WorldType, true);
DummyWorld->SetGameInstance(&GameInstance);
WorldContext.SetCurrentWorld(DummyWorld);

GameInstance.Init();
}
1 change: 0 additions & 1 deletion Source/UEST/Public/UESTGameInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class UEST_API IUESTGameInstance
{
GENERATED_BODY()
public:

virtual void InitializeForTests(const bool bRunAsDedicated, int32 PIEInstance) = 0;

static void DefaultInitializeForTests(UGameInstance& GameInstance, bool bRunAsDedicated, int32 PIEInstance);
Expand Down

0 comments on commit d3c5422

Please sign in to comment.