MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Serialize

Method Serialize

engine/Poseidon/World/WorldSetup.cpp:658–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658LSError VehicleList::Serialize(ParamArchive& ar)
659{
660 if (ar.IsSaving())
661 {
662 RefArray<Entity> mustBeSaved;
663 for (int i = 0; i < Size(); i++)
664 {
665 Entity* veh = Get(i);
666 if (veh->Object::GetType() == Primary)
667 {
668 continue;
669 }
670 if (!veh->MustBeSaved())
671 {
672 continue;
673 }
674 mustBeSaved.Add(veh);
675 }
676 PARAM_CHECK(ar.Serialize("Vehicles", mustBeSaved, 1))
677 }
678 else
679 {
680 PARAM_CHECK(ar.Serialize("Vehicles", *(RefArray<Entity>*)this, 1))
681 if (ar.GetPass() == ParamArchive::PassFirst)
682 {
683 for (int i = 0; i < Size(); i++)
684 {
685 Entity* object = Set(i);
686 object->StartFrame();
687 GLOB_LAND->AddObject(object);
688 }
689 }
690 }
691 return LSOK;
692}
693
694void VehiclesDistributed::Clear()
695{

Callers

nothing calls this directly

Calls 11

SetClass · 0.85
GetPassMethod · 0.80
SetListMethod · 0.80
GetFunction · 0.50
IsSavingMethod · 0.45
MustBeSavedMethod · 0.45
AddMethod · 0.45
StartFrameMethod · 0.45
AddObjectMethod · 0.45
IsLoadingMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected