ItemEntity.h 690 B

12345678910111213141516171819202122232425262728293031323334
  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 onFall(float collisionSpeed) override;
  13. bool hasDefaultModel() const override;
  14. ModelInfo getSpecialModel() const override;
  15. friend ItemEntityType;
  16. };
  17. class ItemEntityType : public EntityType
  18. {
  19. REGISTRABLE(ItemEntityType)
  20. public:
  21. ItemEntityType();
  22. virtual Entity* createEntity(Framework::Vec3<float> position, int dimensionId, int entityId) const override;
  23. };
  24. REGISTER(ItemEntityType, EntityType)