Commit graph

53 commits

Author SHA1 Message Date
Erik Ogenvik
2344c73837 Quote monitor tags. 2015-04-05 22:17:25 +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
3b295ca0a1 Added concept of a default entity.
Instead of the root entity always being the default one (for new
entities being created etc.) we now can specify another entity which is
the default one.
2014-08-27 22:17:09 +02:00
Erik Ogenvik
37e6cc29c1 Improve logging and creation error handling. 2013-11-15 21:40:29 +01: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
b054382f2a Add "archetype" as new type.
An archetype is used for creating new entities. It contains one or many
definitions for entities, along with relationship between them. It also
contains any extra data needed for a world simultion, such as thoughts
and knowledge.
Archetypes should be seen as blueprints for entity types, as they
describe how new one should be composed. They are created just as
regular entities, using the existing Create op functionality.
As an example, there should be one "human" entity type, with archetypes
such as "settler", "merchant", "soldier" etc. This differs from the
current setup where each of these are separate entity types.
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
79c65603aa Use insert instead of [] 2013-03-03 23:37:30 +00:00
Alistair Riddoch
745d263709 Fail cleanly if a type exists
The code would segfault if installing a new entity class failed at the last
stage in Inheritance. Inheritance would return null, which would be assigned
to the factory's m_type. addProperties() assumes the pointer is not null.
This fix adds a check, and reports a failure undoing the whole process.
2013-02-21 21:53:11 +00:00
Alistair Riddoch
3d6f39cdee Modify Property install method to take name
This change also switches DecaysProperty to using delegates as a proof of
concept.
2013-02-13 00:45:36 +00:00
Alistair Riddoch
17b9631aa1 Remove some old debug output 2013-01-22 08:32:42 +00:00
Alistair Riddoch
e4755475ac Remove unneeded Entity.h include 2013-01-18 19:43:53 +00: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
8649ee9137 Use "extern template" to reduce dependencies 2012-12-14 18:40:51 +00:00
Alistair Riddoch
2b26bdf9ca These don't need consts any more 2011-12-20 15:49:18 +00:00
Alistair Riddoch
73ae410683 This class doesn't need Property 2011-12-20 15:46:07 +00:00
Alistair Riddoch
354a358e38 This class no longer needs to know about Task 2011-12-20 15:42:27 +00:00
Alistair Riddoch
bf27269cfe Remove legacy code from before all Tasks had scripts 2011-12-20 15:41:08 +00:00
Alistair Riddoch
306fc5533c Remove dependence on concrete script factory 2011-12-20 15:40:13 +00:00
Alistair Riddoch
15391164a6 Remove dependence on concrete factory 2011-12-20 15:33:31 +00:00
Alistair Riddoch
8fb4a30bde Simplify base types vs rule types
This is the second step in cleaning up a rather messy call path
which was different when installing the classes a game actually uses
from the data files from the base rules that are common to all.
2011-12-18 03:48:30 +00:00
Alistair Riddoch
577539aa6e Make installing types a little more consistent 2011-12-17 18:37:28 +00:00
Alistair Riddoch
74fb3d2ce9 Merge branch 'master' of github.com:worldforge/cyphesis 2011-12-15 18:27:33 +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
0bc46a38be Remove header coupleying to ScriptFactory 2011-12-15 14:03:56 +00:00
Alistair Riddoch
9b26e6e04a Remove unused include 2011-12-15 01:03:00 +00:00
Alistair Riddoch
8b9cd49dfd Strip out unused populate() method from EntityFactory 2011-12-13 11:50:46 +00:00
Alistair Riddoch
e47076482c Remove obsolete method 2011-12-11 05:26:37 +00:00
Alistair Riddoch
68bd0c6e25 Refactor TaskFactory for more flexible activation matching
We can now match the target based on different critea by configuring the
factory to do different checks
2011-12-06 10:07:25 +00:00
Alistair Riddoch
eb9c58c153 Refactor the task setup interface to use LocatedEntity 2011-12-02 23:42:24 +00:00
Alistair Riddoch
a516f55197 Remove TaskScript subclass
This class really wasn't used. Task had pure virtual methods, and TaskScript
was the only subclass
2011-11-03 22:57:46 +00:00
Alistair Riddoch
d3eb9d40f2 Ensure all factories get deleted
EntityBuilder wasn't deleting the collection of factories it owns at shutdown
2011-09-30 22:25:05 +01:00
Alistair Riddoch
e0c92ebf39 Remove reference to BaseWorld in EntityBuilder 2011-09-21 12:45:18 +01:00
Alistair Riddoch
07201f1358 Handle Inheritance more consistently
Add an internal method for base classes, allowing the code that manipulates
the inheritance tree to be in a consistent place.
2011-09-18 17:26:26 +01:00
Alistair Riddoch
a0ce1a247d Re-order how an Entity is put together so that location is valid when properties are assigned 2010-09-12 19:09:25 +01:00
Alistair Riddoch
d52550a9e3 Rename Monitor class tree to Variable for clarity. 2009-09-03 00:38:50 +01:00
Alistair Riddoch
958babd997 Add new Variable files to the build, remove copied code, and fix up includes. 2009-09-03 00:27:59 +01:00
Alistair Riddoch
6bb02f6e64 Remove obsolete includes and types. 2009-08-22 02:35:56 +01:00
Alistair Riddoch
69e8de9b30 Remove unused static functions for updaing entity factories. 2009-08-20 23:25:57 +01:00
Alistair Riddoch
5c4d02395e Remove Python code TaskFactory, and use task script factory instead. 2009-08-20 22:58:11 +01:00
Alistair Riddoch
6ced0026e5 Clean up includes and declarations in the recently split classes. 2009-08-19 10:22:34 +01:00
Alistair Riddoch
c952c1eddf Remove some un-needed header. 2009-08-19 03:01:45 +01:00
Alistair Riddoch
208f553f04 Move the functionality for loading rule data, and configuring into Ruleset. 2009-08-19 02:47:15 +01:00
Alistair Riddoch
666fbd4a08 Update Script factory class names to use "kit" for abstract factory. 2009-08-18 11:14:23 +01:00
Alistair Riddoch
9fad4de0ad Update factory names to use "kit" to mean abstract factory. 2009-08-18 11:03:31 +01:00
Alistair Riddoch
820c9a5930 Modify Task script to work more like entity script and remove case conversion. 2009-07-02 16:57:00 +01:00
Alistair Riddoch
591261ad70 Modify rules processing so tasks scripts are the same format as entity scripts. 2009-07-02 15:55:29 +01:00
Alistair Riddoch
ffd019a744 Correct the spelling of persistence. 2009-03-24 03:08:45 +00:00
Alistair Riddoch
376c2cb3b2 Rename file from PersistentThingFactory to EntityFactory to match class. 2009-03-22 15:30:23 +00:00