Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PowerManager.hxx
Go to the documentation of this file.
1 #ifndef POWERMANAGER_HXX_
2 #define POWERMANAGER_HXX_
3 
4 #include "PowerGrid.hxx"
5 #include <MapNode.hxx>
6 
8 {
9 public:
10  PowerManager();
11 
12  void reset();
13 
14 private:
15  int m_powerProduced = 0;
16 
17  void update();
18  std::vector<int> getAdjacentPowerGrids(const PowerNode &powerNode, std::vector<PowerGrid> &powerGrids);
19  void addPowerNodeToGrid(PowerNode &powerNode, std::vector<PowerGrid> &powerGrids);
20  void removePowerNode(Point coordinate);
21  std::vector<PowerGrid> rebuildZoneArea(PowerGrid &powerGrid);
22 
23  void updateRemovedNodes(const MapNode *mapNode);
24  void updatePlacedNodes(const MapNode &mapNode);
25 
31  void updatePowerLevels();
32 
33  std::vector<PowerNode> m_nodesToAdd;
34  std::vector<Point> m_nodesToRemove;
35  std::vector<PowerGrid> m_powerGrids;
36 };
37 
38 #endif
PowerManager::getAdjacentPowerGrids
std::vector< int > getAdjacentPowerGrids(const PowerNode &powerNode, std::vector< PowerGrid > &powerGrids)
Definition: PowerManager.cxx:54
PowerManager::update
void update()
Definition: PowerManager.cxx:21
PowerManager::rebuildZoneArea
std::vector< PowerGrid > rebuildZoneArea(PowerGrid &powerGrid)
Definition: PowerManager.cxx:130
PowerGrid
Definition: PowerGrid.hxx:17
PowerManager::updatePowerLevels
void updatePowerLevels()
Updates all PowerGrid's power levels.
Definition: PowerManager.cxx:175
PowerManager::m_powerProduced
int m_powerProduced
Definition: PowerManager.hxx:15
PowerManager::addPowerNodeToGrid
void addPowerNodeToGrid(PowerNode &powerNode, std::vector< PowerGrid > &powerGrids)
Definition: PowerManager.cxx:71
PowerManager::updatePlacedNodes
void updatePlacedNodes(const MapNode &mapNode)
Definition: PowerManager.cxx:141
PowerGrid.hxx
MapNode
Class that holds map nodes.
Definition: MapNode.hxx:30
MapNode.hxx
PowerManager::m_nodesToRemove
std::vector< Point > m_nodesToRemove
Definition: PowerManager.hxx:34
PowerManager::PowerManager
PowerManager()
Definition: PowerManager.cxx:7
PowerManager::m_nodesToAdd
std::vector< PowerNode > m_nodesToAdd
Definition: PowerManager.hxx:33
PowerNode
Definition: PowerGrid.hxx:8
PowerManager::reset
void reset()
Definition: PowerManager.cxx:183
PowerManager::updateRemovedNodes
void updateRemovedNodes(const MapNode *mapNode)
Definition: PowerManager.cxx:158
PowerManager
Definition: PowerManager.hxx:7
Point
Definition: Point.hxx:7
PowerManager::m_powerGrids
std::vector< PowerGrid > m_powerGrids
Definition: PowerManager.hxx:35
PowerManager::removePowerNode
void removePowerNode(Point coordinate)
Definition: PowerManager.cxx:100