ItemEntity.h 747 B

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