EntityRemovedUpdate.cpp 616 B

1234567891011121314151617181920212223242526
  1. #include "EntityRemovedUpdate.h"
  2. #include "Dimension.h"
  3. EntityRemovedUpdate::EntityRemovedUpdate( int entityId, int dimensionId, Framework::Vec3<int> pos )
  4. : WorldUpdate( EntityRemovedUpdateType::ID, 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. }
  17. EntityRemovedUpdateType::EntityRemovedUpdateType()
  18. : WorldUpdateType( ID )
  19. {}