| 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 | |
| 8 | namespace { |
| 9 | using namespace al; |
| 10 | NERVE_IMPL(SimpleLayoutAppearWait, Appear); |
| 11 | NERVE_IMPL(SimpleLayoutAppearWait, Wait); |
| 12 | |
| 13 | NERVES_MAKE_NOSTRUCT(SimpleLayoutAppearWait, Appear, Wait); |
| 14 | } // namespace |
| 15 | |
| 16 | namespace al { |
| 17 | |
| 18 | SimpleLayoutAppearWait::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 | |
| 25 | SimpleLayoutAppearWait::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 | |
| 33 | void SimpleLayoutAppearWait::appear() { |
| 34 | startAction(layout: this, actionName: "Appear" , paneName: nullptr); |
| 35 | LayoutActor::appear(); |
| 36 | setNerve(user: this, nerve: &Appear); |
| 37 | } |
| 38 | |
| 39 | bool SimpleLayoutAppearWait::isWait() const { |
| 40 | return isNerve(user: this, nerve: &Wait); |
| 41 | } |
| 42 | |
| 43 | void SimpleLayoutAppearWait::exeAppear() { |
| 44 | if (isActionEnd(layout: this, paneName: 0)) |
| 45 | setNerve(user: this, nerve: &Wait); |
| 46 | } |
| 47 | |
| 48 | void SimpleLayoutAppearWait::exeWait() { |
| 49 | if (isFirstStep(user: this)) |
| 50 | startAction(layout: this, actionName: "Wait" , paneName: 0); |
| 51 | } |
| 52 | |
| 53 | } // namespace al |
| 54 | |