#include "Geode.h"

Geode::Drawable::Drawable()
: _material(0), _resourceHandle(0)
{
}

Geode::Drawable::~Drawable()
{
}

void* Geode::Drawable::getResourceHandle()
{
    return _resourceHandle;
}

void  Geode::Drawable::setResourceHandle(void* resourceHandle)
{
    _resourceHandle = resourceHandle;
}


Material** Geode::Drawable::ppGetMaterial()
{
    return &_material;
}

Material* Geode::Drawable::getMaterial()
{
    return _material;
}

void Geode::Drawable::setMaterial(Material* material)
{
    _material = material;
}



Geode::Geode(const wchar_t* fileName)
: Transform(), _fileName(fileName)
{
}

Geode::~Geode()
{
    for (size_t i = 0; i < _drawables.size(); ++i) {
        delete _drawables[i];
    }

    _drawables.clear();
}

const wchar_t* Geode::getFileName()
{
    if (_fileName.empty())
        return 0;
    else
        return _fileName.c_str();
}

void Geode::setFileName(const wchar_t* fileName)
{
    _fileName = fileName;
}


void Geode::addDrawable(Drawable* drawable)
{
    _drawables.push_back(drawable);
}

size_t Geode::getNumDrawables()
{
    return _drawables.size();
}

Geode::Drawable** Geode::getDrawables()
{
    return &_drawables[0];
}