23 lines
582 B
C++
23 lines
582 B
C++
// © 2025 Naked People Team. All Rights Reserved.
|
|
|
|
|
|
#include "PhoneItemInstance.h"
|
|
|
|
#include "PhoneItemDefinition.h"
|
|
#include "StructUtils/InstancedStruct.h"
|
|
|
|
void UPhoneItemInstance::CaptureState(FInstancedStruct& OutState) const
|
|
{
|
|
FPhoneInstanceState PhoneState;
|
|
PhoneState.CurrentBattery = CurrentBattery;
|
|
OutState.InitializeAs<FPhoneInstanceState>(PhoneState);
|
|
}
|
|
|
|
void UPhoneItemInstance::ApplyState(const FInstancedStruct& InState)
|
|
{
|
|
if (const FPhoneInstanceState* PhoneState = InState.GetPtr<FPhoneInstanceState>())
|
|
{
|
|
CurrentBattery = PhoneState->CurrentBattery;
|
|
}
|
|
}
|