BlockType.cpp 615 B

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