| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #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,
- Direction defaultFrontDirection)
- : ReferenceCounter(),
- id(id),
- needsInstance(needsInstance),
- model(model),
- initialMaxHP(initialMaxHP),
- needModelSubscription(needModelSubscription),
- fluid(fluid),
- maxFlowDistance(maxFlowDistance),
- defaultFrontDirection(defaultFrontDirection)
- {}
- BlockType::~BlockType() {}
- Block* BlockType::createBlock(Framework::Vec3<int> position,
- bool passable,
- float speedModifier,
- Direction dir)
- {
- return new Block(this,
- position,
- model.getModel(),
- model.getTexture(),
- initialMaxHP,
- model.isTransparent(),
- needModelSubscription,
- model.getSize(),
- passable,
- speedModifier,
- dir);
- }
- 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;
- }
- Direction BlockType::getDefaultFrontDirection() const
- {
- return defaultFrontDirection;
- }
- const ModelInfo& BlockType::getModelInfo() const
- {
- return model;
- }
|