| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | |
| 5 | namespace al { |
| 6 | class IUseName; |
| 7 | class StageSwitchListener; |
| 8 | class StageSwitchDirector; |
| 9 | class PlacementId; |
| 10 | |
| 11 | class StageSwitchAccesser { |
| 12 | public: |
| 13 | StageSwitchAccesser(); |
| 14 | |
| 15 | bool init(StageSwitchDirector* director, const char* linkName, const PlacementId& placementId); |
| 16 | StageSwitchDirector* getStageSwitchDirector() const; |
| 17 | bool isValid() const; |
| 18 | void onSwitch(); |
| 19 | void offSwitch(); |
| 20 | bool isOnSwitch() const; |
| 21 | bool isEnableRead() const; |
| 22 | bool isEnableWrite() const; |
| 23 | bool isEqualSwitch(const StageSwitchAccesser* other) const; |
| 24 | void addListener(StageSwitchListener* listener); |
| 25 | |
| 26 | const char* getLinkName() const { return mLinkName; } |
| 27 | |
| 28 | void setUseName(IUseName* useName) { mUseName = useName; } |
| 29 | |
| 30 | PlacementId* getPlacementId() const { return mPlacementId; } |
| 31 | |
| 32 | s32 getInfoIndex() const { return mInfoIndex; } |
| 33 | |
| 34 | private: |
| 35 | enum class SwitchKind : u32 { Invalid = 0, Read = 1, Write = 2 }; |
| 36 | |
| 37 | StageSwitchDirector* mStageSwitchDirector = nullptr; |
| 38 | IUseName* mUseName = nullptr; |
| 39 | const char* mLinkName = ""; |
| 40 | PlacementId* mPlacementId = nullptr; |
| 41 | s32 mInfoIndex = -1; |
| 42 | SwitchKind mSwitchKind = SwitchKind::Invalid; |
| 43 | }; |
| 44 | } // namespace al |
| 45 |