1#pragma once
2
3#include <basis/seadTypes.h>
4
5namespace al {
6class IUseName;
7class StageSwitchListener;
8class StageSwitchDirector;
9class PlacementId;
10
11class StageSwitchAccesser {
12public:
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
34private:
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