EntityRemovedUpdate.cpp 516 B

123456789101112131415161718192021
  1. #include "EntityRemovedUpdate.h"
  2. #include "Dimension.h"
  3. EntityRemovedUpdate::EntityRemovedUpdate(int entityId, int dimensionId, Framework::Vec3<int> pos)
  4. : WorldUpdate(WorldUpdateTypeEnum::REMOVE_ENTITY, dimensionId, pos, pos),
  5. entityId(entityId)
  6. {}
  7. EntityRemovedUpdate::~EntityRemovedUpdate()
  8. {}
  9. void EntityRemovedUpdate::onUpdate(Dimension* zDimension)
  10. {
  11. zDimension->removeEntity(entityId);
  12. }
  13. void EntityRemovedUpdate::write(Framework::StreamWriter* zWriter)
  14. {
  15. zWriter->schreibe((char*)&entityId, 4);
  16. }