NoBlock.cpp 1.6 KB

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