123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #include "BlockType.h"
- #include "Block.h"
- using namespace Framework;
- BlockType::BlockType(int id,
- bool needsInstance,
- ModelInfo model,
- int initialMaxHP,
- bool needModelSubscription,
- bool fluid,
- char maxFlowDistance)
- : ReferenceCounter(),
- id(id),
- needsInstance(needsInstance),
- model(model),
- initialMaxHP(initialMaxHP),
- needModelSubscription(needModelSubscription),
- fluid(fluid),
- maxFlowDistance(maxFlowDistance)
- {}
- BlockType::~BlockType() {}
- Block* BlockType::createBlock(
- Framework::Vec3<int> position, bool passable, float speedModifier)
- {
- return new Block(this,
- position,
- model.getModel(),
- model.getTexture(),
- initialMaxHP,
- model.isTransparent(),
- needModelSubscription,
- model.getSize(),
- passable,
- speedModifier);
- }
- int BlockType::getId() const
- {
- return id;
- }
- bool BlockType::doesNeedInstance() const
- {
- return needsInstance;
- }
- bool BlockType::doesNeedModelSubscription() const
- {
- return needModelSubscription;
- }
- bool BlockType::isFluid() const
- {
- return fluid;
- }
- char BlockType::getMaxFlowDistance() const
- {
- return maxFlowDistance;
- }
- const ModelInfo& BlockType::getModelInfo() const
- {
- return model;
- }
|