123456789101112131415161718192021222324252627282930 |
- #pragma once
- #include <Array.h>
- #include <Reader.h>
- #include <Writer.h>
- class Animal;
- class Entity;
- class AnimalAI : public Framework::ReferenceCounter
- {
- private:
- Animal* zAnimal;
- int ticksToNextAction;
- Framework::Array<int> viewableEntities;
- int viewDistance;
- public:
- AnimalAI(Animal* zAnimal);
- void onTick();
- virtual void save(Framework::StreamWriter* zWriter) const;
- virtual void load(Framework::StreamReader* zReader);
- virtual void onDamage(Entity* zAttacker, float damage) = 0;
- virtual void onEntityEntersView(Entity* zEntity);
- virtual void onEntityLeavesView(Entity* zEntity);
- virtual int desideAction() = 0;
- };
|