BlockType.h 938 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. char maxFlowDistance;
  17. ModelInfo model;
  18. public:
  19. BlockType(int id,
  20. bool needsInstance,
  21. ModelInfo model,
  22. int initialMaxHP,
  23. bool needModelSubscription,
  24. bool fluid,
  25. char maxFlowDistance);
  26. ~BlockType();
  27. Block* createBlock(Framework::Vec3<int> position, bool passable, float speedModifier);
  28. bool doesNeedInstance() const;
  29. bool doesNeedModelSubscription() const;
  30. bool isFluid() const;
  31. char getMaxFlowDistance() const;
  32. const ModelInfo& getModelInfo() const;
  33. int getId() const;
  34. };