#ifndef MMFLOORSTAIRS_H #define MMFLOORSTAIRS_H #include "MapLayer.h" #include "MMFloorStair.h" #include /** * layer containing all stairs of one floor */ class MMFloorStairs : public MapLayer { private: Floorplan::Floor* floor; public: /** ctor with the underlying model */ MMFloorStairs(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_STAIRS), floor(floor) { // add all floors for (Floorplan::Stair* stair : floor->stairs) { if (dynamic_cast(stair)) { addElement( new MMFloorStair(this, floor, (Floorplan::StairFreeform*)stair) ); } } } void create(Floorplan::StairFreeform* stair) { // add to underlying model floor->stairs.push_back(stair); // add to myself as element addElement(new MMFloorStair(this, floor, stair)); } std::string getLayerName() const override {return "stairs";} }; #endif // MMFLOORSTAIRS_H