| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** 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 3 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, see <http://www.gnu.org/licenses/>.
- */
- /******************************************************************************
- *
- * FILE
- *
- * DESCRIPTION
- *
- * PROGRAMMER
- * Denzil E. Long, Jr.
- *
- * VERSION INFO
- * $Author: Byon_g $
- * $Revision: 4 $
- * $Modtime: 8/16/00 11:58a $
- * $Archive: /Commando/Code/Scripts/ScriptFactory.cpp $
- *
- ******************************************************************************/
- #include "scriptfactory.h"
- #include "scriptregistrar.h"
- #include "scripts.h"
- #include "dprint.h"
- #include <string.h>
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::ScriptFactory
- *
- * DESCRIPTION
- * ScriptFactory constructor
- *
- * INPUTS
- * Name - Script name.
- * Parameters - Parameter description string.
- *
- * RESULTS
- * NONE
- *
- ******************************************************************************/
- ScriptFactory::ScriptFactory(const char* name, const char* param)
- : mNext(NULL)
- {
- // Save script name
- assert(name != NULL);
- ScriptName = name;
- // Save parameter description
- assert(param != NULL);
- ParamDescription = param;
- // Register this factory with the registrar
- ScriptRegistrar::RegisterScript(this);
- }
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::~ScriptFactory
- *
- * DESCRIPTION
- * ScriptFactory destructor
- *
- * INPUTS
- * NONE
- *
- * RESULTS
- * NONE
- *
- ******************************************************************************/
- ScriptFactory::~ScriptFactory()
- {
- // Remove this factory from the registrar
- ScriptRegistrar::UnregisterScript(this);
- ScriptName = NULL;
- ParamDescription = NULL;
- }
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::GetNext
- *
- * DESCRIPTION
- * Retrieve next script factory.
- *
- * INPUTS
- * NONE
- *
- * RESULTS
- * ScriptFactory*
- *
- ******************************************************************************/
- ScriptFactory* ScriptFactory::GetNext(void) const
- {
- return mNext;
- }
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::SetNext
- *
- * DESCRIPTION
- * Set next script factory.
- *
- * INPUTS
- * ScriptFactory* link
- *
- * RESULTS
- * NONE
- *
- ******************************************************************************/
- void ScriptFactory::SetNext(ScriptFactory* link)
- {
- if (mNext != NULL) {
- assert(link != NULL);
- link->SetNext(mNext);
- }
- mNext = link;
- }
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::GetName
- *
- * DESCRIPTION
- * Retrieve the name.
- *
- * INPUTS
- * NONE
- *
- * RESULTS
- * Name - Name of script.
- *
- ******************************************************************************/
- const char* ScriptFactory::GetName(void)
- {
- return ScriptName;
- }
- /******************************************************************************
- *
- * NAME
- * ScriptFactory::GetParamDescription
- *
- * DESCRIPTION
- * Retrieve the parameter description.
- *
- * INPUTS
- * NONE
- *
- * RESULTS
- * Parameters - Parameter description string.
- *
- ******************************************************************************/
- const char* ScriptFactory::GetParamDescription(void)
- {
- return ParamDescription;
- }
|