BlockType.cpp 662 B

123456789101112131415161718192021222324252627282930313233
  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(
  17. this, position, model.getModel(), model.getTexture(), initialMaxHP);
  18. }
  19. int BlockType::getId() const
  20. {
  21. return id;
  22. }
  23. bool BlockType::doesNeedInstance() const
  24. {
  25. return needsInstance;
  26. }