BlockType.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <Reader.h>
  3. #include <ReferenceCounter.h>
  4. #include <Vec3.h>
  5. #include "Area.h"
  6. #include "ModelInfo.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. Direction defaultFrontDirection;
  19. public:
  20. BlockType(int id,
  21. bool needsInstance,
  22. ModelInfo model,
  23. int initialMaxHP,
  24. bool needModelSubscription,
  25. bool fluid,
  26. char maxFlowDistance,
  27. Direction defaultFrontDirection);
  28. ~BlockType();
  29. Block* createBlock(Framework::Vec3<int> position,
  30. bool passable,
  31. float speedModifier,
  32. Direction frontDirection);
  33. bool doesNeedInstance() const;
  34. bool doesNeedModelSubscription() const;
  35. bool isFluid() const;
  36. char getMaxFlowDistance() const;
  37. Direction getDefaultFrontDirection() const;
  38. const ModelInfo& getModelInfo() const;
  39. int getId() const;
  40. };