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::SgfcGoRuleset Struct Reference

The SgfcGoRuleset struct is a simple type that can hold the decomposed values of an SgfcPropertyType::RU property value. More...

#include <SgfcGoRuleset.h>

Public Member Functions

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

Static Public Member Functions

static SgfcGoRuleset FromPropertyValue (const SgfcSimpleText &propertyValue)
 Decomposes the content of propertyValue into a distinct ruleset type value.
 
static SgfcSimpleText ToPropertyValue (SgfcGoRuleset goRuleset)
 Composes a property value for SgfcPropertyType::RU from the ruleset type value in goRuleset.
 

Public Attributes

SgfcGoRulesetType GoRulesetType = SgfcGoRulesetType::AGA
 The ruleset type. The default is SgfcGoRulesetType::AGA.
 
bool IsValid = false
 True if the SgfcGoRuleset object holds a valid Go ruleset. False if the SgfcGoRuleset object holds an invalid Go ruleset. The default is false.
 

Detailed Description

The SgfcGoRuleset struct is a simple type that can hold the decomposed values of an SgfcPropertyType::RU property value.

Member Function Documentation

◆ FromPropertyValue()

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

Decomposes the content of propertyValue into a distinct ruleset type value.

See the SGF standard specification for the recommended structure of an SgfcPropertyType::RU property value.

Returns
SgfcGoRuleset An object with the decomposed ruleset type value. The object's SgfcGoRuleset::IsValid member is true if decomposition was successful, otherwise it is false.

◆ ToPropertyValue()

SgfcSimpleText LibSgfcPlusPlus::SgfcGoRuleset::ToPropertyValue ( SgfcGoRuleset goRuleset)
static

Composes a property value for SgfcPropertyType::RU from the ruleset type value in goRuleset.

See the SGF standard specification for the recommended structure of an SgfcPropertyType::RU property value.

Returns
SgfcSimpleText A property value for SgfcPropertyType::RU that conforms to the SGF standard's mandatory formatting, or SgfcConstants::NoneValueString if the SgfcGoRuleset::IsValid member of goRuleset is false.

Member Data Documentation

◆ IsValid

bool LibSgfcPlusPlus::SgfcGoRuleset::IsValid = false

True if the SgfcGoRuleset object holds a valid Go ruleset. False if the SgfcGoRuleset object holds an invalid Go ruleset. The default is false.

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


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