BlockType.cpp 720 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "BlockType.h"
  2. #include "Block.h"
  3. #include "Registries.h"
  4. using namespace Framework;
  5. BlockType::BlockType(
  6. int id, bool needsInstance, ModelInfo model, int initialMaxHP)
  7. : ReferenceCounter(),
  8. id(id),
  9. needsInstance(needsInstance),
  10. model(model),
  11. initialMaxHP(initialMaxHP)
  12. {}
  13. BlockType::~BlockType() {}
  14. Block* BlockType::createBlock(Framework::Vec3<int> position)
  15. {
  16. return new Block(this,
  17. position,
  18. model.getModel(),
  19. model.getTexture(),
  20. initialMaxHP,
  21. model.isTransparent());
  22. }
  23. int BlockType::getId() const
  24. {
  25. return id;
  26. }
  27. bool BlockType::doesNeedInstance() const
  28. {
  29. return needsInstance;
  30. }