Commit Graph

52 Commits

Author SHA1 Message Date
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
penev92
bf332b6619 Fixed fields missing the readonly modifier 2022-01-22 18:47:06 +00:00
Vapre
2ea2815529 CallFunc, avoid null check. 2021-08-20 12:31:04 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
teinarss
10676be377 Replace F extension with string interpolation 2021-05-08 22:20:59 +02:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
Vapre
78253ce284 Activity, fixes.
Do not call SkipDoneActivities method recursively via the
NextActivity property. Rather use the nextActivity member.
Avoiding additional function calls and a recursively
growing stack.

Do not call ChildActivity and NextActivity properties
twice in a row. Once to test for null and after to access
it's value. It will cause the complete list of activities
to be traversed twice looking for non done activities.

Replace Queue method with a version that does not the
NextActivity property causing an extra call to
SkipDoneActivities. Avoid calling Queue recursively.

Similar replace QueueChild with a version that does
not call additional methods.

Note that ActivitiesImplementing returns only non
done activities. The method name does not suggest this.

Please consider making NextActivity a method to cleary indicate it
involves the logic of skipping Done activities. To let
the called know it is 'expensive'.

Please consider renaming the protected property ChildActivity to
FirstChildActivityNotDone to avoid it being used as childActivity.

Please consider maintaining a pointer to the first
non done activity. This avoids the need the each time find it.
2020-12-24 23:02:07 +00:00
teinarss
13581c030d Use in parameter for Target 2020-11-06 22:02:24 +01:00
teinarss
9c4fd0e3d3 Use Null-Propagation Operator 2020-08-19 18:11:07 +01:00
abcdefg30
b1b74c13c3 Ensure that we never tick an activity before calling OnFirstRun 2020-02-16 16:58:06 +01:00
abcdefg30
c4a5540bfd Ensure that we never run Done child activities 2020-02-16 16:58:06 +01:00
abcdefg30
abcb2ea512 Directly mark queued activities that are cancelled as Done 2020-02-16 16:58:06 +01:00
Paul Chote
6f52365f9d Don't run NextActivity if it has been canceled. 2020-01-18 16:38:53 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Oliver Brakmann
5d786f411f Update comment in Activity.cs
SequenceActivities() was removed.
2019-09-02 01:45:35 +02:00
tovl
58bb7fcbc0 Rework minefield visualisation. 2019-08-05 02:53:09 +01:00
Turupawn
3240b1e9eb Overhaul target line rendering:
- Targets are now defined by the activities
- Queued activities are shown
- Support custom attack colors
2019-08-05 02:53:09 +01:00
tovl
3790169db9 Make Tick return bool 2019-07-03 20:42:19 +02:00
tovl
09c1611239 Always check if activity state is Done. 2019-07-03 20:42:19 +02:00
tovl
714b09ac4f Add default for Activity-Tick 2019-07-03 20:42:19 +02:00
tovl
b9c302a73a Move ChildActivity handling into base Activity class. 2019-07-03 20:42:19 +02:00
RoosterDragon
58dced7e05 Silence some doc errors in VS2019. 2019-06-21 21:22:12 +02:00
Paul Chote
dabc7ec8dd Remove unnecessary this. references. 2019-06-08 13:19:27 +02:00
Paul Chote
ecd8dee575 Add TransformsInto* traits to trigger construction yard undeploy. 2019-06-08 02:09:30 +02:00
Paul Chote
62b5d22e53 Add INotify(Activity)StanceChanged interfaces. 2019-05-21 15:52:55 +02:00
reaperrr
da6bf1a57d Make ActorTags display ChildActivities 2019-05-04 21:33:10 +02:00
Oliver Brakmann
b4fd7331b2 Simplify Activity class
After the removal of the CompositeActivity class, all the supporting
code that made it work can be removed as well.
2019-03-30 14:38:23 +00:00
Oliver Brakmann
44ca01d36c Remove pretick argument from Activity.Queue()
Pre-ticking a next activity would break the assumption that activities
in a queue would be processed in sequence.
2019-03-24 15:53:13 +00:00
tovl
705795abde Activity.Cancel returns void instead of bool. 2019-03-09 21:47:43 +00:00
tovl
a17cd0fa06 Replaced Canceled state with Canceling state. 2019-03-09 21:47:43 +00:00
tovl
8191a6566b Add missing self and optional pretick parameters to Queue, QueueChild and PrintActivity methods.
This means sequenceActivities needs to accept self as well.
2019-03-09 21:47:43 +00:00
tovl
69004f2b94 Prevent premature nulling of childactivities. 2019-03-09 21:47:43 +00:00
tovl
35dba74ded remove unused CompositeActivity 2019-03-09 21:47:43 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
reaperrr
9bcb754836 Add OnActorDispose plumbing to Activity
This allows activities to perform necessary cleanups on actor
death/disposal, for example by running OnLastRun directly,
which would otherwise be skipped when the actor dies or is disposed
through other means.
2018-09-24 22:01:22 +02:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
dd709a2679 Revert "Have some activities count as idle activities"
This reverts commit ae111248f3.
2017-08-10 12:22:28 +02:00
Oliver Brakmann
f9951f76ca Allow cancelling an activity without aborting the entire queue 2017-04-30 19:07:50 +01:00
abcdefg30
ae111248f3 Have some activities count as idle activities 2017-03-24 18:06:10 +01:00
Oliver Brakmann
4105f9ed22 Add a debugging helper to print the activity tree 2017-01-22 20:39:43 +01:00
Oliver Brakmann
581640c4d4 Add a 'Canceled' activity state 2017-01-22 20:39:40 +01:00
Oliver Brakmann
660124156f Add built-in support for child and composite activities 2017-01-22 20:39:17 +01:00
Oliver Brakmann
0dfbd46b1f Let activities know when they are being run for the first or last time 2017-01-21 18:37:00 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Oliver Brakmann
fd22b19183 Use consistent spelling of 'interrupt[a|i]ble' 2016-11-13 15:50:22 +01:00
Oliver Brakmann
2c66ee8c13 Add native support for uninterruptible activities
This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
2016-10-31 18:46:27 +01:00
Oliver Brakmann
3e9bf7aa4d Turn Actor.GetCurrentActivity into a property 2016-10-31 18:46:27 +01:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00