BlockType.h 806 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <Reader.h>
  3. #include <ReferenceCounter.h>
  4. #include <Vec3.h>
  5. #include "ModelInfo.h"
  6. #include "StaticRegistry.h"
  7. class Block;
  8. class BlockType : public virtual Framework::ReferenceCounter
  9. {
  10. private:
  11. const int id;
  12. bool needsInstance;
  13. int initialMaxHP;
  14. bool needModelSubscription;
  15. bool fluid;
  16. ModelInfo model;
  17. public:
  18. BlockType(int id,
  19. bool needsInstance,
  20. ModelInfo model,
  21. int initialMaxHP,
  22. bool needModelSubscription,
  23. bool fluid);
  24. ~BlockType();
  25. Block* createBlock(Framework::Vec3<int> position);
  26. bool doesNeedInstance() const;
  27. bool doesNeedModelSubscription() const;
  28. bool isFluid() const;
  29. const ModelInfo& getModelInfo() const;
  30. int getId() const;
  31. };