Entity.cpp 1.4 KB

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