
#include "ItemType.h"

#include <InMemoryBuffer.h>

ItemType::ItemType(
    int id, ModelInfo model, Framework::Text name, Framework::Text tooltipUIML)
    : ReferenceCounter(),
      id(id),
      model(model),
      icon(0),
      name(name),
      tooltipUIML(tooltipUIML)
{}

ItemType::~ItemType()
{
    if (this->icon) this->icon->release();
}

int ItemType::getId() const
{
    return id;
}

void ItemType::setBild(Framework::Image* icon)
{
    if (this->icon) this->icon->release();
    this->icon = icon;
}

Framework::Image* ItemType::zIcon() const
{
    return icon;
}

Framework::Model3DData* ItemType::getItemModel() const
{
    return model.getModel();
}

Framework::Model3DTexture* ItemType::getItemTextur() const
{
    return model.getTexture();
}

const Framework::Text& ItemType::getName() const
{
    return name;
}

const Framework::Text& ItemType::getTooltipUIML() const
{
    return tooltipUIML;
}

float ItemType::getSize() const
{
    return model.getSize();
}
