EntityRemovedUpdate.cpp 518 B

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