1#include "Library/Play/Layout/SimpleLayoutAppearWait.h"
2
3#include "Library/Layout/LayoutActionFunction.h"
4#include "Library/Layout/LayoutInitInfo.h"
5#include "Library/Nerve/NerveSetupUtil.h"
6#include "Library/Nerve/NerveUtil.h"
7
8namespace {
9using namespace al;
10NERVE_IMPL(SimpleLayoutAppearWait, Appear);
11NERVE_IMPL(SimpleLayoutAppearWait, Wait);
12
13NERVES_MAKE_NOSTRUCT(SimpleLayoutAppearWait, Appear, Wait);
14} // namespace
15
16namespace al {
17
18SimpleLayoutAppearWait::SimpleLayoutAppearWait(const char* name, const char* layoutName,
19 const LayoutInitInfo& info, const char* archiveName)
20 : LayoutActor(name) {
21 initLayoutActor(this, info, layoutName, archiveName);
22 initNerve(&Appear, 0);
23}
24
25SimpleLayoutAppearWait::SimpleLayoutAppearWait(LayoutActor* parentActor, const char* name,
26 const char* layoutName, const LayoutInitInfo& info,
27 const char* archiveName)
28 : LayoutActor(name) {
29 initLayoutPartsActor(this, parentActor, info, layoutName, archiveName);
30 initNerve(&Appear, 0);
31}
32
33void SimpleLayoutAppearWait::appear() {
34 startAction(layout: this, actionName: "Appear", paneName: nullptr);
35 LayoutActor::appear();
36 setNerve(user: this, nerve: &Appear);
37}
38
39bool SimpleLayoutAppearWait::isWait() const {
40 return isNerve(user: this, nerve: &Wait);
41}
42
43void SimpleLayoutAppearWait::exeAppear() {
44 if (isActionEnd(layout: this, paneName: 0))
45 setNerve(user: this, nerve: &Wait);
46}
47
48void SimpleLayoutAppearWait::exeWait() {
49 if (isFirstStep(user: this))
50 startAction(layout: this, actionName: "Wait", paneName: 0);
51}
52
53} // namespace al
54