#ifndef YUNIMIN3_H
#define YUNIMIN3_H

#include "yuniminFunctions.h"
#include "loadConfig.h"

void setConnection();

bool initialization()
{
    setConnection();

    if(startClient() == false)
        return false;

    setPosition(config.getIntValue("defaultPosX"),config.getIntValue("defaultPosY"));
    setRotation(config.getIntValue("defaultRotZ"));
    setRGBColor(config.getIntValue("Rcolor"), config.getIntValue("Gcolor"), config.getIntValue("Bcolor"));

    return true;
}

void run();

void finish()
{
    endClient();
}

int main()
{
    std::cout << "YuniminClien - start\n" << std::endl;

    if( !initialization() )
    {
        std::cout << "Inicialization failed" << std::endl;
        return 0;
    }

    std::cout << "\n\tYunimin robot is running...\n" << std::endl
              << "=======================================" << std::endl;

    run();

    std::cout << "=======================================" << std::endl
              << "\n\tProgram finished..." << std::endl;

    finish();
    return 0;
}

#endif // YUNIMIN3_H
