Commit graph

21 commits

Author SHA1 Message Date
Erik Ogenvik
e80d07560c Reload entity scripts when python code changes.
For now we reload all scripts. We should be smarter and only reload
those scripts which are affected though.
2018-04-30 23:34:58 +02:00
Erik Ogenvik
7ae19d5038 Use Singleton base class.
I.e. make sure that all objects have a defined life time. This requires
that we actually set up and tear down the singletons.
2018-04-25 20:15:29 +02: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
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
3f9d0fb99c Make the test a friend, removing test subclass 2013-03-03 22:48:04 +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
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
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
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
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
5c4d02395e Remove Python code TaskFactory, and use task script factory instead. 2009-08-20 22:58:11 +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
9fad4de0ad Update factory names to use "kit" to mean abstract factory. 2009-08-18 11:03:31 +01:00
Alistair Riddoch
1b6dfb6220 Remove unused template forward declaration. 2009-08-18 10:58:17 +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
Renamed from server/EntityFactory.h (Browse further)