HOG2
MapFlatAbstraction.h
Go to the documentation of this file.
1 /*
2  * $Id: MapFlatAbstraction.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 6/10/05.
6  * Modified by Nathan Sturtevant on 02/29/20.
7  *
8  * This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
9  *
10  */
11 
12 #include "MapAbstraction.h"
13 
14 #ifndef MAPFLATABSTRACTION_H
15 #define MAPFLATABSTRACTION_H
16 
17 class MapFlatAbstraction : public MapAbstraction {
18 public:
22  virtual MapAbstraction *Clone(Map *_m) { return new MapFlatAbstraction(_m); }
23 
24  virtual bool Pathable(node *from, node *to);
25 
26  // utility functions
28  virtual void VerifyHierarchy();
29 
30  // hierarchical modifications
32  virtual void RemoveNode(node *n);
34  virtual void RemoveEdge(edge *e, unsigned int absLevel);
36  virtual void AddNode(node *n);
38  virtual void AddEdge(edge *e, unsigned int absLevel);
41  virtual void RepairAbstraction();
42 private:
45  std::vector<int> groups;
46 };
47 
48 #endif // MAPFLATABSTRACTION_H
MapFlatAbstraction::RemoveNode
virtual void RemoveNode(node *n)
remove node from abstraction
Definition: MapFlatAbstraction.cpp:75
MapFlatAbstraction::RemoveEdge
virtual void RemoveEdge(edge *e, unsigned int absLevel)
remove edge from abstraction
Definition: MapFlatAbstraction.cpp:81
MapFlatAbstraction
Definition: MapFlatAbstraction.h:17
MapFlatAbstraction::buildConnectivityGroups
void buildConnectivityGroups()
Definition: MapFlatAbstraction.cpp:25
MapFlatAbstraction::groups
std::vector< int > groups
Definition: MapFlatAbstraction.h:45
MapFlatAbstraction::groupsValid
bool groupsValid
Definition: MapFlatAbstraction.h:44
MapFlatAbstraction::VerifyHierarchy
virtual void VerifyHierarchy()
verify that the hierarchy is consistent
Definition: MapFlatAbstraction.cpp:71
MapFlatAbstraction::AddEdge
virtual void AddEdge(edge *e, unsigned int absLevel)
add edge to abstraction
Definition: MapFlatAbstraction.cpp:99
MapFlatAbstraction::RepairAbstraction
virtual void RepairAbstraction()
This must be called after any of the above add/remove operations.
Definition: MapFlatAbstraction.cpp:104
MapFlatAbstraction::Pathable
virtual bool Pathable(node *from, node *to)
Definition: MapFlatAbstraction.cpp:59
MapAbstraction.h
MapFlatAbstraction::Clone
virtual MapAbstraction * Clone(Map *_m)
return a new abstraction map of the same type as this map abstraction
Definition: MapFlatAbstraction.h:22
MapFlatAbstraction::~MapFlatAbstraction
~MapFlatAbstraction()
Definition: MapFlatAbstraction.cpp:21
MapFlatAbstraction::AddNode
virtual void AddNode(node *n)
add node to abstraction
Definition: MapFlatAbstraction.cpp:86
MapFlatAbstraction::MapFlatAbstraction
MapFlatAbstraction(Map *_m)
Definition: MapFlatAbstraction.cpp:14
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
Map
A tile-based representation of the world.
Definition: Map.h:142
edge
Edge class for connections between node in a Graph.
Definition: Graph.h:129