AddEntityUpdate.cpp 435 B

123456789101112131415161718
  1. #include "AddEntityUpdate.h"
  2. #include "StaticRegistry.h"
  3. #include "Registries.h"
  4. #include "Globals.h"
  5. #include "Entity.h"
  6. AddEntityUpdateType::AddEntityUpdateType()
  7. : WorldUpdateType(ID)
  8. {}
  9. void AddEntityUpdateType::applyUpdate(Framework::StreamReader* zReader)
  10. {
  11. int type;
  12. zReader->lese((char*)&type, 4);
  13. Entity* entity = entityTypes[type]->loadEntity(zReader);
  14. currentGame->zDimension()->addEntity(entity);
  15. }