OpenEnroth 631fe01
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
CombinedSkillValue Class Reference

#include <CombinedSkillValue.h>

Public Member Functions

 CombinedSkillValue ()
 
 CombinedSkillValue (int level, CharacterSkillMastery mastery)
 
uint16_t joined () const
 
int level () const
 
CharacterSkillMastery mastery () const
 
 operator bool () const
 

Static Public Member Functions

static bool isValid (int level, CharacterSkillMastery mastery)
 
static CombinedSkillValue none ()
 
static CombinedSkillValue novice (int level=1)
 
static CombinedSkillValue increaseLevel (CombinedSkillValue current)
 
static CombinedSkillValue increaseMastery (CombinedSkillValue current, CharacterSkillMastery newMastery)
 
static CombinedSkillValue fromJoined (uint16_t joinedValue)
 
static std::pair< int, CharacterSkillMasteryfromJoinedUnchecked (uint16_t joinedValue)
 

Private Attributes

int _level = 0
 
CharacterSkillMastery _mastery = CHARACTER_SKILL_MASTERY_NONE
 

Friends

bool operator== (const CombinedSkillValue &l, const CombinedSkillValue &r)=default
 

Detailed Description

Simple POD-like class for storing full skill value (level and mastery).

Constructor & Destructor Documentation

◆ CombinedSkillValue() [1/2]

CombinedSkillValue::CombinedSkillValue ( )

◆ CombinedSkillValue() [2/2]

CombinedSkillValue::CombinedSkillValue ( int  level,
CharacterSkillMastery  mastery 
)

Member Function Documentation

◆ fromJoined()

CombinedSkillValue CombinedSkillValue::fromJoined ( uint16_t  joinedValue)
static

◆ fromJoinedUnchecked()

std::pair< int, CharacterSkillMastery > CombinedSkillValue::fromJoinedUnchecked ( uint16_t  joinedValue)
static

◆ increaseLevel()

CombinedSkillValue CombinedSkillValue::increaseLevel ( CombinedSkillValue  current)
static

◆ increaseMastery()

CombinedSkillValue CombinedSkillValue::increaseMastery ( CombinedSkillValue  current,
CharacterSkillMastery  newMastery 
)
static

◆ isValid()

bool CombinedSkillValue::isValid ( int  level,
CharacterSkillMastery  mastery 
)
static
Parameters
levelSkill level to check.
masterySkill mastery to check.
Returns
Whether the provided skill-mastery pair is valid. Note that CombinedSkillValue constructor asserts on invalid skill-mastery pairs.

◆ joined()

uint16_t CombinedSkillValue::joined ( ) const
Returns
Binary representation of a skill-mastery pair, as it was originally stored in M&M data structures.

◆ level()

int CombinedSkillValue::level ( ) const

◆ mastery()

CharacterSkillMastery CombinedSkillValue::mastery ( ) const

◆ none()

CombinedSkillValue CombinedSkillValue::none ( )
static

◆ novice()

CombinedSkillValue CombinedSkillValue::novice ( int  level = 1)
static

◆ operator bool()

CombinedSkillValue::operator bool ( ) const
inlineexplicit

Friends And Related Function Documentation

◆ operator==

bool operator== ( const CombinedSkillValue l,
const CombinedSkillValue r 
)
friend

Member Data Documentation

◆ _level

int CombinedSkillValue::_level = 0
private

◆ _mastery

CharacterSkillMastery CombinedSkillValue::_mastery = CHARACTER_SKILL_MASTERY_NONE
private

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