#include #include #include using namespace RAT::SeedModifiers; #include using namespace std; SeedModifierFactory::SeedModifierFactory() { fFactory.Register( SolarDriveModifier::Name(), new Alloc() ); } void SeedModifierFactory::Register( std::string name, AllocBase* allocator ) { fFactory.Register( name, allocator ); } SeedModifier* SeedModifierFactory::GetSeedModifier( const std::string& name ) { string seedModifierName, initialisation(""); const size_t hyphenPos = name.find( "-" ); if( hyphenPos != string::npos ) { seedModifierName = name.substr( 0, hyphenPos ); initialisation = name.substr( hyphenPos + 1 ); } else seedModifierName = name; SeedModifier* seedModifier = fFactory.New( seedModifierName ); seedModifier->Initialise( initialisation ); return seedModifier; }