RoutingLump.h
Go to the documentation of this file.00001 #ifndef ROUTINGLUMP_H_
00002 #define ROUTINGLUMP_H_
00003
00004 #include <list>
00005 #include "math/Vector3.h"
00006
00007 namespace routing
00008 {
00015 enum EDirection
00016 {
00017 DIR_WEST, DIR_NORTHWEST, DIR_NORTH, DIR_NORTHEAST, DIR_EAST, DIR_SOUTHEAST, DIR_SOUTH, DIR_SOUTHWEST,
00018
00019 MAX_DIRECTIONS
00020 };
00021
00025 inline routing::EDirection operator++ (routing::EDirection &rs, int)
00026 {
00027 return rs = (routing::EDirection) (rs + 1);
00028 }
00029
00033 enum EConnectionState
00034 {
00035 CON_DISABLE, CON_CROUCHABLE, CON_WALKABLE, MAX_CONNECTIONSTATES
00036 };
00037
00041 enum EAccessState
00042 {
00043 ACC_DISABLED, ACC_CROUCH, ACC_STAND, MAX_ACCESSSTATE
00044 };
00045
00046
00047 class RoutingLumpEntry
00048 {
00049 private:
00050 Vector3 _origin;
00051 int _level;
00052 EConnectionState _connectionStates[MAX_DIRECTIONS];
00053 EAccessState _accessState;
00054 public:
00055 RoutingLumpEntry (Vector3 origin, int level);
00056 RoutingLumpEntry (const RoutingLumpEntry &other);
00057
00058 const Vector3& getOrigin (void) const {
00059 return _origin;
00060 }
00061
00062 const EConnectionState getConnectionState (const EDirection direction) const;
00068 void setConnectionState (const EDirection direction, const EConnectionState connectionState)
00069 {
00070 _connectionStates[direction] = connectionState;
00071 }
00072 const EAccessState getAccessState (void) const
00073 {
00074 return _accessState;
00075 }
00076 void setAccessState (const EAccessState accessState) {
00077 _accessState = accessState;
00078 }
00079
00080 const int getLevel (void) const {
00081 return _level;
00082 }
00083 };
00084
00085 typedef std::list<RoutingLumpEntry> RoutingLumpEntries;
00086
00087 class RoutingLump
00088 {
00089 private:
00090 RoutingLumpEntries _entries;
00091
00092 public:
00093 RoutingLump ();
00094
00095 virtual ~RoutingLump ();
00096
00097 RoutingLumpEntries& getEntries ();
00098
00100 void add (const RoutingLumpEntry& dataEntry);
00101 };
00102 }
00103 #endif