<commit_before>#ifndef Ancona_Engine_Loading_SFMLSerializer_H_
#define Ancona_Engine_Loading_SFMLSerializer_H_

#include <SFML/System.hpp>

#include <Ancona/Engine/Loading/Archive.hpp>
#include <Ancona/Engine/Loading/Serializer.hpp>
#include <Ancona/Engine/Loading/StdSerializer.hpp>
#include <Ancona/Engine/Resource/ResourceLibrary.hpp>

namespace ild
{

template <>
struct Serializer<sf::Vector2f>
{
    static void Serialize(sf::Vector2f & property, Archive & arc)
    {
        arc(property.x, "x");
        arc(property.y, "y");
    }
};

template <>
struct Serializer<sf::Vector3f>
{
    static void Serialize(sf::Vector3f & property, Archive & arc)
    {
        arc(property.x, "x");
        arc(property.y, "y");
        arc(property.z, "z");
    }
};

template <>
struct Serializer<sf::Text>
{
    static void Serialize(sf::Text & property, Archive & arc)
    {
        if (arc.IsLoading())
        {
            std::string text;
            std::string fontKey;
            sf::Color color;
            int characterSize;
            bool smooth;
            arc(text, "text");
            arc(fontKey, "font-key");
            arc(color, "color");
            arc(characterSize,"character-size");
            arc(smooth, "smooth");

            property.setString(text);
            property.setFont(*ResourceLibrary::Get<sf::Font>(fontKey));
            property.setColor(color);
            if (!smooth)
            {
                const_cast<sf::Texture&>(property.getFont()->getTexture(characterSize)).setSmooth(false);
            }
        }
        else
        {

            //TODO ANC-80 Implement saving
        }
    }
};

template <>
struct Serializer<sf::Color>
{
    static void Serialize(sf::Color & property, Archive & arc)
    {
        arc(property.r,"r");
        arc(property.g,"g");
        arc(property.b,"b");
        arc(property.a,"a");
    }
};

template <>
struct Serializer<sf::Shape>
{
    static void Serialize(sf::Shape & shape, Archive & arc)
    {
        //no-op<commit_msg>Add assert when attempting to serialize sf::Shape<commit_after>#ifndef Ancona_Engine_Loading_SFMLSerializer_H_
#define Ancona_Engine_Loading_SFMLSerializer_H_

#include <SFML/System.hpp>

#include <Ancona/Engine/Loading/Archive.hpp>
#include <Ancona/Engine/Loading/Serializer.hpp>
#include <Ancona/Engine/Loading/StdSerializer.hpp>
#include <Ancona/Engine/Resource/ResourceLibrary.hpp>

namespace ild
{

template <>
struct Serializer<sf::Vector2f>
{
    static void Serialize(sf::Vector2f & property, Archive & arc)
    {
        arc(property.x, "x");
        arc(property.y, "y");
    }
};

template <>
struct Serializer<sf::Vector3f>
{
    static void Serialize(sf::Vector3f & property, Archive & arc)
    {
        arc(property.x, "x");
        arc(property.y, "y");
        arc(property.z, "z");
    }
};

template <>
struct Serializer<sf::Text>
{
    static void Serialize(sf::Text & property, Archive & arc)
    {
        if (arc.IsLoading())
        {
            std::string text;
            std::string fontKey;
            sf::Color color;
            int characterSize;
            bool smooth;
            arc(text, "text");
            arc(fontKey, "font-key");
            arc(color, "color");
            arc(characterSize,"character-size");
            arc(smooth, "smooth");

            property.setString(text);
            property.setFont(*ResourceLibrary::Get<sf::Font>(fontKey));
            property.setColor(color);
            if (!smooth)
            {
                const_cast<sf::Texture&>(property.getFont()->getTexture(characterSize)).setSmooth(false);
            }
        }
        else
        {

            //TODO ANC-80 Implement saving
        }
    }
};

template <>
struct Serializer<sf::Color>
{
    static void Serialize(sf::Color & property, Archive & arc)
    {
        arc(property.r,"r");
        arc(property.g,"g");
        arc(property.b,"b");
        arc(property.a,"a");
    }
};

template <>
struct Serializer<sf::Shape>
{
    static void Serialize(sf::Shape & shape, Archive & arc)
    {
        Assert(false, "Cannot serialize sf::Shape");
{'fraction_non_alphanumeric': 0.14292647415675808, 'fraction_numerical': 0.002911914583838874, 'mean_word_length': 2.398186314921682, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2969241', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1269, 'n_words': 225}