initial commit
[COMP345---Clone.git] / MapDirector.h
blob0b0bdba67ec88ff8e5eb56a66a67ba8cc960aedc
1 //!@file MapDirector.h
2 //! @brief implementation of the map director
4 //! The director class in the builder pattern
5 //! Directs the builders to construct a map and the treasure and monsters within it
6 #pragma once
7 #include <string>
8 #include "MapBuilder.h"
9 #include "Map.h"
10 using namespace std;
12 //! Directs the builders to construct a map and the treasure and monsters within it
13 class MapDirector
15 public:
16 ~MapDirector() { delete m_mapBuilder; };
17 void setMapBuilder(MapBuilder* mapBuilder) { m_mapBuilder = mapBuilder; };
18 Map* getMap()
20 return m_mapBuilder->getMap();
22 void constructMap(string fileName)
24 m_mapBuilder->createNewMapProduct();
25 m_mapBuilder->buildMap(fileName);
26 m_mapBuilder->buildMonsters();
27 m_mapBuilder->buildTreasure();
29 private:
30 MapBuilder* m_mapBuilder;