#include "AddEntityUpdate.h"

#include "Entity.h"
#include "Globals.h"
#include "Registries.h"
#include "StaticRegistry.h"

AddEntityUpdateType::AddEntityUpdateType()
    : WorldUpdateType(ID)
{}

void AddEntityUpdateType::applyUpdate(Framework::StreamReader* zReader)
{
    int type;
    zReader->lese((char*)&type, 4);
    Entity* entity = entityTypes[type]->loadEntity(zReader);
    World::INSTANCE->zDimension()->addEntity(entity);
}