EntityType.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 EntityTypeEnum
  10. {
  11. public:
  12. static const int PLAYER = 0;
  13. static const int ITEM = 1;
  14. };
  15. class EntityType : public virtual Framework::ReferenceCounter
  16. {
  17. private:
  18. const int id;
  19. const ModelInfo model;
  20. protected:
  21. EntityType(int id, ModelInfo model);
  22. virtual void loadSuperEntity(Entity* zEntity, Framework::StreamReader* zReader) const;
  23. virtual void saveSuperEntity(Entity* zEntity, Framework::StreamWriter* zWriter) const;
  24. virtual void createSuperEntity(Entity* zEntity) const;
  25. public:
  26. virtual Entity* loadEntity(Framework::StreamReader* zReader) const;
  27. virtual void saveEntity(Entity* zEntity, Framework::StreamWriter* zWriter) const;
  28. virtual Entity* createEntityAt(
  29. Framework::Vec3<float> position, int dimensionId) const;
  30. virtual Entity* createEntity(Framework::Vec3<float> position,
  31. int dimensionId,
  32. int entityId) const = 0;
  33. int getId() const;
  34. const ModelInfo& getModel() const;
  35. };