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
|
|
|
#include "CorePropertyManager.h"
|
|
|
|
|
|
2013-01-10 09:33:25 +00:00
|
|
|
#include "server/Juncture.h"
|
|
|
|
|
#include "server/ServerRouting.h"
|
|
|
|
|
#include "server/TeleportProperty.h"
|
2010-06-08 23:13:14 +05:30
|
|
|
|
2018-10-31 21:38:35 +01:00
|
|
|
#include "rules/simulation/LineProperty.h"
|
|
|
|
|
#include "rules/SolidProperty.h"
|
|
|
|
|
#include "rules/simulation/StatusProperty.h"
|
|
|
|
|
#include "rules/simulation/StatisticsProperty.h"
|
|
|
|
|
#include "rules/simulation/TerrainModProperty.h"
|
|
|
|
|
#include "rules/simulation/TerrainProperty.h"
|
|
|
|
|
#include "rules/simulation/TransientProperty.h"
|
2018-12-16 20:33:13 +01:00
|
|
|
#include "rules/simulation/ServerBBoxProperty.h"
|
2018-10-31 21:38:35 +01:00
|
|
|
#include "rules/simulation/BiomassProperty.h"
|
|
|
|
|
#include "rules/simulation/BurnSpeedProperty.h"
|
|
|
|
|
#include "rules/simulation/DecaysProperty.h"
|
|
|
|
|
#include "rules/simulation/MindProperty.h"
|
|
|
|
|
#include "rules/simulation/InternalProperties.h"
|
|
|
|
|
#include "rules/simulation/SpawnProperty.h"
|
|
|
|
|
#include "rules/simulation/AreaProperty.h"
|
|
|
|
|
#include "rules/simulation/VisibilityProperty.h"
|
|
|
|
|
#include "rules/simulation/SuspendedProperty.h"
|
|
|
|
|
#include "rules/simulation/TasksProperty.h"
|
|
|
|
|
#include "rules/simulation/EntityProperty.h"
|
|
|
|
|
#include "rules/simulation/SpawnerProperty.h"
|
|
|
|
|
#include "rules/simulation/ImmortalProperty.h"
|
|
|
|
|
#include "rules/simulation/RespawningProperty.h"
|
|
|
|
|
#include "rules/simulation/DefaultLocationProperty.h"
|
|
|
|
|
#include "rules/simulation/DomainProperty.h"
|
|
|
|
|
#include "rules/simulation/LimboProperty.h"
|
|
|
|
|
#include "rules/simulation/ModeProperty.h"
|
|
|
|
|
#include "rules/simulation/PropelProperty.h"
|
|
|
|
|
#include "rules/simulation/DensityProperty.h"
|
|
|
|
|
#include "rules/simulation/AngularFactorProperty.h"
|
|
|
|
|
#include "rules/simulation/GeometryProperty.h"
|
|
|
|
|
#include "rules/QuaternionProperty.h"
|
|
|
|
|
#include "rules/Vector3Property.h"
|
2018-11-03 16:43:33 +01:00
|
|
|
#include "rules/SimpleProperty.h"
|
2018-10-31 21:38:35 +01:00
|
|
|
#include "rules/simulation/PerceptionSightProperty.h"
|
2018-12-16 20:33:13 +01:00
|
|
|
#include "rules/ScaleProperty.h"
|
2018-10-31 21:38:35 +01:00
|
|
|
#include "rules/python/ScriptsProperty.h"
|
|
|
|
|
#include "rules/simulation/UsagesProperty.h"
|
|
|
|
|
#include "rules/simulation/MindsProperty.h"
|
|
|
|
|
#include "rules/simulation/PlantedOnProperty.h"
|
|
|
|
|
#include "rules/simulation/AttachmentsProperty.h"
|
|
|
|
|
#include "rules/simulation/AdminProperty.h"
|
2006-06-29 14:57:19 +00:00
|
|
|
|
2018-10-30 20:12:45 +01:00
|
|
|
#include "common/operations/Eat.h"
|
|
|
|
|
#include "common/operations/Burn.h"
|
|
|
|
|
#include "common/operations/Teleport.h"
|
2007-06-22 12:42:35 +00:00
|
|
|
|
|
|
|
|
#include "common/types.h"
|
2013-02-22 00:37:39 +00:00
|
|
|
#include "common/Inheritance.h"
|
2006-06-29 14:57:19 +00:00
|
|
|
#include "common/PropertyFactory_impl.h"
|
|
|
|
|
|
2006-07-04 23:48:19 +00:00
|
|
|
#include "common/debug.h"
|
|
|
|
|
|
2006-12-03 06:31:43 +00:00
|
|
|
#include <Atlas/Objects/Operation.h>
|
2007-01-21 19:53:37 +00:00
|
|
|
|
2006-07-03 01:29:07 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
2007-01-10 21:58:49 +00:00
|
|
|
using Atlas::Message::Element;
|
2013-03-01 21:52:09 +00:00
|
|
|
using Atlas::Message::ListType;
|
|
|
|
|
using Atlas::Message::MapType;
|
2013-02-22 00:37:39 +00:00
|
|
|
using Atlas::Objects::Root;
|
2007-01-10 21:58:49 +00:00
|
|
|
|
2006-07-04 23:48:19 +00:00
|
|
|
static const bool debug_flag = false;
|
|
|
|
|
|
2013-02-22 23:34:51 +00:00
|
|
|
template<typename T>
|
2018-07-29 23:20:42 +02:00
|
|
|
PropertyFactory<Property<T>>* CorePropertyManager::installBaseProperty(const std::string & type_name,
|
|
|
|
|
const std::string & parent)
|
2013-02-22 23:34:51 +00:00
|
|
|
{
|
2018-07-30 10:22:50 +02:00
|
|
|
return this->installProperty<Property<T>>(type_name, parent);
|
2013-02-22 23:34:51 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-22 23:46:49 +00:00
|
|
|
template<typename PropertyT>
|
2018-07-29 23:20:42 +02:00
|
|
|
PropertyFactory<PropertyT>* CorePropertyManager::installProperty(const std::string & type_name,
|
|
|
|
|
const std::string & parent)
|
2013-02-22 23:46:49 +00:00
|
|
|
{
|
2018-07-29 23:20:42 +02:00
|
|
|
auto factory = new PropertyFactory<PropertyT>{};
|
2018-07-30 10:22:50 +02:00
|
|
|
//Attach visibility flags. Properties that starts with "__" are private, "_" are protected and the rest are public.
|
|
|
|
|
factory->m_flags = PropertyBase::flagsForPropertyName(type_name);
|
2013-02-22 23:46:49 +00:00
|
|
|
installFactory(type_name,
|
|
|
|
|
atlasType(type_name, parent),
|
2018-10-30 19:31:27 +01:00
|
|
|
std::unique_ptr<PropertyFactory<PropertyT>>(factory));
|
2018-07-29 23:20:42 +02:00
|
|
|
return factory;
|
2013-02-22 23:46:49 +00:00
|
|
|
}
|
|
|
|
|
|
2016-01-17 17:02:50 +01:00
|
|
|
template<typename PropertyT>
|
2018-07-29 23:20:42 +02:00
|
|
|
PropertyFactory<PropertyT>* CorePropertyManager::installProperty(const std::string & type_name)
|
2016-01-17 17:02:50 +01:00
|
|
|
{
|
2018-07-29 23:20:42 +02:00
|
|
|
return this->installProperty<PropertyT>(type_name, PropertyT::property_atlastype);
|
2016-01-17 17:02:50 +01:00
|
|
|
}
|
|
|
|
|
|
2016-01-21 09:26:43 +01:00
|
|
|
template<typename PropertyT>
|
2018-07-29 23:20:42 +02:00
|
|
|
PropertyFactory<PropertyT>* CorePropertyManager::installProperty()
|
2016-01-21 09:26:43 +01:00
|
|
|
{
|
2018-07-29 23:20:42 +02:00
|
|
|
return this->installProperty<PropertyT>(PropertyT::property_name, PropertyT::property_atlastype);
|
2016-01-21 09:26:43 +01:00
|
|
|
}
|
|
|
|
|
|
2016-01-17 17:02:50 +01:00
|
|
|
|
2006-06-26 00:21:32 +00:00
|
|
|
CorePropertyManager::CorePropertyManager()
|
|
|
|
|
{
|
2016-09-02 23:38:02 +02:00
|
|
|
// Core types, for inheritance only generally.
|
2013-02-22 23:34:51 +00:00
|
|
|
installBaseProperty<int>("int", "root_type");
|
|
|
|
|
installBaseProperty<double>("float", "root_type");
|
|
|
|
|
installBaseProperty<std::string>("string", "root_type");
|
2013-03-01 21:52:09 +00:00
|
|
|
installBaseProperty<ListType>("list", "root_type");
|
|
|
|
|
installBaseProperty<MapType>("map", "root_type");
|
|
|
|
|
|
2018-08-14 21:32:06 +02:00
|
|
|
installProperty<EntityProperty>("entity_ref");
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<double>>("stamina");
|
2018-02-06 13:08:23 +01:00
|
|
|
installProperty<ModeProperty>();
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<LineProperty>("coords");
|
|
|
|
|
installProperty<LineProperty>("points");
|
2017-08-02 10:04:31 +02:00
|
|
|
//installProperty<Property<IdList> >("start_intersections", "list");
|
|
|
|
|
//installProperty<Property<IdList> >("end_intersections", "list");
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<DecaysProperty>();
|
|
|
|
|
installProperty<SolidProperty>();
|
|
|
|
|
installProperty<SimpleProperty>();
|
|
|
|
|
installProperty<StatusProperty>();
|
|
|
|
|
installProperty<BiomassProperty>();
|
|
|
|
|
installProperty<BurnSpeedProperty>();
|
|
|
|
|
installProperty<TransientProperty>();
|
|
|
|
|
installProperty<Property<double>>("mass");
|
2018-12-16 20:33:13 +01:00
|
|
|
installProperty<ServerBBoxProperty>();
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<MindProperty>();
|
|
|
|
|
installProperty<SetupProperty>();
|
|
|
|
|
installProperty<TickProperty>();
|
|
|
|
|
installProperty<StatisticsProperty>();
|
|
|
|
|
installProperty<SpawnProperty>();
|
|
|
|
|
installProperty<AreaProperty>();
|
|
|
|
|
installProperty<VisibilityProperty>();
|
2016-09-19 17:45:45 +02:00
|
|
|
installProperty<TerrainModProperty>();
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<TerrainProperty>();
|
|
|
|
|
installProperty<TeleportProperty>("linked");
|
|
|
|
|
installProperty<SuspendedProperty>();
|
|
|
|
|
installProperty<TasksProperty>();
|
|
|
|
|
installProperty<SpawnerProperty>();
|
|
|
|
|
installProperty<ImmortalProperty>();
|
|
|
|
|
installProperty<RespawningProperty>();
|
|
|
|
|
installProperty<DefaultLocationProperty>();
|
|
|
|
|
installProperty<DomainProperty>();
|
|
|
|
|
installProperty<LimboProperty>();
|
2016-01-21 09:26:43 +01:00
|
|
|
installProperty<PropelProperty>();
|
2016-07-31 18:48:50 +02:00
|
|
|
installProperty<DensityProperty>();
|
2018-10-06 13:25:53 +02:00
|
|
|
installProperty<AdminProperty>();
|
2016-07-19 17:07:51 +02:00
|
|
|
/**
|
|
|
|
|
* Friction is used by the physics system. 0 is no friction, 1 is full friction.
|
2018-03-09 20:05:41 +01:00
|
|
|
* This is for "sliding", see "friction-roll" and "friction-spin".
|
2016-07-19 17:07:51 +02:00
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<double>>("friction");
|
2018-03-09 20:05:41 +01:00
|
|
|
/**
|
|
|
|
|
* Friction for rolling is used by the physics system. 0 is no friction, 1 is full friction.
|
|
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<double>>("friction_roll");
|
2018-03-09 20:05:41 +01:00
|
|
|
/**
|
|
|
|
|
* Friction for spinning is used by the physics system. 0 is no friction, 1 is full friction.
|
|
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<double>>("friction_spin");
|
2018-03-09 20:05:41 +01:00
|
|
|
|
2016-08-11 20:39:14 +02:00
|
|
|
installProperty<AngularFactorProperty>();
|
|
|
|
|
installProperty<GeometryProperty>();
|
2014-09-13 10:34:30 +02:00
|
|
|
|
2018-03-24 17:06:02 +01:00
|
|
|
/**
|
|
|
|
|
* Refers to an entity on which another entity is planted on.
|
|
|
|
|
*/
|
2018-08-14 21:32:06 +02:00
|
|
|
installProperty<PlantedOnProperty>();
|
2018-03-23 19:22:35 +01:00
|
|
|
|
2018-03-24 17:06:02 +01:00
|
|
|
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<BoolProperty>("floats");
|
2018-03-24 17:06:02 +01:00
|
|
|
|
2016-09-02 23:38:02 +02:00
|
|
|
/**
|
|
|
|
|
* Vertical offset to use when entity is planted, and adjusted to the height of the terrain.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("planted_offset");
|
2016-09-02 23:38:02 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Vertical scaled offset to use when entity is planted, and adjusted to the height of the terrain.
|
|
|
|
|
* The resulting offset is a product of this value and the height of the entity.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("planted_scaled_offset");
|
2016-09-02 23:38:02 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The rotation applied to the entity when it's planted.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<QuaternionProperty>("planted_rotation");
|
2016-09-02 23:38:02 +02:00
|
|
|
/**
|
|
|
|
|
* The current extra rotation applied to the entity.
|
2018-07-30 13:35:51 +02:00
|
|
|
* This is closely matched with "planted_rotation" to keep track of when the entity has the planted rotation applied and not.
|
2016-09-02 23:38:02 +02:00
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<QuaternionProperty>("active_rotation");
|
2016-09-02 23:38:02 +02:00
|
|
|
|
2016-09-29 23:32:28 +02:00
|
|
|
/**
|
|
|
|
|
* Used for things that grows, to limit the size.
|
|
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Vector3Property>("maxsize");
|
2017-03-24 17:19:10 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Specifies how much the entity is allowed to step onto things when moving, as a factor of the entity's height.
|
|
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<double>>("step_factor");
|
2017-03-24 17:19:10 +01:00
|
|
|
|
2018-02-11 21:15:35 +01:00
|
|
|
/**
|
2018-02-18 16:22:10 +01:00
|
|
|
* Specifies a mesh, model or mapping to use for client side presentation.
|
2018-02-11 21:15:35 +01:00
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<Property<std::string> >("present");
|
2018-02-11 21:15:35 +01:00
|
|
|
|
2018-02-11 23:22:20 +01:00
|
|
|
/**
|
|
|
|
|
* The max speed in meters per second (m/s) when moving over ground.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("speed_ground");
|
2018-02-11 23:22:20 +01:00
|
|
|
/**
|
|
|
|
|
* The max speed in meters per second (m/s) when moving in water.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("speed_water");
|
2018-02-11 23:22:20 +01:00
|
|
|
/**
|
|
|
|
|
* The max speed in meters per second (m/s) when flying.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("speed_flight");
|
2018-02-20 23:08:14 +01:00
|
|
|
/**
|
|
|
|
|
* The max speed in meters per second (m/s) when jumping.
|
|
|
|
|
*/
|
2018-07-30 13:35:51 +02:00
|
|
|
installProperty<Property<double>>("speed_jump");
|
2018-02-11 23:22:20 +01:00
|
|
|
|
2018-02-26 12:55:05 +01:00
|
|
|
/**
|
|
|
|
|
* If set to 1 the entity is a body of water, i.e. either an Ocean (if no bbox) or a lake/pond (if a bbox).
|
|
|
|
|
*/
|
2018-04-27 20:55:02 +02:00
|
|
|
installProperty<BoolProperty>("water_body");
|
2006-06-26 00:21:32 +00:00
|
|
|
|
2018-04-25 13:08:48 +02:00
|
|
|
installProperty<PerceptionSightProperty>();
|
|
|
|
|
|
2018-06-15 13:46:17 +02:00
|
|
|
/**
|
|
|
|
|
* How far away the entity can reach (used when interacting with things).
|
|
|
|
|
*/
|
|
|
|
|
installProperty<Property<double>>("reach");
|
2018-06-28 23:09:35 +02:00
|
|
|
|
|
|
|
|
installProperty<ScaleProperty>();
|
2018-06-29 12:26:08 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The max scale of an entity. This is a single value; when enforcing one dimension of the actual scale value will be used (often y).
|
|
|
|
|
*/
|
|
|
|
|
installProperty<Property<double>>("maxscale");
|
2018-07-04 19:18:03 +02:00
|
|
|
|
2018-08-02 17:19:08 +02:00
|
|
|
/**
|
|
|
|
|
* "__scripts" is meant to be installed on the Type, whereas "__scripts_instance" is meant to be installed on the entity instance.
|
|
|
|
|
* This way it should be possible to both override type scripts, and to alternatively add new ones to specific instances.
|
|
|
|
|
*/
|
|
|
|
|
installProperty<ScriptsProperty>("__scripts");
|
|
|
|
|
installProperty<ScriptsProperty>("__scripts_instance");
|
2018-07-13 17:11:23 +02:00
|
|
|
|
2018-09-08 21:50:53 +02:00
|
|
|
installProperty<UsagesProperty>("usages");
|
|
|
|
|
installProperty<UsagesProperty>("_usages");
|
2018-07-29 23:20:42 +02:00
|
|
|
|
2018-07-30 10:22:50 +02:00
|
|
|
/**
|
|
|
|
|
* Keeps track of when attachments are ready to be used again.
|
|
|
|
|
* For example, if you swing a sword you can't do anything with the sword arm for a second or two.
|
|
|
|
|
*/
|
|
|
|
|
installProperty<Property<MapType>>("_ready_at_attached")->m_flags |= per_ephem;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Keeps track of when singular entities are ready to be used again.
|
|
|
|
|
* This could be used on a magic scroll for example.
|
|
|
|
|
*/
|
|
|
|
|
installProperty<Property<double>>("ready_at")->m_flags |= per_ephem;
|
2018-08-07 20:33:51 +02:00
|
|
|
|
|
|
|
|
installProperty<MindsProperty>();
|
2018-08-14 21:32:06 +02:00
|
|
|
|
|
|
|
|
installProperty<AttachmentsProperty>();
|
2018-10-06 13:25:53 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Goals for the minds.
|
|
|
|
|
*/
|
|
|
|
|
installProperty<Property<Atlas::Message::ListType>>("_goals");
|
2006-06-26 00:21:32 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-22 00:37:39 +00:00
|
|
|
int CorePropertyManager::installFactory(const std::string & type_name,
|
2013-02-22 09:57:10 +00:00
|
|
|
const Root & type_desc,
|
2018-10-30 19:31:27 +01:00
|
|
|
std::unique_ptr<PropertyKit> factory)
|
2013-02-22 00:37:39 +00:00
|
|
|
{
|
|
|
|
|
Inheritance & i = Inheritance::instance();
|
2018-04-25 13:08:48 +02:00
|
|
|
if (i.addChild(type_desc) == nullptr) {
|
2013-02-22 00:37:39 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-30 19:31:27 +01:00
|
|
|
PropertyManager::installFactory(type_name, std::move(factory));
|
2013-02-22 00:37:39 +00:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-09-27 16:22:40 +00:00
|
|
|
PropertyBase * CorePropertyManager::addProperty(const std::string & name,
|
|
|
|
|
int type)
|
2006-06-26 00:21:32 +00:00
|
|
|
{
|
2006-07-03 01:29:07 +00:00
|
|
|
assert(!name.empty());
|
2008-09-03 22:53:58 +00:00
|
|
|
assert(name != "objtype");
|
2018-04-25 13:08:48 +02:00
|
|
|
PropertyBase * p = nullptr;
|
2018-08-19 17:15:30 +02:00
|
|
|
auto I = m_propertyFactories.find(name);
|
2006-07-03 01:29:07 +00:00
|
|
|
if (I == m_propertyFactories.end()) {
|
2008-09-27 16:22:40 +00:00
|
|
|
switch (type) {
|
|
|
|
|
case Element::TYPE_INT:
|
|
|
|
|
p = new Property<int>;
|
|
|
|
|
break;
|
|
|
|
|
case Element::TYPE_FLOAT:
|
|
|
|
|
p = new Property<double>;
|
|
|
|
|
break;
|
|
|
|
|
case Element::TYPE_STRING:
|
|
|
|
|
p = new Property<std::string>;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
p = new SoftProperty;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
p = I->second->newProperty();
|
2006-07-03 01:29:07 +00:00
|
|
|
}
|
2018-08-19 17:15:30 +02:00
|
|
|
p->flags().addFlags(PropertyBase::flagsForPropertyName(name));
|
2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* rulesets/ActivePropertyFactory_impl.h: Re-work the active property
factories so they just pass handler information to the property
classes rather than installing it themselves, so the property
can now handle installing the handlers each time they are installed
on an entity, making class default properties work.
* client/ClientPropertyManager.cpp, client/ClientPropertyManager.h,
common/PropertyFactory.h, common/PropertyFactory_impl.h,
common/PropertyManager.h, rulesets/ActivePropertyFactory.h,
server/CorePropertyManager.cpp, server/CorePropertyManager.h:
Modify the property manager and property factory interfaces so they
do not take a pointer to the owner, as this is never required any
more.
* rulesets/Character.cpp, rulesets/Entity.cpp: Modify code that uses
property managers to use the new interface.
* rulesets/SolidProperty.cpp, rulesets/SolidProperty.h: Make use of
the bool flag to implement this, preventing it from being tied to
having a pointer to the owner at creation time.
* rulesets/StatusProperty.cpp, rulesets/StatusProperty.h: Remove
the need for an owner pointer at construction time by using the
apply method.
* rulesets/TerrainModProperty.cpp, rulesets/TerrainModProperty.h:
Use new MultiActivePropertyManager and install method to handle
installing handlers rather than relying on the factory to do it.
* server/CorePropertyManager.cpp: Change many of the property
factories now that none get get an owner pointer.
* server/EntityFactory.cpp: Set up default properties on all type
nodes when a new class is installed, and don't apply instance
properties based on class defaults, relying on class properties.
* rulesets/Entity.cpp: Remove hard coded BBox property now that the
functionality is handled by a more special property.
2008-09-08 00:17:08 +00:00
|
|
|
debug(std::cout << name << " property found. " << std::endl << std::flush;);
|
2006-07-03 01:29:07 +00:00
|
|
|
return p;
|
2006-06-26 00:21:32 +00:00
|
|
|
}
|