RealtimeStyleTransferRuntime/Source/LyraGame/Teams/LyraTeamAgentInterface.cpp

31 lines
1.1 KiB
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
2022-09-13 07:18:28 +00:00
#include "Teams/LyraTeamAgentInterface.h"
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Logging/LogCategory.h"
#include "Logging/LogMacros.h"
2022-05-23 18:41:30 +00:00
#include "LyraLogChannels.h"
2022-09-13 07:18:28 +00:00
#include "Trace/Detail/Channel.h"
#include "UObject/UObjectBaseUtility.h"
2022-05-23 18:41:30 +00:00
ULyraTeamAgentInterface::ULyraTeamAgentInterface(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ILyraTeamAgentInterface::ConditionalBroadcastTeamChanged(TScriptInterface<ILyraTeamAgentInterface> This, FGenericTeamId OldTeamID, FGenericTeamId NewTeamID)
{
if (OldTeamID != NewTeamID)
{
const int32 OldTeamIndex = GenericTeamIdToInteger(OldTeamID);
const int32 NewTeamIndex = GenericTeamIdToInteger(NewTeamID);
UObject* ThisObj = This.GetObject();
UE_LOG(LogLyraTeams, Verbose, TEXT("[%s] %s assigned team %d"), *GetClientServerContextString(ThisObj), *GetPathNameSafe(ThisObj), NewTeamIndex);
This.GetInterface()->GetTeamChangedDelegateChecked().Broadcast(ThisObj, OldTeamIndex, NewTeamIndex);
}
}