2006-06-26 00:21:32 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2006 Alistair Riddoch
|
|
|
|
|
//
|
|
|
|
|
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2006-06-26 00:21:32 +00:00
|
|
|
#ifndef COMMON_PROPERTY_MANAGER_H
|
|
|
|
|
#define COMMON_PROPERTY_MANAGER_H
|
|
|
|
|
|
2013-02-22 09:57:10 +00:00
|
|
|
#include <Atlas/Objects/ObjectsFwd.h>
|
|
|
|
|
|
2013-02-17 08:47:51 +00:00
|
|
|
#include <map>
|
2006-06-26 00:21:32 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
2006-07-03 01:29:07 +00:00
|
|
|
class PropertyBase;
|
2013-02-17 08:47:51 +00:00
|
|
|
class PropertyKit;
|
|
|
|
|
|
|
|
|
|
typedef std::map<std::string, PropertyKit *> PropertyFactoryDict;
|
2006-06-26 00:21:32 +00:00
|
|
|
|
2006-12-24 Al Riddoch <alriddoch@zepler.org>
* index.dox, common/BaseWorld.cpp, common/BaseWorld.h,
common/PropertyFactory.h, common/PropertyManager.h, common/const.h,
rulesets/ActivePropertyFactory.h, rulesets/Entity.h,
rulesets/Py_Vector3D.h, rulesets/Py_World.h, rulesets/Py_WorldTime.h,
rulesets/PythonMindScript.cpp, rulesets/PythonMindScript.h,
rulesets/PythonScript.h,
rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp,
rulesets/PythonWrapper.h, rulesets/Script.cpp, rulesets/Script.h,
server/ArithmeticFactory.h, server/CommServer.h, server/CommSocket.h,
server/ScriptFactory.cpp, server/TaskFactory.cpp,
server/TaskFactory.h, server/WorldRouter.cpp, tools/AdminClient.h,
tools/cyaddrules.cpp, tools/cycmd.cpp, tools/cyconfig.cpp,
tools/cydumprules.cpp, tools/cyloadrules.cpp:
Add a truck load of inline docs.
* tools/cywatchdog.cpp: Mark obsolete file as removed from the build.
* tools/cyloadrules.cpp, tools/cyconfig.cpp, tools/cyaddrules.cpp:
Rename some overly generic types so they have more indicative
and unique names.
* FIXME, server/ScriptFactory.cpp, server/TaskFactory.h: Add a couple
of formal FIXMEs to sort out the code for loading modules and
classes.
* rulesets/PythonThingScript.h: Remove some commented out code.
2006-12-24 14:42:05 +00:00
|
|
|
/// \brief Base class for classes that handle creating Entity properties.
|
2006-06-26 00:21:32 +00:00
|
|
|
class PropertyManager {
|
|
|
|
|
protected:
|
2013-02-17 08:47:51 +00:00
|
|
|
// Data structure for factories and the like?
|
|
|
|
|
std::map<std::string, PropertyKit *> m_propertyFactories;
|
|
|
|
|
|
2006-12-24 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.h, client/Py_CreatorClient.h,
common/BaseEntity.cpp, common/PropertyFactory.h,
common/PropertyManager.cpp, common/PropertyManager.h,
rulesets/ArithmeticScript.h, rulesets/Py_BBox.h,
rulesets/Py_EntityWrapper.h, rulesets/Py_Location.h,
rulesets/Py_Map.h, rulesets/Py_Mind.h, rulesets/Py_Object.h,
rulesets/Py_Operation.h, rulesets/Py_Oplist.h, rulesets/Py_Point3D.h,
rulesets/Py_Property.h, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.h, rulesets/Py_Task.h, rulesets/Py_Thing.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, server/Account.h,
server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
server/Player.h, server/ServerRouting.cpp, server/ServerRouting.h,
server/TaskFactory.h: Add more inline documentation. Harmonise
argument names, and move documentation comments into base classes
as necessary.
* FIXME: More notes on a factory related fixme.
* TODO: Add more stuff to do.
2006-12-24 17:18:54 +00:00
|
|
|
/// \brief Singleton instance pointer for any subclass
|
2006-06-26 00:21:32 +00:00
|
|
|
static PropertyManager * m_instance;
|
|
|
|
|
|
|
|
|
|
PropertyManager();
|
|
|
|
|
|
2013-02-22 09:57:10 +00:00
|
|
|
void installFactory(const std::string &,
|
|
|
|
|
PropertyKit *);
|
2006-06-26 00:21:32 +00:00
|
|
|
public:
|
|
|
|
|
virtual ~PropertyManager();
|
|
|
|
|
|
2006-12-24 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.h, client/Py_CreatorClient.h,
common/BaseEntity.cpp, common/PropertyFactory.h,
common/PropertyManager.cpp, common/PropertyManager.h,
rulesets/ArithmeticScript.h, rulesets/Py_BBox.h,
rulesets/Py_EntityWrapper.h, rulesets/Py_Location.h,
rulesets/Py_Map.h, rulesets/Py_Mind.h, rulesets/Py_Object.h,
rulesets/Py_Operation.h, rulesets/Py_Oplist.h, rulesets/Py_Point3D.h,
rulesets/Py_Property.h, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.h, rulesets/Py_Task.h, rulesets/Py_Thing.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, server/Account.h,
server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
server/Player.h, server/ServerRouting.cpp, server/ServerRouting.h,
server/TaskFactory.h: Add more inline documentation. Harmonise
argument names, and move documentation comments into base classes
as necessary.
* FIXME: More notes on a factory related fixme.
* TODO: Add more stuff to do.
2006-12-24 17:18:54 +00:00
|
|
|
/// \brief Add a new named property to an Entity
|
|
|
|
|
///
|
2007-09-22 15:34:04 +00:00
|
|
|
/// @param name a string giving the name of the property.
|
2008-09-27 15:40:59 +00:00
|
|
|
virtual PropertyBase * addProperty(const std::string & name,
|
|
|
|
|
int type) = 0;
|
2006-07-03 01:29:07 +00:00
|
|
|
|
2013-02-22 09:57:10 +00:00
|
|
|
virtual int installFactory(const std::string & type_name,
|
|
|
|
|
const Atlas::Objects::Root & type_desc,
|
|
|
|
|
PropertyKit * factory);
|
|
|
|
|
|
2013-02-17 23:28:15 +00:00
|
|
|
PropertyKit * getPropertyFactory(const std::string &) const;
|
2013-02-17 18:57:36 +00:00
|
|
|
|
2006-12-24 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.h, client/Py_CreatorClient.h,
common/BaseEntity.cpp, common/PropertyFactory.h,
common/PropertyManager.cpp, common/PropertyManager.h,
rulesets/ArithmeticScript.h, rulesets/Py_BBox.h,
rulesets/Py_EntityWrapper.h, rulesets/Py_Location.h,
rulesets/Py_Map.h, rulesets/Py_Mind.h, rulesets/Py_Object.h,
rulesets/Py_Operation.h, rulesets/Py_Oplist.h, rulesets/Py_Point3D.h,
rulesets/Py_Property.h, rulesets/Py_Quaternion.h,
rulesets/Py_RootEntity.h, rulesets/Py_Task.h, rulesets/Py_Thing.h,
rulesets/PythonArithmeticScript.cpp,
rulesets/PythonArithmeticScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonThingScript.h, server/Account.h,
server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
server/Player.h, server/ServerRouting.cpp, server/ServerRouting.h,
server/TaskFactory.h: Add more inline documentation. Harmonise
argument names, and move documentation comments into base classes
as necessary.
* FIXME: More notes on a factory related fixme.
* TODO: Add more stuff to do.
2006-12-24 17:18:54 +00:00
|
|
|
/// \brief Return the registered singleton instance of any subclass
|
2006-07-03 01:29:07 +00:00
|
|
|
static PropertyManager * instance() {
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
2013-02-17 18:57:36 +00:00
|
|
|
|
|
|
|
|
friend class PropertyManagertest;
|
2006-06-26 00:21:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // COMMON_PROPERTY_MANAGER_H
|