Tag which has to be manually added to mods.
More...
#include <manualtag.h>
|
| ManualTag (std::string name) |
| Constructs a new tag with the given name.
|
|
| ManualTag (const Json::Value &json) |
| Deserializes a ManualTag from the given json object.
|
|
void | addMod (int mod_id) |
| Adds this tag to the given mod.
|
|
void | removeMod (int mod_id) |
| Removes this tag from the given mod.
|
|
void | setMods (const std::vector< int > mods) |
| Removes this tag from all mods and adds it only to the given mods.
|
|
Json::Value | toJson () const |
| Serializes this tag to a json object.
|
|
bool | operator== (const std::string &name) const |
| Compares this tag by name to the given name.
|
|
bool | operator== (const ManualTag &other) const |
| Compares this tag by name to the given tag.
|
|
std::string | getName () const |
| Getter for the tags name.
|
|
void | setName (const std::string &name) |
| Setter for the tags name.
|
|
std::vector< int > | getMods () const |
| Returns all mods to which this tag has been added.
|
|
int | getNumMods () const |
| Returns the number of mods to which this tag has been added.
|
|
bool | hasMod (int mod_id) const |
| Checks if this tag has been added to the given mod.
|
|
|
std::string | name_ |
| Name of this tag.
|
|
std::vector< int > | mods_ {} |
| Contains ids of all mods to which this tag has been added.
|
|
Tag which has to be manually added to mods.
◆ ManualTag() [1/2]
ManualTag::ManualTag |
( |
std::string | name | ) |
|
Constructs a new tag with the given name.
- Parameters
-
◆ ManualTag() [2/2]
ManualTag::ManualTag |
( |
const Json::Value & | json | ) |
|
Deserializes a ManualTag from the given json object.
- Parameters
-
json | Source json object. |
json_path | Path to the json object. Used is exception messaged. |
- Exceptions
-
◆ addMod()
void ManualTag::addMod |
( |
int | mod_id | ) |
|
Adds this tag to the given mod.
- Parameters
-
mod_id | Id if the mod to which this tag is to be added. |
◆ operator==() [1/2]
bool ManualTag::operator== |
( |
const ManualTag & | other | ) |
const |
Compares this tag by name to the given tag.
- Parameters
-
- Returns
- True if the names are identical.
◆ operator==() [2/2]
bool ManualTag::operator== |
( |
const std::string & | name | ) |
const |
Compares this tag by name to the given name.
- Parameters
-
- Returns
- True if the names are identical.
◆ removeMod()
void ManualTag::removeMod |
( |
int | mod_id | ) |
|
Removes this tag from the given mod.
- Parameters
-
mod_id | Id if the mod from which this tag is to be removed. |
◆ setMods()
void ManualTag::setMods |
( |
const std::vector< int > | mods | ) |
|
Removes this tag from all mods and adds it only to the given mods.
- Parameters
-
mods | Mods to which this tag is to be added. |
◆ toJson()
Json::Value ManualTag::toJson |
( |
| ) |
const |
|
virtual |
Serializes this tag to a json object.
- Returns
- The json object.
Implements Tag.
The documentation for this class was generated from the following files: