Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HairDB Class Reference

Hair information database. More...

#include <hairdb.h>

Public Member Functions

 HairDB ()=default
 
 ~HairDB ()
 
void init ()
 
void readHairColorNode (XML::Node node, const std::string &filename)
 
void checkStatus ()
 
void unload ()
 Clear the color data.
 
const std::string & getHairColor (int id) const
 
std::vector< int > getHairStyleIds (int maxId) const
 Returns the available hair style ids.
 
std::vector< int > getHairColorIds (int minId, int maxId) const
 Returns the available hair color ids.
 
void addHairStyle (int id)
 Add a hair style to the database.
 

Private Member Functions

void loadHairColorsNode (XML::Node colorsNode)
 Load the hair colors, contained in a <colors> node.
 
void loadHairStylesNode (XML::Node stylesNode)
 Load the hair styles, contained in a <styles> node.
 

Private Attributes

std::map< int, std::string > mHairColors
 
std::set< int > mHairStyles
 
bool mLoaded = false
 

Detailed Description

Hair information database.

Definition at line 33 of file hairdb.h.

Constructor & Destructor Documentation

◆ HairDB()

HairDB::HairDB ( )
default

◆ ~HairDB()

HairDB::~HairDB ( )
inline

Definition at line 38 of file hairdb.h.

Member Function Documentation

◆ addHairStyle()

void HairDB::addHairStyle ( int  id)

Add a hair style to the database.

See also
ItemDB for the itemInfo.

Definition at line 66 of file hairdb.cpp.

◆ checkStatus()

void HairDB::checkStatus ( )

Definition at line 48 of file hairdb.cpp.

◆ getHairColor()

const std::string & HairDB::getHairColor ( int  id) const

Definition at line 79 of file hairdb.cpp.

◆ getHairColorIds()

std::vector< int > HairDB::getHairColorIds ( int  minId,
int  maxId 
) const

Returns the available hair color ids.

Parameters
maxIdthe max permited id. If not 0, the hairDb won't return ids > to the parameter.

Definition at line 107 of file hairdb.cpp.

◆ getHairStyleIds()

std::vector< int > HairDB::getHairStyleIds ( int  maxId) const

Returns the available hair style ids.

Parameters
maxIdthe max permited id. If not 0, the hairDb won't return ids > to the parameter.

Definition at line 94 of file hairdb.cpp.

◆ init()

void HairDB::init ( )

Definition at line 29 of file hairdb.cpp.

◆ loadHairColorsNode()

void HairDB::loadHairColorsNode ( XML::Node  colorsNode)
private

Load the hair colors, contained in a <colors> node.

◆ loadHairStylesNode()

void HairDB::loadHairStylesNode ( XML::Node  stylesNode)
private

Load the hair styles, contained in a <styles> node.

Used only by Manaserv. TMW-Athena is considering hairstyles as items.

See also
ItemDB

◆ readHairColorNode()

void HairDB::readHairColorNode ( XML::Node  node,
const std::string &  filename 
)

Definition at line 38 of file hairdb.cpp.

◆ unload()

void HairDB::unload ( )

Clear the color data.

Definition at line 53 of file hairdb.cpp.

Member Data Documentation

◆ mHairColors

std::map<int, std::string> HairDB::mHairColors
private

Definition at line 88 of file hairdb.h.

◆ mHairStyles

std::set<int> HairDB::mHairStyles
private

Definition at line 89 of file hairdb.h.

◆ mLoaded

bool HairDB::mLoaded = false
private

Definition at line 91 of file hairdb.h.


The documentation for this class was generated from the following files: