<commit_before>#pragma once

#include <functional>
#include <map>
#include "Entity.h"
#include "World.h"

namespace ECSE
{

//! Holds prefabs, which allow entities to be constructed from predefined components and settings.
class PrefabManager
{
public:
    using Properties = std::map<std::string, std::string>;

    //! A function which applies prefab settings to an entity.
    /*!
    * This function receives a reference to a pre-created Entity which exists in the
    * given World and should add components and configure them. The function should
    * not register the Entity, as other prefabs may also be applied afterward.
    * Optionally, the prefab may make use of values in the props map.
    */
    using Prefab = std::function<void(World& world, ECSE::Entity& entity, Properties props)>;

    //! Add a prefab to the manager.
    /*!
    * \param name The name of the prefab.
    * \param prefab The function which applies prefab settings.
    */
    void addPrefab(std::string name, const Prefab& prefab);

    //! Create an entity from a prefab and register it with the world.
    /*!
    * \param name The prefab's name.<commit_msg>Change include to forward declare.<commit_after>#pragma once

#include <functional>
#include <map>
#include "Entity.h"

namespace ECSE
{

class World;

//! Holds prefabs, which allow entities to be constructed from predefined components and settings.
class PrefabManager
{
public:
    using Properties = std::map<std::string, std::string>;

    //! A function which applies prefab settings to an entity.
    /*!
    * This function receives a reference to a pre-created Entity which exists in the
    * given World and should add components and configure them. The function should
    * not register the Entity, as other prefabs may also be applied afterward.
    * Optionally, the prefab may make use of values in the props map.
    */
    using Prefab = std::function<void(World& world, ECSE::Entity& entity, Properties props)>;

    //! Add a prefab to the manager.
    /*!
    * \param name The name of the prefab.
    * \param prefab The function which applies prefab settings.
    */
    void addPrefab(std::string name, const Prefab& prefab);

    //! Create an entity from a prefab and register it with the world.
    /*!
    * \param name The prefab's name.
{'fraction_non_alphanumeric': 0.08808290155440414, 'fraction_numerical': 0.0, 'mean_word_length': 3.274907749077491, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7445256', 'n_tokens_mistral': 637, 'n_tokens_neox': 618, 'n_words': 287}