OpenEnroth 4aaa0a0
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, Mastery mastery)
 
uint16_t joined () const
 
int level () const
 
Mastery mastery () const
 
 operator bool () const
 

Static Public Member Functions

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

Private Attributes

int _level = 0
 
Mastery _mastery = 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,
Mastery  mastery 
)

Member Function Documentation

◆ fromJoined()

CombinedSkillValue CombinedSkillValue::fromJoined ( uint16_t  joinedValue)
static

◆ fromJoinedUnchecked()

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

◆ increaseLevel()

CombinedSkillValue CombinedSkillValue::increaseLevel ( CombinedSkillValue  current)
static

◆ increaseMastery()

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

◆ isValid()

bool CombinedSkillValue::isValid ( int  level,
Mastery  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()

Mastery 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

Mastery CombinedSkillValue::_mastery = MASTERY_NONE
private

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