// statobjactfact.cpp -- the action factory for static object actions // // Written by Frederic Bouvier, started May 2002. // // Copyright (C) 2002 Frederic Bouvier - fredb@users.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: statobjactfact.cpp,v 1.10 2005/05/09 07:02:15 fredb Exp $ #ifdef _MSC_VER #pragma warning( disable : 4786 ) #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "statobjactfact.hpp" #include #include "statobjact.hpp" FGSD_StaticObjectActionFactory::~FGSD_StaticObjectActionFactory() { } FGSD_Action *FGSD_StaticObjectActionFactory::createAction( const char *__project, SGPropertyNode *__node ) { FGSD_Action *ret = 0; SGPropertyNode *nm = __node->getChild( "name" ); if ( nm ) { std::string name = nm->getStringValue(); if ( name == "move" ) ret = new FGSD_MoveStaticObjectAction; else if ( name == "change" || name == "rotate" ) ret = new FGSD_ChangeStaticObjectAction; else if ( name == "add" ) ret = new FGSD_AddRemoveStaticObjectAction( true ); else if ( name == "remove" ) ret = new FGSD_AddRemoveStaticObjectAction( false ); if ( ret ) ret->load( __project, __node ); } return ret; } std::string FGSD_StaticObjectActionFactory::getName() const { return "static-object"; } FGSD_StaticObjectActionFactory staticObjectActionFactory;