| 1 | #ifndef GAME_EDITOR_REFERENCES_H |
|---|---|
| 2 | #define GAME_EDITOR_REFERENCES_H |
| 3 | |
| 4 | #include <memory> |
| 5 | #include <vector> |
| 6 | |
| 7 | class CEnvelope; |
| 8 | class CLayerQuads; |
| 9 | class CLayerSounds; |
| 10 | class CLayerTiles; |
| 11 | |
| 12 | class IEditorEnvelopeReference |
| 13 | { |
| 14 | public: |
| 15 | virtual void SetEnvelope(const std::shared_ptr<CEnvelope> &pEnvelope, int EnvIndex) = 0; |
| 16 | virtual ~IEditorEnvelopeReference() = default; |
| 17 | }; |
| 18 | |
| 19 | class CLayerTilesEnvelopeReference : public IEditorEnvelopeReference |
| 20 | { |
| 21 | public: |
| 22 | CLayerTilesEnvelopeReference(std::shared_ptr<CLayerTiles> pLayerTiles) : |
| 23 | m_pLayerTiles(std::move(pLayerTiles)) {} |
| 24 | void SetEnvelope(const std::shared_ptr<CEnvelope> &pEnvelope, int EnvIndex) override; |
| 25 | |
| 26 | private: |
| 27 | std::shared_ptr<CLayerTiles> m_pLayerTiles; |
| 28 | }; |
| 29 | |
| 30 | class CLayerQuadsEnvelopeReference : public IEditorEnvelopeReference |
| 31 | { |
| 32 | public: |
| 33 | CLayerQuadsEnvelopeReference(std::shared_ptr<CLayerQuads> pLayerQuads) : |
| 34 | m_pLayerQuads(std::move(pLayerQuads)) {} |
| 35 | void SetEnvelope(const std::shared_ptr<CEnvelope> &pEnvelope, int EnvIndex) override; |
| 36 | void AddQuadIndex(int QuadIndex) { m_vQuadIndices.push_back(x: QuadIndex); } |
| 37 | bool Empty() const { return m_vQuadIndices.empty(); } |
| 38 | |
| 39 | private: |
| 40 | std::vector<int> m_vQuadIndices; |
| 41 | std::shared_ptr<CLayerQuads> m_pLayerQuads; |
| 42 | }; |
| 43 | |
| 44 | class CLayerSoundEnvelopeReference : public IEditorEnvelopeReference |
| 45 | { |
| 46 | public: |
| 47 | CLayerSoundEnvelopeReference(std::shared_ptr<CLayerSounds> pLayerSounds) : |
| 48 | m_pLayerSounds(std::move(pLayerSounds)) {} |
| 49 | void SetEnvelope(const std::shared_ptr<CEnvelope> &pEnvelope, int EnvIndex) override; |
| 50 | void AddSoundSourceIndex(int SoundSourceIndex) { m_vSoundSourceIndices.push_back(x: SoundSourceIndex); } |
| 51 | bool Empty() const { return m_vSoundSourceIndices.empty(); } |
| 52 | |
| 53 | private: |
| 54 | std::vector<int> m_vSoundSourceIndices; |
| 55 | std::shared_ptr<CLayerSounds> m_pLayerSounds; |
| 56 | }; |
| 57 | |
| 58 | #endif |
| 59 |