Commit graph

56 commits

Author SHA1 Message Date
Erik Ogenvik
a40cad95ea Removed Location from LocatedEntity.
Since not all entities have physical location, which is more and more true
now that we have domains. Entities that are placed in non-physical domains don't have
any location data.
This also makes it easier to streamline the sending of properties, since we only need
to send the properties that actually have changed.
In addition, this helps with removing circular references, since the "m_parent" field no longer
is a Ref.
2021-06-18 22:44:30 +02:00
Erik Ogenvik
8da335d14b Use reference when possible instead of pointers. 2021-05-31 00:05:25 +02:00
Erik Ogenvik
0791649ccc Fixed various memory leaks.
We want our tests to properly clean up so we can use them to find memory leaks.
2021-05-18 22:09:57 +02:00
Erik Ogenvik
7c780c55b7 Clear up Python code. 2020-01-04 22:42:26 +01:00
Erik Ogenvik
10b8428505 Added concept of "modifers" and "ModifyProperty".
This is a way in which a child entity can affect its parent entity. A typical modification would
be to have a piece of armor affect the wearer's defense values.
Optionally Entity Filters can be applied as constraints. In the armor case it would mean that the
modification only would be active if the armor was worn.
2020-01-03 16:42:43 +01:00
Erik Ogenvik
884e96c73a Move base methods into LocatedEntity. 2019-12-04 23:56:25 +01:00
Erik Ogenvik
21f620d3ba Standardize on using std::unique_ptr.
Anytime an object is owned an instance of std::unique_ptr should be
used.
2019-11-17 22:42:15 +01:00
Erik Ogenvik
0e95108559 Use unique_ptr in more places. 2019-09-22 21:11:18 +02:00
Erik Ogenvik
164816f646 Adapt tests to changed structure. 2018-11-03 17:17:50 +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
3b091899c1 Work on fixing the tests. 2018-10-01 23:22:28 +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
c84f5fe926 Don't implicitly convert from Ref to ptr.
Since it's too easy to introduce subtle bugs.
2018-08-05 20:47:09 +02:00
Erik Ogenvik
a12b1a00a3 Delete when refs go to zero.
This changes how entities are dereferenced to work more like you would
expect.
2018-08-05 14:36:21 +02:00
Erik Ogenvik
4d1dc775b0 Moved BaseWorld to rulesets.
Since it better belongs there.
2018-07-25 00:16:09 +02:00
Erik Ogenvik
33dfbb3425 Added tests. 2018-07-24 21:18:50 +02:00
Erik Ogenvik
5a71381b8d Added default attribute to modProperty. 2018-02-26 12:05:10 +01:00
Erik Ogenvik
eb2bb200e5 Clean up and remove unused structs. 2017-07-25 23:40:39 +02:00
Erik Ogenvik
4d530e25e4 Move domain property Entity.
And rename and fixup smaller things.
2017-07-25 23:40:39 +02:00
Erik Ogenvik
1105483b1d Fixed up tests. 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
Erik Ogenvik
ebefb98283 Fixed tests. 2016-06-22 20:53:43 +02:00
Erik Ogenvik
273ab4e38c Fixed tests. 2015-04-09 14:50:45 +02:00
Erik Ogenvik
d88adb64e8 Updated tests.
These tests are truly horrible. You change one thing and then spend
three days just updating stubs in tests. The only possible solution is
to move more and more into stub classes.
2014-09-30 23:15:29 +02:00
Erik Ogenvik
7d5742b2fe Updated tests.
Started initial work on providing stubs, so that we finally can start to
reduce the amount of code needed for the tests. Some tests are using the
new stubs, but the plan is to continously move more and more code from
the tests over to the stub as they are updated.
2014-08-26 21:13:18 +02:00
Erik Ogenvik
79d6bda7b2 Properly remove properties with delegates. 2014-08-26 21:09:02 +02:00
Erik Ogenvik
359812aeb6 Fixed test after relay changes. 2013-08-22 14:20:33 +02: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
Erik Ogenvik
835b9fadd6 Alter containered signal.
Make it not single shot. And supply the old location, as it was before
the container changed.
This is to make it more useful in general.
2013-06-15 22:53:50 +02:00
Alistair Riddoch
5eceba40cf Remove unused handler mechanism 2013-02-14 10:01:20 +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
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
4e66987bad Consolidate flags into one place 2013-01-14 09:59:54 +00:00
Alistair Riddoch
72c956d4b4 First pass at copy method for all property classes 2013-01-07 23:03:25 +00:00
Alistair Riddoch
ec03a3b546 Remove Thing_parent typedef 2012-12-04 23:48:40 +00:00
Alistair Riddoch
73b81a6ff7 Remove Character_parent typedef 2012-12-04 23:39:22 +00:00
Alistair Riddoch
71cbcdcfc1 Modify externalOperation to include Link
The Link reference provided is the object allowing direct communication
back to the external source of the operation. This allows us to handle
things more cleanly in some cases.
2012-12-04 20:39:35 +00:00
Alistair Riddoch
558301a836 Add an Info handler to Character 2012-07-02 20:05:18 -07:00
Alistair Riddoch
bc001bfe76 Add Get/Info to the IG op dispatch 2012-06-30 01:06:14 -07:00
Alistair Riddoch
111581e56a Remove obsolete m_task in Character
This pointer is made obsolete now that TasksProperty holds it
2011-12-02 02:37:42 +00:00
Alistair Riddoch
ac37383d8a Convery all the property get functions 2011-09-29 17:36:26 +01:00
Alistair Riddoch
72ea3c70e1 Fix up tests 2011-02-28 00:28:25 +00:00
Alistair Riddoch
5cb0ac6ae5 Force asserts on in all tests. 2011-02-15 09:30:46 +00:00
Alistair Riddoch
85cce5e15e Add Actuate to those ops handled by Character 2010-11-23 14:00:38 +00:00
Alistair Riddoch
16ba830c42 Fixes for gcc 4.5, thanks to Alfredo Tupone 2010-10-20 22:51:42 +01:00
Alistair Riddoch
45c5e4f151 Initialise Location.loc in all tests 2010-09-16 05:14:35 +01:00
Alistair Riddoch
75ce9df3b3 Make the setProperty stub functional for test setup 2010-09-13 01:21:41 +01:00
Alistair Riddoch
ed6764c415 Change some member names to be unique and match convention. 2010-09-12 23:55:03 +01:00
Alistair Riddoch
6f10c9171f Isolate all the property coverage tests. 2010-04-08 23:57:49 +01:00