1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "BlockType.h"
- #include "Block.h"
- #include "Registries.h"
- using namespace Framework;
- BlockType::BlockType(int id,
- bool needsInstance,
- ModelInfo model,
- int initialMaxHP,
- bool needModelSubscription)
- : ReferenceCounter(),
- id(id),
- needsInstance(needsInstance),
- model(model),
- initialMaxHP(initialMaxHP),
- needModelSubscription(needModelSubscription)
- {}
- BlockType::~BlockType() {}
- Block* BlockType::createBlock(Framework::Vec3<int> position)
- {
- return new Block(this,
- position,
- model.getModel(),
- model.getTexture(),
- initialMaxHP,
- model.isTransparent(),
- needModelSubscription);
- }
- int BlockType::getId() const
- {
- return id;
- }
- bool BlockType::doesNeedInstance() const
- {
- return needsInstance;
- }
- bool BlockType::doesNeedModelSubscription() const
- {
- return needModelSubscription;
- }
- const ModelInfo& BlockType::getModelInfo() const
- {
- return model;
- }
|