Commit graph

192 commits

Author SHA1 Message Date
Erik Ogenvik
b509b8b11d Don't load server rules in client. 2018-12-16 23:20:33 +01:00
Erik Ogenvik
02afb7fb73 Fixed Location imports. 2018-12-16 22:51:36 +01:00
Erik Ogenvik
e85f0831b2 Restructure rule classes.
Classes under "rulesets" have been moved to "rules", and split up into
futher subdirectories matching their library. As a result we can now
better separate the python bindings, so that things that belongs to the
simulation are separeted from things that belongs to the ai.
2018-10-31 21:38:35 +01:00
Erik Ogenvik
f87233cd53 Clean up code. 2018-10-30 19:35:57 +01:00
Erik Ogenvik
7e064963c6 Remove Plant and replace it with scripts. 2018-08-19 00:00:46 +02:00
Erik Ogenvik
139d229f80 Sync Python method names with C++. 2018-08-17 22:04:07 +02:00
Erik Ogenvik
6a3ec31b7e Remove Character class.
This is crucial since it now means that any entity can be controlled by
a mind. This makes the world much more versatile.
2018-08-14 22:25:56 +02:00
Erik Ogenvik
ddab8046de Work on removing Character. 2018-08-09 21:30:10 +02:00
Erik Ogenvik
0592987f84 Remove Creator and add AdminMind.
The mind is instead responsible for allowing extra editing capabilities.
This makes the entity hierarchy smaller.
2018-08-08 22:27:43 +02:00
Erik Ogenvik
e6bc7b2790 Use Ref for handling ref counting.
All LocatedEntities should always be handled through Ref instances.
These makes sure that the ref counting is correctly handled.
2018-07-22 23:48:42 +02:00
Erik Ogenvik
0ca22bcf68 Specify scripts for entity as property.
This allows multiple scripts to be used. In addition it allows for
entity with specific scripts.
2018-07-04 19:20:24 +02:00
Erik Ogenvik
d7960b3100 Improve on how updated types are handled.
By installing and changing some types, other types might update. This is
now handled.
2018-05-08 14:32:02 +02:00
Erik Ogenvik
d4604d034d Correctly handled updated type properties.
When a type is updated we now property re-apply modified properties on
affected entities.
2018-04-29 17:21:44 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
fd34c235e4 Remove "transforms" and "modespec" property.
These properties didn't work out when we moved to a physics based world.
Instead we've introduced the properties "planted-offset" and "planted-scaled-offset".
These properties takes a float and specified vertical offset for planted entities.

Likewise with "planted-rotation" which specifies a rotation applied for planted entities.
"active-rotation" keeps track of any applied rotation.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
894a8389b0 Added signal emitted when property is updated.
Used to let other components listen to properties being altered.
2016-12-15 18:27:42 +01:00
Olek Wojnar
9e1b3b92c3 Fix typos
Courtesy of lintian
2016-09-06 22:29:36 -04:00
Erik Ogenvik
8cfe2ba0eb Altered signature to prevent ambiguity. 2016-06-26 20:13:31 +02:00
Erik Ogenvik
d5d11df11e Let "transforms" property determine pos and orient
Instead of directly setting position and orientation we've now
added a "transforms" property. This property contains zero or many
transformations. The result of these is what drives changes to an
entity's position and orientation.
By cleanly separate disrete transformations we can more easily undo
or alter them. This allows us to do things where the position or
orientation of an entity is affected by other properties, or other
entities.

The client protocol is intact. Changes to position and orientation is
still sent the same way, by specifying "pos" and "orientation". However,
these values will now not be written directly to corresponding values on
 the entity. Instead they will first be written to the "transforms" property,
with the final values being a result of combining all data in the property.
2016-06-26 19:11:15 +02:00
Erik Ogenvik
dccaec3c41 Don't set default attributes when restoring.
When we're restoring from storage we don't want to apply any properties
at all when the entity is created, since we'll do that ourselves in a
later pass. This is done by submitting an invalid RootOperation pointer.
2014-09-15 21:11:35 +02:00
Erik Ogenvik
45555fd698 Use custom format for archetypes.
This required the EntityKit to be refactored, so that most fields are
pushed into EntityFactory. Due to the nature of how the rule handlers
and the factories interact the code is pretty messy. It works, but it's
tangled and not really clean.
2013-11-15 21:39:35 +01:00
Erik Ogenvik
0974c28f3c Use standard format for exported entities. 2013-11-15 21:39:35 +01:00
Erik Ogenvik
de230e5833 Moved creation logic to the factory.
This is in preparation for nested entity creation and archetypes.
2013-11-15 21:38:24 +01:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
4a9c7078f7 Refactor to use LocatedEntity as base class
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
2013-01-17 10:17:07 +00:00
Alistair Riddoch
6efe646c9a Move EntityKit into common 2011-12-21 00:17:06 +00:00
Alistair Riddoch
4d25e36790 Fix includes
This class doesn't actually need the concrete factory
2011-12-20 15:27:49 +00:00
Alistair Riddoch
1f4b7bf1b9 Move PythonScriptFactory into the correct named file in the right place 2011-12-15 18:26:37 +00:00
Alistair Riddoch
325d9265f3 Remove updateChildren to updateProperties
This name makes more sense, and now the interface is more consistent.
2011-12-13 00:40:43 +00:00
Alistair Riddoch
a59c17f109 Remove now empty method 2011-12-13 00:39:08 +00:00
Alistair Riddoch
e7466a5230 Simplify the way properties are propagated to child types 2011-12-13 00:34:41 +00:00
Alistair Riddoch
9f9f4c33dc Remove python include from non-python file 2011-12-12 22:27:12 +00:00
Alistair Riddoch
2f90f90dcb Add addProperties() to EntityKit, reducing complexity in Ruleset 2011-09-16 10:50:47 +01:00
Alistair Riddoch
d778be9aff Replicate the remainder of updateChildrenProperties in TypeNode
Fix up stubs
2011-09-15 23:54:33 +01:00
Alistair Riddoch
ef03d69b97 Add updateChildren() to EntityKit
This is code copied from Ruleset, but it doesn't really seem to belong there.
2011-09-15 23:05:41 +01:00
Alistair Riddoch
1172f0388c Simplify the template factory interface to make de-coupling easier. 2010-07-15 13:09:27 +01:00
Alistair Riddoch
915675f77c Remove unused dependency on EntityBuilder. 2009-08-19 02:44:58 +01:00
Alistair Riddoch
376c2cb3b2 Rename file from PersistentThingFactory to EntityFactory to match class. 2009-03-22 15:30:23 +00:00
Al Riddoch
84c1a94412 Rename files for EntityBuilder from EntityFactory to match the class rename. 2009-03-12 00:50:25 +00:00
Al Riddoch
233b8bedd2 2008-11-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
	  of the hard coded statistics property from Character.

	* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
	  default wrapper for a statistics property because it will no
	  longer work this way.

	* rulesets/Python_API.cpp: Remove the setup for the Statistics
	  wrapper.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Change the footprint of this class so it is no longer hooked
	  into part of the Character class, and instead handles looking
	  up values from the script directly, and owns the script itself.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp: Remove setup of hard coded
	  statistics property.

	* rulesets/Statistics.h, rulesets/Statistics.cpp,
	  rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
	  rulesets/Makefile.am: Remove clases that are no longer used.
2008-11-29 23:17:38 +00:00
Al Riddoch
4a147f0c97 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Clean up error messages using more
	  concise types.
2008-11-17 15:45:43 +00:00
Al Riddoch
2b5bac6dd8 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Use the name length constant in checks.
2008-11-13 03:36:43 +00:00
Al Riddoch
725e065bec 2008-11-13 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Check class names do not violate a
	  32 character limit before installing them, so they never get
	  as far as the database limit.

	* common/Database.cpp: Modify the rules table so it limits
	  the ID to the right size.
2008-11-13 03:13:41 +00:00
Al Riddoch
3532bbd2a4 2008-11-07 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Comment out some half written code that
	  was causing a warning.
2008-11-07 01:25:17 +00:00
Al Riddoch
765ff4b095 2008-09-27 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Now that the property manager always
	  creates something, there is no longer any need to deal with it
	  returning 0.
2008-09-27 16:25:50 +00:00
Al Riddoch
ff6663c66c 2008-09-16 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Remove the hard coded Structure class.

	* data/buildings.xml: Add a soft structure class which sets the simple
	  flag to 0.
2008-09-16 18:42:42 +00:00
Al Riddoch
d80ad46aef 2008-09-12 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Re-order the setup of class and instance
	  properties on an Entity so they are installed and applied correctly.
2008-09-12 14:01:35 +00:00
Al Riddoch
555e3f8f01 2008-09-11 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp, server/EntityFactory.h: Remove all code
	  relating to the old persistence mechanism.
2008-09-11 16:55:25 +00:00
Al Riddoch
cc67ecd3e3 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: When tasks cause defaults to be changed,
	  also propagate the changes to the class properties.
	  Fixes https://bugs.launchpad.net/bugs/268725
2008-09-11 00:44:45 +00:00
Al Riddoch
a48953b212 2008-09-10 Al Riddoch <alriddoch@googlemail.com>
* server/EntityFactory.cpp: Set the class flag on class properties.
2008-09-10 14:18:10 +00:00