#include "DrawingContext.h"

#include "INativeDrawingContext.h"
#include "AbstractGeometricItem.h"

std::unique_ptr<DrawingContext> DrawingContext::Create()
{
    return std::make_unique<DrawingContext>();
}

void DrawingContext::SetNativeContext(std::unique_ptr<INativeDrawingContext> context)
{
    mNativeDrawingContext = std::move(context);
}

INativeDrawingContext* DrawingContext::GetNativeContext()
{
    return mNativeDrawingContext.get();
}

void DrawingContext::AddDrawable(AbstractGeometricItemPtr item)
{
    mItems.push_back(std::move(item));
}

unsigned DrawingContext::GetNumItems() const
{
    return mItems.size();
}

AbstractGeometricItem* DrawingContext::GetDrawable(unsigned idx) const
{
    return mItems[idx].get();
}
