00001 #ifndef TRAVEL_SYS_FACTORY 00002 #define TRAVEL_SYS_FACTORY 00003 00004 #include <gator/TravelMethod.h> 00005 #include <gator/SimpleDriveMethod.h> 00006 #include <gator/SimpleFlyMethod.h> 00007 #include <gator/TetheredDriveMethod.h> 00008 00009 namespace gator 00010 { 00015 class TravelMethodFactory 00016 { 00017 public: 00021 TravelMethod* create( const std::string& name ) const 00022 { 00023 if (name == "fly") 00024 { 00025 return new SimpleFlyMethod; 00026 } 00027 else if (name == "drive") 00028 { 00029 return new SimpleDriveMethod; 00030 } 00031 else if (name == "tether") 00032 { 00033 return new TetheredDriveMethod; 00034 } 00035 return NULL; 00036 } 00037 00041 std::vector<std::string> getMethodNames() const 00042 { 00043 std::vector<std::string> methods; 00044 methods.push_back( std::string( "fly" ) ); 00045 methods.push_back( std::string( "drive" ) ); 00046 methods.push_back( std::string( "tether" ) ); 00047 return methods; 00048 } 00049 private: 00050 00052 /*# TravelMethod lnkTravelMethod; */ 00053 }; 00054 } // end namespace gator 00055 00056 #endif