Limo
A simple mod manager
Loading...
Searching...
No Matches
tag.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <json/json.h>
9#include <string>
10#include <vector>
11
12
16class Tag
17{
18public:
23 std::string getName() const;
28 void setName(const std::string& name);
33 std::vector<int> getMods() const;
38 int getNumMods() const;
44 bool hasMod(int mod_id) const;
50 virtual Json::Value toJson() const = 0;
51
52protected:
54 std::string name_;
56 std::vector<int> mods_{};
57};
Abstract base class for a tag assigned to a set of mods.
Definition tag.h:17
void setName(const std::string &name)
Setter for the tags name.
Definition tag.cpp:11
std::vector< int > mods_
Contains ids of all mods to which this tag has been added.
Definition tag.h:56
std::string getName() const
Getter for the tags name.
Definition tag.cpp:6
virtual Json::Value toJson() const =0
Serializes this tag to a json object. This function must be implemented by derived classes.
int getNumMods() const
Returns the number of mods to which this tag has been added.
Definition tag.cpp:21
std::vector< int > getMods() const
Returns all mods to which this tag has been added.
Definition tag.cpp:16
std::string name_
Name of this tag.
Definition tag.h:54
bool hasMod(int mod_id) const
Checks if this tag has been added to the given mod.
Definition tag.cpp:26