@@ -13,11 +13,13 @@ class GameObject {
1313 GameObject () = default ;
1414
1515 GameObject (std::unique_ptr<Core::Drawable> drawable, const float zIndex,
16+ const bool visible = true ,
1617 const std::vector<std::shared_ptr<GameObject>> &children =
1718 std::vector<std::shared_ptr<GameObject>>())
1819 : m_Drawable(std::move(drawable)),
1920 m_Children (children),
20- m_ZIndex(zIndex) {}
21+ m_ZIndex(zIndex),
22+ m_Visible(visible) {}
2123
2224 GameObject (const GameObject &other) = delete;
2325
@@ -28,17 +30,18 @@ class GameObject {
2830 virtual ~GameObject () = default ;
2931
3032 float GetZIndex () const { return m_ZIndex; }
31-
32- std::vector<std::shared_ptr<GameObject>> &GetChildren () {
33+ Transform GetTransform () const { return m_Transform; }
34+ const std::vector<std::shared_ptr<GameObject>> &GetChildren () const {
3335 return m_Children;
3436 }
3537
3638 void SetZIndex (float index) { m_ZIndex = index; }
37-
3839 void SetDrawable (std::unique_ptr<Core::Drawable> drawable) {
3940 m_Drawable = std::move (drawable);
4041 }
4142
43+ void SetVisible (bool visible) { m_Visible = visible; }
44+
4245 void AppendChild (std::shared_ptr<GameObject> child) {
4346 m_Children.push_back (std::move (child));
4447 }
@@ -57,6 +60,7 @@ class GameObject {
5760 std::vector<std::shared_ptr<GameObject>> m_Children;
5861
5962 float m_ZIndex;
63+ bool m_Visible = true ;
6064};
6165} // namespace Util
6266#endif
0 commit comments