RTS2D
|
00001 #ifndef GRAPH_H 00002 #include <cstdio> 00003 #include <cstdlib> 00004 #include <memory> 00005 #include <vector> 00006 #include <map> 00007 #include <set> 00008 #include <string> 00009 #include <algorithm> 00010 #include <queue> 00011 #include <cmath> 00012 #include "Define.h" 00013 #include "Edge.h" 00014 #include "Node.h" 00015 #include "TileProperty.h" 00016 #include "BuildingProperty.h" 00017 #define GRAPH_H 00018 00022 class Graph { 00023 public: 00024 Graph(std::vector<std::string> mapMatrix); 00025 virtual ~Graph(); 00026 int getRows(); 00027 int getColumns(); 00028 Node*** getNode(); 00029 Edge*** getAdj(); 00030 std::map<int,int> getZoneEquivalency(); 00031 void makeGraph(std::vector<std::string> mapMatrix); 00032 void insertEdge(Node* v, Node* w, float cost); 00033 void show(); 00034 bool bfs(Node* s, Node* t); 00035 bool dijkstra(Node* s, Node* t); 00036 bool groupDijkstra(Node* s, std::vector<Node*> t); 00037 Node* noPathDijkstra(Node* s, std::set<int> zones); 00038 Node* noPathDijkstra2(Node* s, Node* t); 00039 Node* dijkstraBuild(Node* s, int buildType); 00040 Node* dijkstraEnemyBuilding(Node* s, int team); 00041 bool isInsertBuildingValid(Node* s, int buildType); 00042 bool isInMapDimension(int x, int y); 00043 double estimate(Node* s, Node* t); 00044 bool astar(Node* s, Node* t); 00045 void setZone(); 00046 void setZone2(); 00047 00048 protected: 00049 private: 00050 int rows_; 00051 int columns_; 00052 Edge*** adj_; 00053 Node*** node_; 00054 std::map<int,int> zoneEquivalency_; 00055 }; 00056 00057 #endif // GRAPH_H