blob: 33a09c0edbb2161637bd7cec18645f8cdaf62130 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#include "SetActorList.h"
#include <cassert>
#include "Globals.h"
#include "Utils/BitConverter.h"
#include <ship/utils/StringHelper.h>
#include "ZRoom/ZRoom.h"
SetActorList::SetActorList(ZFile* nParent) : ZRoomCommand(nParent)
{
}
void SetActorList::ParseRawData()
{
ZRoomCommand::ParseRawData();
numActors = cmdArg1;
actorList = new ZActorList(parent);
actorList->ExtractFromBinary(segmentOffset, numActors);
}
void SetActorList::DeclareReferences(const std::string& prefix)
{
if (parent->HasDeclaration(segmentOffset))
{
delete actorList;
actorList = static_cast<ZActorList*>(parent->FindResource(segmentOffset));
assert(actorList != nullptr);
assert(actorList->GetResourceType() == ZResourceType::ActorList);
return;
}
if (actorList->GetName() == "")
{
actorList->SetName(actorList->GetDefaultName(prefix));
}
actorList->DeclareVar(prefix, "");
parent->AddResource(actorList);
}
std::string SetActorList::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName,
parent->workerID);
return StringHelper::Sprintf("SCENE_CMD_ACTOR_LIST(%i, %s)", numActors, listName.c_str());
}
std::string SetActorList::GetCommandCName() const
{
return "SCmdActorList";
}
RoomCommand SetActorList::GetRoomCommand() const
{
return RoomCommand::SetActorList;
}
|