AnimalAI.h 672 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <Array.h>
  3. #include <Reader.h>
  4. #include <Writer.h>
  5. class Animal;
  6. class Entity;
  7. class AnimalAI : public Framework::ReferenceCounter
  8. {
  9. private:
  10. Animal* zAnimal;
  11. int ticksToNextAction;
  12. Framework::Array<int> viewableEntities;
  13. int viewDistance;
  14. public:
  15. AnimalAI(Animal* zAnimal);
  16. void onTick();
  17. virtual void save(Framework::StreamWriter* zWriter) const;
  18. virtual void load(Framework::StreamReader* zReader);
  19. virtual void onDamage(Entity* zAttacker, float damage) = 0;
  20. virtual void onEntityEntersView(Entity* zEntity);
  21. virtual void onEntityLeavesView(Entity* zEntity);
  22. virtual int desideAction() = 0;
  23. };