Entity.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include "Effect.h"
  5. #include "Inventory.h"
  6. class EntityType;
  7. class Dimension;
  8. class Game;
  9. class Entity : public Inventory
  10. {
  11. protected:
  12. float maxHP;
  13. float currentHP;
  14. float stamina;
  15. float maxStamina;
  16. float hunger;
  17. float maxHunger;
  18. float thirst;
  19. float maxThirst;
  20. Framework::Vec3<float> speed;
  21. const EntityType *zEntityType;
  22. int currentDimensionId;
  23. bool removed;
  24. virtual void onDeath();
  25. Entity( const EntityType *zType, Framework::Vec3<float> location, int dimensionId );
  26. public:
  27. virtual void tick( const Dimension *zDimension, Game *zGame );
  28. void setPosition( Framework::Vec3<float> pos );
  29. float getMaxHP() const;
  30. float getCurrentHP() const;
  31. float getStamina() const;
  32. float getMaxStamina() const;
  33. float getHunger() const;
  34. float getMaxHunger() const;
  35. float getThirst() const;
  36. float getMaxThirst() const;
  37. Framework::Vec3<float> getSpeed() const;
  38. Framework::Vec3<float> getPosition() const;
  39. int getCurrentDimensionId() const;
  40. bool isRemoved() const;
  41. const EntityType *zType() const;
  42. friend Effect;
  43. friend EntityType;
  44. };