MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / SerialiseCommand

Method SerialiseCommand

src/openrct2/ReplayManager.cpp:689–714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 }
688
689 bool SerialiseCommand(DataSerialiser& serialiser, ReplayCommand& command)
690 {
691 serialiser << command.tick;
692 serialiser << command.commandIndex;
693
694 uint32_t actionType = 0;
695 if (serialiser.IsSaving())
696 {
697 if (!command.action)
698 {
699 return false;
700 }
701 actionType = EnumValue(command.action->GetType());
702 }
703 serialiser << actionType;
704
705 if (serialiser.IsLoading())
706 {
707 command.action = Create(static_cast<GameCommand>(actionType));
708 }
709
710 Guard::Assert(command.action != nullptr);
711 command.action->Serialise(serialiser);
712
713 return true;
714 }
715
716 bool Compatible(ReplayRecordData& data)
717 {

Callers

nothing calls this directly

Calls 7

EnumValueFunction · 0.85
AssertFunction · 0.85
IsSavingMethod · 0.80
IsLoadingMethod · 0.80
CreateFunction · 0.70
GetTypeMethod · 0.45
SerialiseMethod · 0.45

Tested by

no test coverage detected