#include "BasicMaterial.h"

#include "MaterialNode.h"

BasicMaterial::BasicMaterial()
    : mFillColor(Color(255, 255, 255)),
        mStrokeColor(Color(0, 0, 0))
{

}

BasicMaterial::~BasicMaterial()
{

}

const Color& BasicMaterial::getFillColor() const
{
    return mFillColor;
}

const Color& BasicMaterial::getStrokeColor() const
{
    return mStrokeColor;
}

double BasicMaterial::getStrokeThickness() const
{
    return mStrokeThickness;
}

bool BasicMaterial::hasFillColor() const
{
    return mHasFillColor;
}

bool BasicMaterial::hasStrokeColor() const
{
    return mHasStrokeColor;
}

bool BasicMaterial::setHasStrokeColor(bool hasStroke)
{
    const auto updated = mHasStrokeColor != hasStroke;
    mHasStrokeColor = hasStroke;
    return updated;
}

bool BasicMaterial::setHasFillColor(bool hasFill)
{
    const auto updated = mHasFillColor != hasFill;
    mHasFillColor = hasFill;
    return updated;
}

bool BasicMaterial::setFillColor(const Color& color)
{
    mHasFillColor = true;

    const auto updated = mFillColor != color;
    mFillColor = color;
    return updated;
}

bool BasicMaterial::setStrokeColor(const Color& color)
{
    mHasStrokeColor = true;
    const auto updated = mStrokeColor != color;
    mStrokeColor = color;
    return updated;
}

bool BasicMaterial::setStrokeThickness(double thickness)
{
    const auto updated = mStrokeThickness != thickness;
    mStrokeThickness = thickness;
    return updated;
}
