EntityType.h 979 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <Reader.h>
  3. #include <ReferenceCounter.h>
  4. #include <Writer.h>
  5. #include <Vec3.h>
  6. #include "StaticRegistry.h"
  7. #include "ModelInfo.h"
  8. class Entity;
  9. class EntityType : public virtual Framework::ReferenceCounter
  10. {
  11. private:
  12. const int id;
  13. const ModelInfo model;
  14. protected:
  15. EntityType(int id, ModelInfo model);
  16. virtual void loadSuperEntity(Entity* zEntity, Framework::StreamReader* zReader) const;
  17. virtual void saveSuperEntity(Entity* zEntity, Framework::StreamWriter* zWriter) const;
  18. virtual void createSuperEntity(Entity* zEntity) const;
  19. virtual Entity* createEntity(Framework::Vec3<float> position, int dimensionId, int entityId) const = 0;
  20. public:
  21. virtual Entity* loadEntity(Framework::StreamReader* zReader) const;
  22. virtual void saveEntity(Entity* zEntity, Framework::StreamWriter* zWriter) const;
  23. virtual Entity* createEntityAt(Framework::Vec3<float> position, int dimensionId) const;
  24. int getId() const;
  25. const ModelInfo& getModel() const;
  26. };