// tileactfact.cpp -- the action factory for tile 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: tileactfact.cpp,v 1.9 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 "tileactfact.hpp" #include #include "tileact.hpp" FGSD_TileActionFactory::~FGSD_TileActionFactory() { } FGSD_Action *FGSD_TileActionFactory::createAction( const char *__project, SGPropertyNode *__node ) { FGSD_Action *ret = 0; SGPropertyNode *nm = __node->getChild( "name" ); if ( nm ) { std::string name = nm->getStringValue(); if ( name == "add" ) ret = new FGSD_AddRemoveTileAction( true ); else if ( name == "remove" ) ret = new FGSD_AddRemoveTileAction( false ); if ( ret ) ret->load( __project, __node ); } return ret; } std::string FGSD_TileActionFactory::getName() const { return "scenery-tiles"; } FGSD_TileActionFactory tileActionFactory;