Entity.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #include "Entity.h"
  2. Entity::Entity( const EntityType *zType, Framework::Vec3<float> location, int dimensionId )
  3. : Inventory( location ),
  4. zEntityType( zType ),
  5. currentDimensionId( dimensionId ),
  6. removed( 0 )
  7. {}
  8. void Entity::onDeath()
  9. {}
  10. void Entity::tick( const Dimension *zDimension, Game *zGame )
  11. {
  12. // TODO
  13. }
  14. void Entity::setPosition( Framework::Vec3<float> pos )
  15. {
  16. location = pos;
  17. }
  18. float Entity::getMaxHP() const
  19. {
  20. return maxHP;
  21. }
  22. float Entity::getCurrentHP() const
  23. {
  24. return currentHP;
  25. }
  26. float Entity::getStamina() const
  27. {
  28. return stamina;
  29. }
  30. float Entity::getMaxStamina() const
  31. {
  32. return maxStamina;
  33. }
  34. float Entity::getHunger() const
  35. {
  36. return hunger;
  37. }
  38. float Entity::getMaxHunger() const
  39. {
  40. return maxHunger;
  41. }
  42. float Entity::getThirst() const
  43. {
  44. return thirst;
  45. }
  46. float Entity::getMaxThirst() const
  47. {
  48. return maxThirst;
  49. }
  50. Framework::Vec3<float> Entity::getSpeed() const
  51. {
  52. return speed;
  53. }
  54. Framework::Vec3<float> Entity::getPosition() const
  55. {
  56. return location;
  57. }
  58. int Entity::getCurrentDimensionId() const
  59. {
  60. return currentDimensionId;
  61. }
  62. bool Entity::isRemoved() const
  63. {
  64. return removed;
  65. }
  66. const EntityType *Entity::zType() const
  67. {
  68. return zEntityType;
  69. }