| 1 | #include "Library/MapObj/SwitchDitherMapParts.h" |
| 2 | |
| 3 | #include "Library/LiveActor/ActorInitUtil.h" |
| 4 | #include "Library/LiveActor/ActorModelFunction.h" |
| 5 | #include "Library/Nerve/NerveSetupUtil.h" |
| 6 | #include "Library/Stage/StageSwitchUtil.h" |
| 7 | #include "Library/Thread/FunctorV0M.h" |
| 8 | |
| 9 | namespace { |
| 10 | using namespace al; |
| 11 | |
| 12 | NERVE_ACTION_IMPL(SwitchDitherMapParts, Wait) |
| 13 | |
| 14 | NERVE_ACTIONS_MAKE_STRUCT(SwitchDitherMapParts, Wait) |
| 15 | } // namespace |
| 16 | |
| 17 | namespace al { |
| 18 | SwitchDitherMapParts::SwitchDitherMapParts(const char* name) : LiveActor(name) {} |
| 19 | |
| 20 | void SwitchDitherMapParts::init(const ActorInitInfo& info) { |
| 21 | using SwitchDitherMapPartsFunctor = |
| 22 | FunctorV0M<SwitchDitherMapParts*, void (SwitchDitherMapParts::*)()>; |
| 23 | |
| 24 | initNerveAction(actor: this, actionName: "Wait" , collector: &NrvSwitchDitherMapParts.collector, maxStates: 0); |
| 25 | initMapPartsActor(actor: this, initInfo: info, suffix: nullptr); |
| 26 | |
| 27 | bool isListenStartOnOff = listenStageSwitchOnOff( |
| 28 | user: this, eventName: "SwitchStart" , actionOn: SwitchDitherMapPartsFunctor(this, &SwitchDitherMapParts::ditherOn), |
| 29 | actionOff: SwitchDitherMapPartsFunctor(this, &SwitchDitherMapParts::ditherOff)); |
| 30 | if (isListenStartOnOff) |
| 31 | invalidateDitherAnim(actor: this); |
| 32 | |
| 33 | makeActorAlive(); |
| 34 | } |
| 35 | |
| 36 | void SwitchDitherMapParts::ditherOn() { |
| 37 | validateDitherAnim(actor: this); |
| 38 | } |
| 39 | |
| 40 | void SwitchDitherMapParts::ditherOff() { |
| 41 | invalidateDitherAnim(actor: this); |
| 42 | } |
| 43 | |
| 44 | void SwitchDitherMapParts::exeWait() {} |
| 45 | } // namespace al |
| 46 | |