diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-09 01:21:04 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-09 01:21:04 +0000 |
commit | 82e51328e0cc1e1e17565420fecb05df68827f07 (patch) | |
tree | 1449db69349bfa59242a862e6d5a50b32782115d /game/activityOf.h | |
parent | Push link based movement into Vehicle (diff) | |
download | ilt-82e51328e0cc1e1e17565420fecb05df68827f07.tar.bz2 ilt-82e51328e0cc1e1e17565420fecb05df68827f07.tar.xz ilt-82e51328e0cc1e1e17565420fecb05df68827f07.zip |
Split ActivityOf<> into its own file
Diffstat (limited to 'game/activityOf.h')
-rw-r--r-- | game/activityOf.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/game/activityOf.h b/game/activityOf.h new file mode 100644 index 0000000..a26efd1 --- /dev/null +++ b/game/activityOf.h @@ -0,0 +1,17 @@ +#ifndef ACTIVITYOF_H +#define ACTIVITYOF_H + +#include "activity.h" +#include "vehicles/vehicle.h" + +template<typename T> class Activity::Of : public Activity { + void + apply(Vehicle * v, TickDuration dur) const override + { + if (auto tv = dynamic_cast<Can<T> *>(v)) { + tv->doActivity(static_cast<const T *>(this), dur); + } + } +}; + +#endif |