#include "WimaCorridor.h"

const char* WimaCorridor::WimaCorridorName = "Corridor";



WimaCorridor::WimaCorridor(QObject *parent)
    : WimaArea (parent)
{
    init();
}

WimaCorridor::WimaCorridor(const WimaCorridor &other, QObject *parent)
    : WimaArea (other, parent)
{
    init();
}

/*!
 * \overload operator=()
 *
 * Calls the inherited operator WimaArea::operator=().
 */
WimaCorridor &WimaCorridor::operator=(const WimaCorridor &other)
{
    WimaArea::operator=(other);

    return *this;
}

void WimaCorridor::saveToJson(QJsonObject &json)
{
    this->WimaArea::saveToJson(json);
    json[areaTypeName] = WimaCorridorName;
}

bool WimaCorridor::loadFromJson(const QJsonObject &json, QString &errorString)
{
    if ( this->WimaArea::loadFromJson(json, errorString)) {
        bool retVal = true;
        // code for loading here
        return retVal;
    } else {
        qWarning() << errorString;
        return false;
    }
}

void WimaCorridor::init()
{
    this->setObjectName(WimaCorridorName);
}

void print(const WimaCorridor &area)
{
    QString message;
    print(area, message);
    qWarning() << message;
}

void print(const WimaCorridor &area, QString &outputString)
{
    print(static_cast<const WimaArea&>(area), outputString);
}


/*!
  \class WimaCorridor
  \brief Corridor (derived from \c WimaArea) connecting the \c WimaMeasurementArea and the \c WimaServiceArea.
*/
