Skip to content

Commit

Permalink
feat: add content property to Template struct and update constructors…
Browse files Browse the repository at this point in the history
… and assignment operator
  • Loading branch information
MasterLaplace committed Nov 22, 2024
1 parent d23dc05 commit 44b3410
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,26 @@
#ifndef FLAKKARI_TEMPLATE_HPP_
#define FLAKKARI_TEMPLATE_HPP_

#include <nlohmann/json.hpp>
#include <string>

namespace Flakkari::Engine::ECS::Components::Common {

struct Template {
std::string name;
nlohmann::json content;

Template() : name("") {}
Template(const std::string &nname) : name(nname) {}
Template(const Template &other) : name(other.name) {}
Template() : name(""), content(nlohmann::json::object()) {}
Template(const std::string &name, const nlohmann::json &content) : name(name), content(content) {}
Template(const Template &other) : name(other.name), content(other.content) {}

Template &operator=(const Template &other)
{
if (this != &other)
{
name = other.name;
content = other.content;
}

return *this;
}
Expand Down

0 comments on commit 44b3410

Please sign in to comment.