Limo
A simple mod manager
Loading...
Searching...
No Matches
ManualTag Class Reference

Tag which has to be manually added to mods. More...

#include <manualtag.h>

Inheritance diagram for ManualTag:
Collaboration diagram for ManualTag:

Public Member Functions

 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.
 
- Public Member Functions inherited from 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.
 

Additional Inherited Members

- Protected Attributes inherited from Tag
std::string name_
 Name of this tag.
 
std::vector< int > mods_ {}
 Contains ids of all mods to which this tag has been added.
 

Detailed Description

Tag which has to be manually added to mods.

Constructor & Destructor Documentation

◆ ManualTag() [1/2]

ManualTag::ManualTag ( std::string name)

Constructs a new tag with the given name.

Parameters
nameThe tags name.

◆ ManualTag() [2/2]

ManualTag::ManualTag ( const Json::Value & json)

Deserializes a ManualTag from the given json object.

Parameters
jsonSource json object.
json_pathPath to the json object. Used is exception messaged.
Exceptions
ParseErrorwhen the json object is invalid.

Member Function Documentation

◆ addMod()

void ManualTag::addMod ( int mod_id)

Adds this tag to the given mod.

Parameters
mod_idId 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
otherTag to compare to.
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
nameName to compare to.
Returns
True if the names are identical.

◆ removeMod()

void ManualTag::removeMod ( int mod_id)

Removes this tag from the given mod.

Parameters
mod_idId 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
modsMods 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: