EntityRemovedUpdate.cpp 651 B

123456789101112131415161718192021222324252627
  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. WorldUpdate::write( zWriter );
  16. zWriter->schreibe( (char*)&entityId, 4 );
  17. }
  18. EntityRemovedUpdateType::EntityRemovedUpdateType()
  19. : WorldUpdateType( ID )
  20. {}