Block.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. #include "Block.h"
  2. #include "Dimension.h"
  3. #include "Game.h"
  4. #include "InteractionConfig.h"
  5. #include "Inventory.h"
  6. #include "ItemEntity.h"
  7. #include "MultiblockStructure.h"
  8. #include "NoBlock.h"
  9. #include "PlaceableProof.h"
  10. #include "TickQueue.h"
  11. #include "WorldGenerator.h"
  12. Block::Block(
  13. int typeId, Framework::Vec3<int> pos, int dimensionId, bool hasInventory)
  14. : Inventory(pos, dimensionId, hasInventory)
  15. {
  16. transparent = false;
  17. passable = false;
  18. hp = 1;
  19. maxHP = 1;
  20. hardness = 1;
  21. this->typeId = typeId;
  22. speedModifier = 1;
  23. ticksLeftCounter = 0;
  24. wasTicked = 0;
  25. onTickCalled = 0;
  26. minTickTimeout = -1;
  27. maxTickTimeout = -1;
  28. currentTickTimeout = 0;
  29. interactable = 0;
  30. deadAndRemoved = 0;
  31. memset(zNeighbours, 0, sizeof(Block*) * 6);
  32. memset(lightEmisionColor, 0, 3);
  33. mapColor = 0;
  34. }
  35. Block::~Block() {}
  36. void Block::onDestroy(Entity* zActor, Item* zUsedItem, ItemSkill* zUsedSkill)
  37. {
  38. if (!deadAndRemoved)
  39. {
  40. for (int i = 0; i < 6; i++)
  41. {
  42. Framework::Vec3<int> pos
  43. = getPos() + getDirection(getDirectionFromIndex(i));
  44. if (neighbourTypes[i] == BlockTypeEnum::NO_BLOCK)
  45. {
  46. Game::INSTANCE->zDimension(dimensionId)
  47. ->placeBlock(pos,
  48. Game::INSTANCE->zGenerator()->generateSingleBlock(
  49. pos, dimensionId));
  50. }
  51. else
  52. {
  53. Game::INSTANCE->zDimension(dimensionId)->sendBlockInfo(pos);
  54. }
  55. }
  56. getThis();
  57. if (zActor)
  58. {
  59. for (const DropConfig* config : zBlockType()->getDropConfigs())
  60. {
  61. config->onObjectDestroyed(zActor,
  62. zUsedItem,
  63. zUsedSkill,
  64. this); // a nother block might replace this block during the
  65. // drops
  66. }
  67. }
  68. Framework::Either<Block*, int> block
  69. = Game::INSTANCE->zBlockAt(getPos(), dimensionId, 0);
  70. deadAndRemoved = 1;
  71. if (block.isA()
  72. && block.getA() == this) // no other block has replaced this block
  73. {
  74. for (MultiblockStructure* structure : structures)
  75. structure->onBlockRemoved(zActor, zUsedItem, zUsedSkill, this);
  76. Game::INSTANCE->zDimension(dimensionId)
  77. ->placeBlock(getPos(), BlockTypeEnum::AIR);
  78. }
  79. else
  80. {
  81. if (structures.getEintragAnzahl() > 0)
  82. { // replace this block in the structures
  83. Block* zReplacement = block.isA()
  84. ? block.getA()
  85. : Game::INSTANCE->zRealBlockInstance(
  86. getPos(), dimensionId);
  87. for (MultiblockStructure* structure : structures)
  88. structure->onBlockReplaced(
  89. zActor, zUsedItem, zUsedSkill, this, zReplacement);
  90. }
  91. }
  92. release();
  93. }
  94. }
  95. void Block::onDialogClosed(Framework::Text dialogId) {}
  96. void Block::broadcastModelInfoChange()
  97. {
  98. NetworkMessage* message = new NetworkMessage();
  99. sendModelInfo(message);
  100. broadcastMessage(message);
  101. }
  102. void Block::broadcastMessage(NetworkMessage* message)
  103. {
  104. if (message->isEmpty())
  105. {
  106. message->release();
  107. }
  108. else
  109. {
  110. Dimension* dim = Game::INSTANCE->zDimension(getDimensionId());
  111. if (dim)
  112. {
  113. Chunk* zChunk
  114. = dim->zChunk(Game::getChunkCenter(getPos().x, getPos().y));
  115. if (zChunk)
  116. {
  117. zChunk->notifyObservers(message);
  118. }
  119. else
  120. {
  121. message->release();
  122. }
  123. }
  124. else
  125. {
  126. message->release();
  127. }
  128. }
  129. }
  130. void Block::broadcastPassableSpeedModifierChange()
  131. {
  132. NetworkMessage* message = new NetworkMessage();
  133. message->addressBlock(this);
  134. char* msg = new char[6];
  135. msg[0] = 3;
  136. msg[1] = passable;
  137. *(float*)(msg + 2) = speedModifier;
  138. message->setMessage(msg, 6);
  139. broadcastMessage(message);
  140. }
  141. void Block::onApiCall(char messageType,
  142. Framework::StreamReader* zRequest,
  143. NetworkMessage* zResponse,
  144. Entity* zSource)
  145. {}
  146. void Block::tick(TickQueue* zQueue)
  147. {
  148. if (wasTicked) return;
  149. wasTicked = 1;
  150. ticksLeftCounter++;
  151. if (minTickTimeout >= 0)
  152. {
  153. if (currentTickTimeout < ticksLeftCounter)
  154. {
  155. onTickCalled = 1;
  156. bool blocked = 0;
  157. bool result = onTick(zQueue, ticksLeftCounter, blocked);
  158. if (blocked)
  159. {
  160. wasTicked = 0;
  161. ticksLeftCounter--;
  162. onTickCalled = 0;
  163. zQueue->addToQueue(this);
  164. return;
  165. }
  166. if (result)
  167. currentTickTimeout
  168. = MAX(MIN(currentTickTimeout - 1, maxTickTimeout),
  169. MAX(minTickTimeout, 0));
  170. else
  171. currentTickTimeout
  172. = MAX(MIN(currentTickTimeout + 1, maxTickTimeout),
  173. MAX(minTickTimeout, 0));
  174. ticksLeftCounter = 0;
  175. }
  176. }
  177. else
  178. {
  179. onTickCalled = 1;
  180. bool blocked = 0;
  181. onTick(zQueue, 1, blocked);
  182. if (blocked)
  183. {
  184. wasTicked = 0;
  185. onTickCalled = 0;
  186. zQueue->addToQueue(this);
  187. return;
  188. }
  189. }
  190. }
  191. void Block::postTick()
  192. {
  193. wasTicked = 0;
  194. if (onTickCalled)
  195. {
  196. onPostTick();
  197. onTickCalled = 0;
  198. }
  199. }
  200. void Block::setNeighbour(
  201. Direction dir, Framework::Either<Block*, int> neighbour)
  202. {
  203. if (neighbour.isA())
  204. setNeighbourBlock(dir, neighbour);
  205. else
  206. {
  207. setNeighbourBlock(dir, 0);
  208. setNeighbourType(dir, neighbour);
  209. }
  210. }
  211. void Block::setNeighbourBlock(Direction dir, Block* zN)
  212. {
  213. if (zN) setNeighbourType(dir, zN->zBlockType()->getId());
  214. zNeighbours[getDirectionIndex(dir)] = zN;
  215. }
  216. void Block::setNeighbourType(Direction dir, int type)
  217. {
  218. neighbourTypes[getDirectionIndex(dir)] = type;
  219. }
  220. void Block::addToStructure(MultiblockStructure* structure)
  221. {
  222. if (structure->isBlockMember(this))
  223. structures.add(structure);
  224. else
  225. structure->release();
  226. }
  227. void Block::onLoaded()
  228. {
  229. for (MultiblockStructure* structure : structures)
  230. structure->onBlockLoaded(dynamic_cast<Block*>(getThis()));
  231. }
  232. void Block::onUnloaded()
  233. {
  234. for (MultiblockStructure* structure : structures)
  235. structure->onBlockUnloaded(this);
  236. }
  237. Framework::XML::Element* Block::getTargetUIML() const
  238. {
  239. return Game::INSTANCE->zBlockType(typeId)->getTargetUIML();
  240. }
  241. void Block::sendModelInfo(NetworkMessage* zMessage)
  242. {
  243. // overwritten by some blocks
  244. }
  245. bool Block::interact(Item* zItem, Entity* zActor, bool& itemChanged)
  246. {
  247. bool result = 0;
  248. for (InteractionConfig* config : zBlockType()->getInteractionConfigs())
  249. {
  250. result |= config->doInteraction(this, zItem, zActor, itemChanged);
  251. }
  252. return false;
  253. }
  254. void Block::api(Framework::StreamReader* zRequest,
  255. NetworkMessage* zResponse,
  256. Entity* zSource)
  257. {
  258. char id = 0;
  259. zRequest->lese(&id, 1);
  260. switch (id)
  261. {
  262. case 0:
  263. // request model state
  264. sendModelInfo(zResponse);
  265. break;
  266. case 1: // dialog closed
  267. {
  268. short nameLen;
  269. zRequest->lese((char*)&nameLen, 2);
  270. char* name = new char[nameLen + 1];
  271. zRequest->lese(name, nameLen);
  272. name[nameLen] = 0;
  273. onDialogClosed(name);
  274. delete[] name;
  275. break;
  276. }
  277. // 2 is handled in BasicBlock
  278. default: // component request handled in BasicBlock
  279. onApiCall(id, zRequest, zResponse, zSource);
  280. }
  281. }
  282. TickSourceType Block::isTickSource() const
  283. {
  284. return NONE;
  285. }
  286. bool Block::needsTick() const
  287. {
  288. return 1;
  289. }
  290. const BlockType* Block::zBlockType() const
  291. {
  292. return Game::INSTANCE->zBlockType(typeId);
  293. }
  294. bool Block::isTransparent() const
  295. {
  296. return transparent;
  297. }
  298. bool Block::isPassable() const
  299. {
  300. return passable;
  301. }
  302. bool Block::isInteractable(const Item* zItem) const
  303. {
  304. return interactable;
  305. }
  306. float Block::getHP() const
  307. {
  308. return hp;
  309. }
  310. float Block::getMaxHP() const
  311. {
  312. return maxHP;
  313. }
  314. float Block::getHardness() const
  315. {
  316. return hardness;
  317. }
  318. float Block::getSpeedModifier() const
  319. {
  320. return speedModifier;
  321. }
  322. const Framework::Vec3<int> Block::getPos() const
  323. {
  324. return (Framework::Vec3<int>)location;
  325. }
  326. bool Block::isVisible() const
  327. {
  328. if (passable || transparent) return 1;
  329. for (int i = 0; i < 6; i++)
  330. {
  331. const Block* neighbour = CONST_BLOCK(zNeighbours[i], neighbourTypes[i]);
  332. if (neighbour->isPassable() || neighbour->isTransparent()) return 1;
  333. }
  334. return 0;
  335. }
  336. void Block::setHP(
  337. Entity* zActor, Item* zUsedItem, ItemSkill* zUsedSkill, float hp)
  338. {
  339. bool isDead = this->hp == 0.f;
  340. this->hp = MAX(0.f, hp);
  341. if (!isDead && this->hp == 0.f)
  342. {
  343. onDestroy(zActor, zUsedItem, zUsedSkill); // this will be deleted
  344. }
  345. else
  346. {
  347. NetworkMessage* changeMsg = new NetworkMessage();
  348. changeMsg->addressBlock(this);
  349. char* msg = new char[5];
  350. msg[0] = 0; // hp changed
  351. *(float*)(msg + 1) = this->hp;
  352. changeMsg->setMessage(msg, 5);
  353. Game::INSTANCE->broadcastMessage(changeMsg);
  354. }
  355. }
  356. bool Block::isDeadAndRemoved() const
  357. {
  358. return deadAndRemoved;
  359. }
  360. void Block::getLightEmisionColor(unsigned char* result) const
  361. {
  362. result[0] = lightEmisionColor[0];
  363. result[1] = lightEmisionColor[0];
  364. result[2] = lightEmisionColor[0];
  365. }
  366. void Block::filterPassingLight(unsigned char rgb[3]) const
  367. {
  368. if (!transparent) // let no light pass intransparent blocks
  369. memset(rgb, 0, 3);
  370. }
  371. Block* Block::zNeighbor(Direction dir) const
  372. {
  373. return zNeighbours[getDirectionIndex(dir)];
  374. }
  375. void Block::updateModel(ModelInfo* zInfo) const
  376. {
  377. Dimension* dim = Game::INSTANCE->zDimension(getDimensionId());
  378. if (dim)
  379. {
  380. Chunk* zChunk
  381. = dim->zChunk(Game::getChunkCenter(getPos().x, getPos().y));
  382. if (zChunk)
  383. {
  384. NetworkMessage* changeMsg = new NetworkMessage();
  385. changeMsg->addressBlock(this);
  386. Framework::InMemoryBuffer buffer;
  387. zInfo->writeTo(&buffer);
  388. char* msg = new char[(int)buffer.getSize() + 1];
  389. msg[0] = 1; // hmodel change
  390. buffer.lese(msg + 1, (int)buffer.getSize());
  391. changeMsg->setMessage(msg, (int)buffer.getSize() + 1);
  392. zChunk->notifyObservers(changeMsg);
  393. }
  394. }
  395. }
  396. int Block::getMapColor() const
  397. {
  398. return mapColor;
  399. }
  400. BasicBlockItem::BasicBlockItem(int itemTypeId,
  401. int blockTypeId,
  402. Framework::Text name,
  403. PlaceableProof* placeableProof)
  404. : Item(itemTypeId, name),
  405. transparent(0),
  406. passable(0),
  407. hardness(1.f),
  408. speedModifier(1.f),
  409. interactable(1),
  410. placeableProof(placeableProof)
  411. {
  412. this->blockTypeId = blockTypeId;
  413. placeable = 1;
  414. }
  415. BasicBlockItem::~BasicBlockItem()
  416. {
  417. if (placeableProof) placeableProof->release();
  418. }
  419. bool BasicBlockItem::canBeStackedWith(const Item* zItem) const
  420. {
  421. const BasicBlockItem* item = dynamic_cast<const BasicBlockItem*>(zItem);
  422. if (item)
  423. {
  424. return Item::canBeStackedWith(zItem) && transparent == item->transparent
  425. && passable == item->passable && hardness == item->hardness
  426. && speedModifier == item->speedModifier
  427. && interactable == item->interactable;
  428. }
  429. return 0;
  430. }
  431. bool BasicBlockItem::canBePlacedAt(
  432. int dimensionId, Framework::Vec3<int> worldPos) const
  433. {
  434. return Item::canBePlacedAt(dimensionId, worldPos)
  435. && (!placeableProof
  436. || placeableProof->isPlacable(this, worldPos, dimensionId));
  437. }
  438. BasicBlockItemType::BasicBlockItemType()
  439. : ItemType(),
  440. transparent(0),
  441. passable(0),
  442. hardness(1.f),
  443. speedModifier(1.f),
  444. blockTypeName(""),
  445. placeableProof(0)
  446. {}
  447. BasicBlockItemType::BasicBlockItemType(Framework::Text name,
  448. ModelInfo* model,
  449. bool transparent,
  450. bool passable,
  451. float hardness,
  452. float speedModifier,
  453. Framework::Text blockTypeName,
  454. PlaceableProof* placeableProof,
  455. int maxStackSize,
  456. Framework::RCArray<Framework::Text> groups)
  457. : ItemType(),
  458. transparent(transparent),
  459. passable(passable),
  460. hardness(hardness),
  461. speedModifier(speedModifier),
  462. blockTypeName(blockTypeName),
  463. placeableProof(placeableProof)
  464. {
  465. setName(name);
  466. setModel(model);
  467. setMaxStackSize(maxStackSize);
  468. for (Framework::Text* group : groups)
  469. addGroup(*group);
  470. }
  471. BasicBlockItemType::~BasicBlockItemType()
  472. {
  473. if (placeableProof) placeableProof->release();
  474. }
  475. bool BasicBlockItemType::initialize(Game* zGame)
  476. {
  477. blockTypeId = zGame->getBlockTypeId(blockTypeName);
  478. return blockTypeId >= 0 && ItemType::initialize(zGame);
  479. }
  480. int BasicBlockItemType::getBlockTypeId() const
  481. {
  482. return blockTypeId;
  483. }
  484. void BasicBlockItemType::setTransparent(bool transparent)
  485. {
  486. this->transparent = transparent;
  487. }
  488. bool BasicBlockItemType::isTransparent() const
  489. {
  490. return transparent;
  491. }
  492. void BasicBlockItemType::setPassable(bool passable)
  493. {
  494. this->passable = passable;
  495. }
  496. bool BasicBlockItemType::isPassable() const
  497. {
  498. return passable;
  499. }
  500. void BasicBlockItemType::setHardness(float hardness)
  501. {
  502. this->hardness = hardness;
  503. }
  504. float BasicBlockItemType::getHardness() const
  505. {
  506. return hardness;
  507. }
  508. void BasicBlockItemType::setSpeedModifier(float speedModifier)
  509. {
  510. this->speedModifier = speedModifier;
  511. }
  512. float BasicBlockItemType::getSpeedModifier() const
  513. {
  514. return speedModifier;
  515. }
  516. void BasicBlockItemType::setBlockTypeName(Framework::Text blockTypeName)
  517. {
  518. this->blockTypeName = blockTypeName;
  519. }
  520. Framework::Text BasicBlockItemType::getBlockTypeName() const
  521. {
  522. return blockTypeName;
  523. }
  524. void BasicBlockItemType::setPlaceableProof(PlaceableProof* placeableProof)
  525. {
  526. if (this->placeableProof) this->placeableProof->release();
  527. this->placeableProof = placeableProof;
  528. }
  529. PlaceableProof* BasicBlockItemType::zPlaceableProof() const
  530. {
  531. return placeableProof;
  532. }
  533. void BasicBlockItemType::loadSuperItem(
  534. Item* zItem, Framework::StreamReader* zReader) const
  535. {
  536. ItemType::loadSuperItem(zItem, zReader);
  537. BasicBlockItem* item = dynamic_cast<BasicBlockItem*>(zItem);
  538. if (!item)
  539. throw "BasicBlockItemType::loadSuperItem was called with an invalid "
  540. "item";
  541. zReader->lese((char*)&item->transparent, 1);
  542. zReader->lese((char*)&item->passable, 1);
  543. zReader->lese((char*)&item->hardness, 4);
  544. zReader->lese((char*)&item->speedModifier, 4);
  545. zReader->lese((char*)&item->interactable, 1);
  546. }
  547. void BasicBlockItemType::saveSuperItem(
  548. const Item* zItem, Framework::StreamWriter* zWriter) const
  549. {
  550. ItemType::saveSuperItem(zItem, zWriter);
  551. const BasicBlockItem* item = dynamic_cast<const BasicBlockItem*>(zItem);
  552. if (!item)
  553. throw "BasicBlockItemType::saveSuperItem was called with an invalid "
  554. "item";
  555. zWriter->schreibe((char*)&item->transparent, 1);
  556. zWriter->schreibe((char*)&item->passable, 1);
  557. zWriter->schreibe((char*)&item->hardness, 4);
  558. zWriter->schreibe((char*)&item->speedModifier, 4);
  559. zWriter->schreibe((char*)&item->interactable, 1);
  560. }
  561. Item* BasicBlockItemType::createItem() const
  562. {
  563. BasicBlockItem* item = new BasicBlockItem(id,
  564. blockTypeId,
  565. name,
  566. placeableProof
  567. ? dynamic_cast<PlaceableProof*>(placeableProof->getThis())
  568. : 0);
  569. item->transparent = transparent;
  570. item->passable = passable;
  571. item->hardness = hardness;
  572. item->speedModifier = speedModifier;
  573. item->interactable = 1;
  574. return item;
  575. }
  576. BasicBlockItemTypeFactory::BasicBlockItemTypeFactory()
  577. : ItemTypeFactoryBase()
  578. {}
  579. BasicBlockItemType* BasicBlockItemTypeFactory::createValue(
  580. Framework::JSON::JSONObject* zJson) const
  581. {
  582. return new BasicBlockItemType();
  583. }
  584. BasicBlockItemType* BasicBlockItemTypeFactory::fromJson(
  585. Framework::JSON::JSONObject* zJson) const
  586. {
  587. BasicBlockItemType* result = ItemTypeFactoryBase::fromJson(zJson);
  588. result->setTransparent(zJson->zValue("transparent")->asBool()->getBool());
  589. result->setPassable(zJson->zValue("passable")->asBool()->getBool());
  590. result->setHardness(
  591. (float)zJson->zValue("hardness")->asNumber()->getNumber());
  592. result->setSpeedModifier(
  593. (float)zJson->zValue("speedModifier")->asNumber()->getNumber());
  594. result->setBlockTypeName(
  595. zJson->zValue("blockType")->asString()->getString());
  596. result->setPlaceableProof(
  597. zJson->zValue("placeableProof")->getType()
  598. == Framework::AbstractType::OBJECT
  599. ? Game::INSTANCE->zTypeRegistry()->fromJson<PlaceableProof>(
  600. zJson->zValue("placeableProof"))
  601. : 0);
  602. return result;
  603. }
  604. Framework::JSON::JSONObject* BasicBlockItemTypeFactory::toJsonObject(
  605. BasicBlockItemType* zObject) const
  606. {
  607. Framework::JSON::JSONObject* result
  608. = ItemTypeFactoryBase::toJsonObject(zObject);
  609. result->addValue(
  610. "transparent", new Framework::JSON::JSONBool(zObject->isTransparent()));
  611. result->addValue(
  612. "passable", new Framework::JSON::JSONBool(zObject->isPassable()));
  613. result->addValue(
  614. "hardness", new Framework::JSON::JSONNumber(zObject->getHardness()));
  615. result->addValue("speedModifier",
  616. new Framework::JSON::JSONNumber(zObject->getSpeedModifier()));
  617. result->addValue("blockType",
  618. new Framework::JSON::JSONString(zObject->getBlockTypeName()));
  619. result->addValue("placeableProof",
  620. zObject->zPlaceableProof() ? Game::INSTANCE->zTypeRegistry()->toJson(
  621. zObject->zPlaceableProof())
  622. : new Framework::JSON::JSONValue());
  623. return result;
  624. }
  625. JSONObjectValidationBuilder* BasicBlockItemTypeFactory::addToValidator(
  626. JSONObjectValidationBuilder* builder) const
  627. {
  628. return ItemTypeFactoryBase::addToValidator(
  629. builder->withRequiredBool("transparent")
  630. ->withDefault(false)
  631. ->finishBool()
  632. ->withRequiredBool("passable")
  633. ->withDefault(false)
  634. ->finishBool()
  635. ->withRequiredNumber("hardness")
  636. ->withDefault(1.f)
  637. ->finishNumber()
  638. ->withRequiredNumber("speedModifier")
  639. ->withDefault(1.f)
  640. ->finishNumber()
  641. ->withRequiredString("blockType")
  642. ->finishString()
  643. ->withRequiredAttribute("placeableProof",
  644. Game::INSTANCE->zTypeRegistry()->getValidator<PlaceableProof>())
  645. ->withRequiredObject("placeableProof")
  646. ->withDefaultNull()
  647. ->whichCanBeNull()
  648. ->finishObject());
  649. }
  650. const char* BasicBlockItemTypeFactory::getTypeToken() const
  651. {
  652. return "placeable";
  653. }