2019-05-07 13:07:58 +02:00
|
|
|
//
|
|
|
|
// Created by trotfunky on 07/05/19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <pugixml.hpp>
|
|
|
|
#include "xmlParser.h"
|
|
|
|
|
|
|
|
namespace xmlParser
|
|
|
|
{
|
2019-05-16 13:07:29 +02:00
|
|
|
const std::string colorToStr(const sf::Color& color)
|
|
|
|
{
|
|
|
|
if(color == sf::Color::Black)
|
|
|
|
{
|
|
|
|
return("Black");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::White)
|
|
|
|
{
|
|
|
|
return("White");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Red)
|
|
|
|
{
|
|
|
|
return("Red");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Green)
|
|
|
|
{
|
|
|
|
return("Green");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Blue)
|
|
|
|
{
|
|
|
|
return("Blue");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Yellow)
|
|
|
|
{
|
|
|
|
return("Yellow");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Magenta)
|
|
|
|
{
|
|
|
|
return("Magenta");
|
|
|
|
}
|
|
|
|
else if(color == sf::Color::Cyan)
|
|
|
|
{
|
|
|
|
return("Cyan");
|
|
|
|
}
|
|
|
|
return("Transparent");
|
|
|
|
}
|
2019-05-07 13:07:58 +02:00
|
|
|
|
2019-05-16 13:07:29 +02:00
|
|
|
const sf::Color& strToColor(const std::string& stringColor)
|
|
|
|
{
|
|
|
|
if(stringColor == "Black")
|
|
|
|
{
|
|
|
|
return(sf::Color::Black);
|
|
|
|
}
|
|
|
|
else if(stringColor == "White")
|
|
|
|
{
|
|
|
|
return(sf::Color::White);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Red")
|
|
|
|
{
|
|
|
|
return(sf::Color::Red);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Green")
|
|
|
|
{
|
|
|
|
return(sf::Color::Green);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Blue")
|
|
|
|
{
|
|
|
|
return(sf::Color::Blue);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Yellow")
|
|
|
|
{
|
|
|
|
return(sf::Color::Yellow);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Magenta")
|
|
|
|
{
|
|
|
|
return(sf::Color::Magenta);
|
|
|
|
}
|
|
|
|
else if(stringColor == "Cyan")
|
|
|
|
{
|
|
|
|
return(sf::Color::Cyan);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return(sf::Color::Green);
|
|
|
|
}
|
|
|
|
}
|
2019-05-07 13:07:58 +02:00
|
|
|
}
|