ItemEntity.h 688 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "Entity.h"
  3. #include "EntityType.h"
  4. class ItemEntityType;
  5. class ItemEntity : public Entity
  6. {
  7. private:
  8. ItemSlot* slot;
  9. ItemEntity(Framework::Vec3<float> location, int dimensionId, int entityId);
  10. public:
  11. void tick(const Dimension* zDimension) override;
  12. void api(Framework::StreamReader* zRequest, NetworkResponse* zResponse) override;
  13. void onFall(float collisionSpeed) override;
  14. friend ItemEntityType;
  15. };
  16. class ItemEntityType : public EntityType
  17. {
  18. REGISTRABLE(ItemEntityType)
  19. public:
  20. ItemEntityType();
  21. virtual Entity* createEntity(Framework::Vec3<float> position, int dimensionId, int entityId) const override;
  22. };
  23. REGISTER(ItemEntityType, EntityType)