1#include "Library/MapObj/SubActorLodMapParts.h"
2
3#include "Library/LiveActor/ActorActionFunction.h"
4#include "Library/LiveActor/ActorInitUtil.h"
5#include "Library/LiveActor/ActorModelFunction.h"
6#include "Library/LiveActor/LiveActorFunction.h"
7#include "Library/MapObj/SubActorLodExecutor.h"
8#include "Library/Placement/PlacementFunction.h"
9
10namespace al {
11SubActorLodMapParts::SubActorLodMapParts(const char* name) : LiveActor(name) {}
12
13void SubActorLodMapParts::init(const ActorInitInfo& info) {
14 const char* suffix = nullptr;
15 tryGetStringArg(arg: &suffix, initInfo: info, key: "Suffix");
16 initMapPartsActor(actor: this, initInfo: info, suffix);
17
18 mSubActorLodExecutor = new SubActorLodExecutor(this, info, 0);
19 if (getModelKeeper() != nullptr && !isExistAction(actor: this) && !isViewDependentModel(actor: this))
20 mIsControlled = true;
21
22 trySyncStageSwitchAppearAndKill(actor: this);
23 makeActorAlive();
24}
25
26void SubActorLodMapParts::control() {
27 mSubActorLodExecutor->control();
28}
29
30void SubActorLodMapParts::movement() {
31 if (mIsControlled) {
32 control();
33
34 return;
35 }
36
37 if (isHideModel(actor: this)) {
38 LiveActor::movement();
39
40 return;
41 }
42
43 ((SubActorLodMapParts*)getSubActor(actor: this, index: 0))->movement();
44}
45
46void SubActorLodMapParts::calcAnim() {
47 if (mIsControlled) {
48 calcViewModel(actor: this);
49
50 return;
51 }
52
53 LiveActor::calcAnim();
54}
55} // namespace al
56