BlockType.h 919 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <Reader.h>
  3. #include <ReferenceCounter.h>
  4. #include <Vec3.h>
  5. #include "ModelInfo.h"
  6. class Block;
  7. class BlockType : public virtual Framework::ReferenceCounter
  8. {
  9. private:
  10. const int id;
  11. bool needsInstance;
  12. int initialMaxHP;
  13. bool needModelSubscription;
  14. bool fluid;
  15. char maxFlowDistance;
  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. char maxFlowDistance);
  25. ~BlockType();
  26. Block* createBlock(
  27. 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. };