libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcGameResult struct is a simple type that can hold the decomposed values of an SgfcPropertyType::RE property value. More...
#include <SgfcGameResult.h>
Public Member Functions | |
bool | operator== (const SgfcGameResult &other) const |
Returns true if the properties GameResultType, WinType, Score and IsValid are the same for the current SgfcGameResult object and for other. Returns false if any of these properties are different. | |
bool | operator!= (const SgfcGameResult &other) const |
Returns true if any of the properties GameResultType, WinType, Score or IsValid are different for the current SgfcGameResult object and for other. Returns false if all properties are the same. | |
Static Public Member Functions | |
static SgfcGameResult | FromPropertyValue (const SgfcSimpleText &propertyValue) |
Decomposes the content of propertyValue into distinct game result type, win type and score values. | |
static SgfcSimpleText | ToPropertyValue (SgfcGameResult gameResult) |
Composes a property value for SgfcPropertyType::RE from the game result type, win type and score values in gameResult. | |
Public Attributes | |
SgfcGameResultType | GameResultType = SgfcGameResultType::UnknownResult |
The result type. The default is SgfcGameResultType::UnknownResult. | |
SgfcWinType | WinType = SgfcWinType::WinWithScore |
The win type. The default is SgfcWinType::WinWithScore. | |
SgfcReal | Score = 0.0 |
The score. The default is 0.0. | |
bool | IsValid = false |
True if the SgfcGameResult object holds a valid game result. False if the SgfcGameResult object holds an invalid game result. The default is false. | |
The SgfcGameResult struct is a simple type that can hold the decomposed values of an SgfcPropertyType::RE property value.
|
static |
Decomposes the content of propertyValue into distinct game result type, win type and score values.
See the SGF standard specification for the mandatory structure of an SgfcPropertyType::RE property value.
|
static |
Composes a property value for SgfcPropertyType::RE from the game result type, win type and score values in gameResult.
See the SGF standard specification for the mandatory structure of an SgfcPropertyType::RE property value.
bool LibSgfcPlusPlus::SgfcGameResult::IsValid = false |
True if the SgfcGameResult object holds a valid game result. False if the SgfcGameResult object holds an invalid game result. The default is false.
This is mainly used to indicate whether SgfcGameResult::FromPropertyValue() was successful in decomposing the SgfcPropertyType::RE property value. A library client that manually creates an SgfcGameResult object can simply set this to true to assert a valid game result.
SgfcReal LibSgfcPlusPlus::SgfcGameResult::Score = 0.0 |
The score. The default is 0.0.
The score only has meaning if SgfcGameResult::GameResultType is either SgfcGameResultType::BlackWin or SgfcGameResultType::WhiteWin and if SgfcGameResult::WinType is SgfcWinType::WinWithScore.
SgfcWinType LibSgfcPlusPlus::SgfcGameResult::WinType = SgfcWinType::WinWithScore |
The win type. The default is SgfcWinType::WinWithScore.
The win type only has meaning if SgfcGameResult::GameResultType is either SgfcGameResultType::BlackWin or SgfcGameResultType::WhiteWin.