Advertisement
Guest User

MapGenerator.h

a guest
Nov 26th, 2013
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #ifndef MAPGENERATOR_H
  2. #define MAPGENERATOR_H
  3.  
  4. #include "Map.h"
  5. #include <vector>
  6.  
  7. struct BSPNode {
  8.     int row, column;
  9.     int width, height;
  10.  
  11.     BSPNode* A;
  12.     BSPNode* B;
  13. };
  14.  
  15. class MapGenerator {
  16.     private:
  17.         std::vector<BSPNode*> rooms;
  18.  
  19.         void SplitNode(BSPNode* node, int currentDepth, int maxDepth);
  20.         void CreateRooms(Map* map);
  21.         void ConnectRooms(Map* map);
  22.  
  23.     public:
  24.         static const int MIN_NODE_SIZE = 3;
  25.  
  26.         MapGenerator();
  27.         virtual ~MapGenerator();
  28.  
  29.         Map* GenerateMap(int w, int h, int depth);
  30. };
  31.  
  32. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement