Skip to content

Commit 7e9b3c9

Browse files
committed
Add monitors getter to IProjectReader
1 parent 4622550 commit 7e9b3c9

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/internal/iprojectreader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace libscratchcpp
1717

1818
class Target;
1919
class Broadcast;
20+
class Monitor;
2021

2122
class IProjectReader
2223
{
@@ -32,6 +33,7 @@ class IProjectReader
3233
virtual void clear() = 0;
3334
virtual const std::vector<std::shared_ptr<Target>> &targets() = 0;
3435
virtual const std::vector<std::shared_ptr<Broadcast>> &broadcasts() = 0;
36+
virtual const std::vector<std::shared_ptr<Monitor>> &monitors() = 0;
3537
virtual const std::vector<std::string> &extensions() = 0;
3638

3739
protected:

src/internal/scratch3reader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ const std::vector<std::shared_ptr<Broadcast>> &Scratch3Reader::broadcasts()
405405
return m_broadcasts;
406406
}
407407

408+
const std::vector<std::shared_ptr<Monitor>> &Scratch3Reader::monitors()
409+
{
410+
return m_monitors;
411+
}
412+
408413
const std::vector<std::string> &Scratch3Reader::extensions()
409414
{
410415
return m_extensions;

src/internal/scratch3reader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Scratch3Reader : public IProjectReader
1919
void clear() override;
2020
const std::vector<std::shared_ptr<Target>> &targets() override;
2121
const std::vector<std::shared_ptr<Broadcast>> &broadcasts() override;
22+
const std::vector<std::shared_ptr<Monitor>> &monitors() override;
2223
const std::vector<std::string> &extensions() override;
2324

2425
private:
@@ -27,6 +28,7 @@ class Scratch3Reader : public IProjectReader
2728
nlohmann::json m_json = "";
2829
std::vector<std::shared_ptr<Target>> m_targets;
2930
std::vector<std::shared_ptr<Broadcast>> m_broadcasts;
31+
std::vector<std::shared_ptr<Monitor>> m_monitors;
3032
std::vector<std::string> m_extensions;
3133
};
3234

0 commit comments

Comments
 (0)