OdinAI

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List

All Classes Namespaces Functions Variables
GraphNodes.h
1 /*******************************************************************************
2 * ________ .___.__ _____ .___
3 * \_____ \ __| _/|__| ____ / _ \ | |
4 * / | \ / __ | | |/ \ / /_\ \| |
5 * / | \/ /_/ | | | | \/ | \ |
6 * \_______ /\____ | |__|___| /\____|__ /___|
7 * \/ \/ \/ \/
8 *
9 * Copyright (c) Emil Sandstø 2012
10 *******************************************************************************/
11 #ifndef ODINAI_GRAPH_NODES_H_
12 #define ODINAI_GRAPH_NODES_H_
13
14 namespace OdinAI
15 {
21 class GraphNode
22 {
23 public:
24 GraphNode() : m_index(0) {}
25 GraphNode(int index) : m_index(index) {}
26
27 virtual ~GraphNode() {}
28
29 void SetIndex(int index);
30 int GetIndex() const;
31 protected:
32 int m_index;//Graph node index.
33 };
34
35 template<class Vector>
36 class NavGraphNode : public GraphNode
37 {
38 public:
39 NavGraphNode() {}
40
41 NavGraphNode(int index) : GraphNode(index) {}
42
43 NavGraphNode(int index, const Vector &v) : GraphNode(index), m_position(v) {}
44
45 const Vector &GetPosition() const
46 {
47 return m_position;
48 }
49
50 void SetPosition(const Vector &position)
51 {
52 m_position = position;
53 }
54 private:
55 Vector m_position;
56 };
57
58 }
59 #endif
OdinAI::GraphNode
Definition: GraphNodes.h:21