NoBlock.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #include "NoBlock.h"
  2. NoBlockBlockType::NoBlockBlockType(const Block* defaultB, Framework::Text name)
  3. : BlockType(0,
  4. new ModelInfo("", Framework::RCArray<Framework::Text>(), 0, 1.f),
  5. 0,
  6. 1,
  7. 0,
  8. name,
  9. false,
  10. 0,
  11. Framework::RCArray<Framework::Text>(), 0),
  12. defaultB(defaultB)
  13. {}
  14. ItemType* NoBlockBlockType::createItemType() const
  15. {
  16. return 0;
  17. }
  18. Block* NoBlockBlockType::createBlock(
  19. Framework::Vec3<int> position, int dimensionId) const
  20. {
  21. return 0;
  22. }
  23. Item* NoBlockBlockType::createItem() const
  24. {
  25. return 0;
  26. }
  27. Block* NoBlockBlockType::loadBlock(Framework::Vec3<int> position,
  28. Framework::StreamReader* zReader,
  29. int dimensionId) const
  30. {
  31. return 0;
  32. }
  33. void NoBlockBlockType::saveBlock(
  34. Block* zBlock, Framework::StreamWriter* zWriter) const
  35. {}
  36. Item* NoBlockBlockType::getItemFromBlock(Block* zBlock) const
  37. {
  38. return 0;
  39. }
  40. Block* NoBlockBlockType::createBlockAt(
  41. Framework::Vec3<int> position, int dimensionId, Item* zUsedItem) const
  42. {
  43. return 0;
  44. }
  45. const Block* NoBlockBlockType::zDefault() const
  46. {
  47. return defaultB;
  48. }
  49. NoBlock::NoBlock()
  50. : Block(BlockTypeEnum::NO_BLOCK, {0, 0, 0}, 0, false)
  51. {
  52. transparent = 0;
  53. passable = 0;
  54. hp = 0;
  55. maxHP = 0;
  56. hardness = 0;
  57. }
  58. bool NoBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  59. {
  60. return 0;
  61. }
  62. void NoBlock::onPostTick() {}
  63. const NoBlock NoBlock::INSTANCE;
  64. AirBlock::AirBlock()
  65. : Block(BlockTypeEnum::AIR, {0, 0, 0}, 0, false)
  66. {
  67. transparent = 1;
  68. passable = 1;
  69. hp = 0;
  70. maxHP = 0;
  71. hardness = 0;
  72. }
  73. bool AirBlock::onTick(TickQueue* zQueue, int numTicks, bool& blocked)
  74. {
  75. return 0;
  76. }
  77. void AirBlock::onPostTick() {}
  78. const AirBlock AirBlock::INSTANCE;