-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Layout: Implement
TestFilterGlasses
(#273)
- Loading branch information
1 parent
46fc505
commit 8aed37d
Showing
3 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "Layout/TestFilterGlasses.h" | ||
|
||
#include "Library/Layout/LayoutActionFunction.h" | ||
#include "Library/Layout/LayoutInitInfo.h" | ||
#include "Library/Nerve/NerveSetupUtil.h" | ||
|
||
namespace { | ||
NERVE_IMPL(TestFilterGlasses, Appear); | ||
NERVE_IMPL(TestFilterGlasses, End); | ||
NERVE_IMPL(TestFilterGlasses, Wait); | ||
|
||
NERVES_MAKE_NOSTRUCT(TestFilterGlasses, Appear, End, Wait); | ||
} // namespace | ||
|
||
TestFilterGlasses::TestFilterGlasses(const char* name, const al::LayoutInitInfo& info, | ||
const char* suffix) | ||
: al::LayoutActor(name) { | ||
al::initLayoutActor(this, info, "FilterGlasses", suffix); | ||
initNerve(&Appear, 0); | ||
kill(); | ||
} | ||
|
||
void TestFilterGlasses::startAppear() { | ||
appear(); | ||
al::setNerve(this, &Appear); | ||
} | ||
|
||
void TestFilterGlasses::end() { | ||
al::setNerve(this, &End); | ||
} | ||
|
||
void TestFilterGlasses::exeAppear() { | ||
if (al::isFirstStep(this)) | ||
al::startAction(this, "Appear", nullptr); | ||
if (al::isActionEnd(this, nullptr)) | ||
al::setNerve(this, &Wait); | ||
} | ||
|
||
void TestFilterGlasses::exeWait() { | ||
if (al::isFirstStep(this)) | ||
al::startAction(this, "Wait", nullptr); | ||
} | ||
|
||
void TestFilterGlasses::exeEnd() { | ||
if (al::isFirstStep(this)) | ||
al::startAction(this, "End", nullptr); | ||
if (al::isActionEnd(this, nullptr)) | ||
kill(); | ||
} | ||
|
||
bool TestFilterGlasses::isEnd() const { | ||
return !isAlive() || al::isNerve(this, &End); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "Library/Layout/LayoutActor.h" | ||
|
||
namespace al { | ||
class LayoutInitInfo; | ||
} | ||
|
||
class TestFilterGlasses : public al::LayoutActor { | ||
public: | ||
TestFilterGlasses(const char* name, const al::LayoutInitInfo& info, const char* suffix); | ||
|
||
void startAppear(); | ||
void end(); | ||
|
||
void exeAppear(); | ||
void exeWait(); | ||
void exeEnd(); | ||
bool isEnd() const; | ||
}; |