12345678910111213141516171819202122 |
- #include "common/block/Block.h"
- Block::Block(BlockId id, const BlockName& registry)
- : id(id), registry(registry) {
- if(id > 0) {
- boxes.add(Vector3(1.0f, 1.0f, 1.0f));
- }
- }
- BlockId Block::getId() const {
- return id;
- }
- const BlockName& Block::getRegistry() const {
- return registry;
- }
- void Block::addBoxes(List<CollisionBox>& list, const Vector3& pos) const {
- for(const CollisionBox& box : boxes) {
- list.add(box.offset(pos));
- }
- }
|