1#include "Layout/FilterScope.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 {
9NERVE_IMPL(FilterScope, Appear);
10NERVE_IMPL(FilterScope, Wait);
11NERVE_IMPL(FilterScope, End);
12
13NERVES_MAKE_NOSTRUCT(FilterScope, Appear, Wait, End);
14} // namespace
15
16FilterScope::FilterScope(const char* name, const al::LayoutInitInfo& info, const char* suffix)
17 : al::LayoutActor(name) {
18 al::initLayoutActor(this, info, "FilterScope", suffix);
19 initNerve(&Appear, 0);
20 kill();
21}
22
23void FilterScope::startAppear() {
24 appear();
25 al::setNerve(user: this, nerve: &Appear);
26}
27
28void FilterScope::end() {
29 al::setNerve(user: this, nerve: &End);
30}
31
32void FilterScope::exeAppear() {
33 if (al::isFirstStep(user: this))
34 al::startAction(layout: this, actionName: "Appear", paneName: 0);
35 if (al::isActionEnd(layout: this, paneName: 0))
36 al::setNerve(user: this, nerve: &Wait);
37}
38
39void FilterScope::exeWait() {
40 if (al::isFirstStep(user: this))
41 al::startAction(layout: this, actionName: "Wait", paneName: 0);
42}
43
44void FilterScope::exeEnd() {
45 if (al::isFirstStep(user: this))
46 al::startAction(layout: this, actionName: "End", paneName: 0);
47 if (al::isActionEnd(layout: this, paneName: 0))
48 kill();
49}
50
51bool FilterScope::isEnd() const {
52 return !isAlive() || al::isNerve(user: this, nerve: &End);
53}
54