libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LibSgfcPlusPlus::SgfcGoPlayerRank Struct Reference

The SgfcGoPlayerRank struct is a simple type that can hold the decomposed values of an SgfcPropertyType::BR or SgfcPropertyType::WR property value. More...

#include <SgfcGoPlayerRank.h>

Public Member Functions

bool operator== (const SgfcGoPlayerRank &other) const
 Returns true if the properties Rank, RankType, RatingType and IsValid are the same for the current SgfcGoPlayerRank object and for other. Returns false if any of these properties are different.
 
bool operator!= (const SgfcGoPlayerRank &other) const
 Returns true if any of the properties Rank, RankType, RatingType or IsValid are different for the current SgfcGoPlayerRank object and for other. Returns false if all properties are the same.
 

Static Public Member Functions

static SgfcGoPlayerRank FromPropertyValue (const SgfcSimpleText &propertyValue)
 Decomposes the content of propertyValue into distinct rank, rank type and rating type values.
 
static SgfcSimpleText ToPropertyValue (SgfcGoPlayerRank goPlayerRank)
 Composes a property value for SgfcPropertyType::BR or SgfcPropertyType::WR from the rank, rank type and rating type values in goPlayerRank.
 

Public Attributes

SgfcNumber Rank = 30
 The rank. The default is 30.
 
SgfcGoPlayerRankType RankType = SgfcGoPlayerRankType::Kyu
 The rank type. The default is SgfcGoPlayerRankType::Kyu.
 
SgfcGoPlayerRatingType RatingType = SgfcGoPlayerRatingType::Unspecified
 The optional rating type that applies to the rank (e.g. the rank is established). The default is SgfcGoPlayerRatingType::Unspecified.
 
bool IsValid = false
 True if the SgfcGoPlayerRank object holds a valid Go player rank. False if the SgfcGoPlayerRank object holds an invalid Go player rank. The default is false.
 

Detailed Description

The SgfcGoPlayerRank struct is a simple type that can hold the decomposed values of an SgfcPropertyType::BR or SgfcPropertyType::WR property value.

Member Function Documentation

◆ FromPropertyValue()

SgfcGoPlayerRank LibSgfcPlusPlus::SgfcGoPlayerRank::FromPropertyValue ( const SgfcSimpleText & propertyValue)
static

Decomposes the content of propertyValue into distinct rank, rank type and rating type values.

See the SGF standard specification for the recommended structure of an SgfcPropertyType::BR or SgfcPropertyType::WR property value.

In addition to what the SGF standard recommends, this also recognizes the notation "1p", "2p", etc. to express professional Dan ranks.

Returns
SgfcGoPlayerRank An object with the decomposed rank, rank type and rating type values. The object's SgfcGoPlayerRank::IsValid member is true if decomposition was successful, otherwise it is false.

◆ ToPropertyValue()

SgfcSimpleText LibSgfcPlusPlus::SgfcGoPlayerRank::ToPropertyValue ( SgfcGoPlayerRank goPlayerRank)
static

Composes a property value for SgfcPropertyType::BR or SgfcPropertyType::WR from the rank, rank type and rating type values in goPlayerRank.

See the SGF standard specification for the recommended structure of an SgfcPropertyType::BR or SgfcPropertyType::WR property value.

In addition to what the SGF standard recommends, this also produces the notation "1p", "2p", etc. to express professional Dan ranks.

Returns
SgfcSimpleText A property value for SgfcPropertyType::BR or SgfcPropertyType::WR that conforms to the SGF standard's recommended formatting, or SgfcConstants::NoneValueString if the SgfcGoPlayerRank::IsValid member of goPlayerRank is false.

Member Data Documentation

◆ IsValid

bool LibSgfcPlusPlus::SgfcGoPlayerRank::IsValid = false

True if the SgfcGoPlayerRank object holds a valid Go player rank. False if the SgfcGoPlayerRank object holds an invalid Go player rank. The default is false.

This is mainly used to indicate whether SgfcGoPlayerRank::FromPropertyValue() was successful in decomposing the SgfcPropertyType::BR or SgfcPropertyType::WR property value. A library client that manually creates an SgfcGoPlayerRank object can simply set this to true to assert a valid Go player rank.


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