#include <WorldView/WorldView.hpp>
#include <World/World.hpp>

WorldView::WorldView(World &world) : world(world)
{
    viewIndex = world.allocView();
}

WorldView::~WorldView()
{
    world.deallocView(viewIndex);
}

void WorldView::setRetainBox(const BoundingBox<cint32> &box, const std::function<void(Chunk&)> &onNewlyVisible)
{
    world.setRetainBox(viewIndex, box, onNewlyVisible);
}