D:/simple_rts/include/WaypointList.h

Go to the documentation of this file.
00001 #ifndef __WAYPOINT_LIST_H__
00002 #define __WAYPOINT_LIST_H__
00003 
00004 #pragma once
00005 
00006 #include <cassert>
00007 #include <deque>
00008 using std::deque;
00009 
00010 
00011 // ----------------------------------------------------------------------------
00012 template<typename UserState>
00013 class WaypointList
00014 {
00015 // Data Storage
00016 // ----------------------------------------------------------------------------
00017 private:
00018         deque< UserState* >             mWaypoints;
00019 
00020 
00021 // Construction
00022 // ----------------------------------------------------------------------------
00023 public:
00024         WaypointList ()
00025         {
00026                 mWaypoints.clear ();
00027         }
00028 
00029 
00030 // Path Management
00031 // ----------------------------------------------------------------------------
00032 public:
00033 
00034         // ----------------------------------------------------------------------------
00035         size_t WaypointList::getNumWaypoints () const
00036         {
00037                 return mWaypoints.size ();
00038         }
00039 
00040 
00041         // ----------------------------------------------------------------------------
00042         void WaypointList::addWaypointToFront ( UserState* waypoint )
00043         {
00044                 mWaypoints.push_front ( waypoint );
00045         }
00046 
00047 
00048         // ----------------------------------------------------------------------------
00049         void addWaypointToBack ( const UserState& waypoint )
00050         {
00051                 mWaypoints.push_back ( waypoint );
00052         }
00053 
00054 
00055         // ----------------------------------------------------------------------------
00056         // TODO
00057         //              Phase these out in favor of a WaypointListIterator
00058         UserState* getWaypoint ( size_t index ) const
00059         {
00060                 assert ( index < mWaypoints.size() );
00061                 return mWaypoints[index];
00062         }
00063 };
00064 
00065 #endif

Generated on Sun Jun 25 19:23:43 2006 for Valors End by  doxygen 1.4.7