Dragonfly  4.3
A text-based game engine
EventPath.h
1 ///
2 /// An "pathfinding" event
3 ///
4 
5 #ifndef __EVENT_PATH_H__
6 #define __EVENT_PATH_H__
7 
8 // Engine includes.
9 #include "Event.h"
10 #include "Path.h"
11 
12 namespace df {
13 
14 const std::string PATH_EVENT = "df::path";
15 
16 enum SearchResult {
17  NOT_FOUND,
18  INCOMPLETE,
19  FOUND,
20 };
21 
22 class EventPath : public Event {
23 
24  private:
25  SearchResult m_result; ///< Result of search.
26  Path m_path; ///< Path found, if successful.
27 
28  public:
29  EventPath();
30 
31  // Construct event with path.
32  EventPath(Path path);
33 
34  // Set result.
35  void setResult(SearchResult new_result);
36 
37  // Return result.
38  SearchResult getResult() const;
39 
40  // Set path.
41  void setPath(Path new_path);
42 
43  // Return path.
44  Path getPath() const;
45 };
46 
47 } // end of namespace df
48 #endif // __EVENT_PATH_H__
Definition: Path.h:16
SearchResult m_result
Result of search.
Definition: EventPath.h:25
Definition: Event.h:15
A 2-d bounding box.
Definition: Box.h:10
Definition: EventPath.h:22
Path m_path
Path found, if successful.
Definition: EventPath.h:26