diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-27 22:55:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-27 22:55:37 +0000 |
commit | e7a3a5bb9df0609a76323b8e2546a7a02fcebc81 (patch) | |
tree | db87045389c8985cf3add6bda2992be43a0a2a51 /src/being.h | |
parent | 1e564be8f7a7339422f48ebbf98c5fb14544a96d (diff) | |
download | manaserv-e7a3a5bb9df0609a76323b8e2546a7a02fcebc81.tar.gz manaserv-e7a3a5bb9df0609a76323b8e2546a7a02fcebc81.tar.bz2 manaserv-e7a3a5bb9df0609a76323b8e2546a7a02fcebc81.tar.xz manaserv-e7a3a5bb9df0609a76323b8e2546a7a02fcebc81.zip |
Added a Controller class meant to implement behaviour loosely coupled to the
actual being. Used it to control 10 testing maggots that are now randomly
walking around.
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/being.h b/src/being.h index 6ca8f293..2782a265 100644 --- a/src/being.h +++ b/src/being.h @@ -30,6 +30,8 @@ #include "object.h" #include "utils/countedptr.h" +class Controller; + /** * Raw statistics of a Player. */ @@ -104,11 +106,27 @@ class Being : public MovingObject unsigned short getStat(int numStat) { return mStats.stats[numStat]; } + /** + * When a controller is set, updates the controller. + */ + void + update(); + + /** + * Notification that this being is now possessed by the given + * controller. This means that events regarding what happens to this + * being should be send there. + */ + void + possessedBy(Controller *controller) + { mController = controller; } + private: Being(Being const &rhs); Being &operator=(Being const &rhs); Statistics mStats; /**< stats modifiers or computed stats */ + Controller *mController; }; /** |