libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The ISgfcBoardSizeProperty interface is a specialization of ISgfcProperty for SgfcPropertyType::SZ. It simplifies access to the property value and provides the value in the form of an SgfcBoardSize object. More...
#include <ISgfcBoardSizeProperty.h>
Public Member Functions | |
ISgfcBoardSizeProperty () | |
Initializes a newly constructed ISgfcBoardSizeProperty object. | |
virtual | ~ISgfcBoardSizeProperty () |
Destroys and cleans up the ISgfcBoardSizeProperty object. | |
virtual SgfcBoardSize | GetBoardSize (SgfcGameType gameType) const =0 |
Returns the property value interpreted as an SgfcBoardSize value. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcProperty | |
ISgfcProperty () | |
Initializes a newly constructed ISgfcProperty object. | |
virtual | ~ISgfcProperty () |
Destroys and cleans up the ISgfcProperty object. | |
virtual SgfcPropertyType | GetPropertyType () const =0 |
Returns the type of the property. Returns SgfcPropertyType::Unknown if the property is a custom property that is not defined in the SGF standard. | |
virtual std::string | GetPropertyName () const =0 |
Returns the name of the property. | |
virtual SgfcPropertyCategory | GetPropertyCategory () const =0 |
Returns the category that the property is classified as. Returns SgfcPropertyCategory::Miscellaneous if the property is a custom property that is not defined in the SGF standard. | |
virtual SgfcPropertyTraits | GetTraits () const =0 |
Returns the property's traits. | |
virtual bool | HasTrait (SgfcPropertyTrait trait) const =0 |
Returns true if the property has the trait trait. Returns false if the property does not have the trait trait. | |
virtual bool | HasPropertyValues () const =0 |
Returns true if the property has one or more values. Returns false if the property has no values. | |
virtual std::vector< std::shared_ptr< ISgfcPropertyValue > > | GetPropertyValues () const =0 |
Returns a collection with the values of the property. The collection is empty if the property has no values. The order in which values appear in the collection matches the order in which values were specified when the ISgfcProperty was constructed. | |
virtual void | SetPropertyValues (const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues)=0 |
Sets the values of the property to propertyValues. The previous values are discarded. propertyValues may not contain nullptr. propertyValues may not contain duplicates. | |
virtual void | AppendPropertyValue (std::shared_ptr< ISgfcPropertyValue > propertyValue)=0 |
Adds propertyValue as the last value to the property's collection of values. propertyValue may not be nullptr. | |
virtual void | RemovePropertyValue (std::shared_ptr< ISgfcPropertyValue > propertyValue)=0 |
Removes propertyValue from the property's collection of values. | |
virtual void | RemoveAllPropertyValues ()=0 |
Removes all values from the property's collection of values. | |
virtual std::shared_ptr< ISgfcPropertyValue > | GetPropertyValue () const =0 |
Returns the property's first value if the property has any values. Returns nullptr if the property has no values. | |
virtual const ISgfcGameTypeProperty * | ToGameTypeProperty () const =0 |
Returns an ISgfcGameTypeProperty object if GetPropertyType() returns SgfcPropertyType::GM. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual const ISgfcBoardSizeProperty * | ToBoardSizeProperty () const =0 |
Returns an ISgfcBoardSizeProperty object if GetPropertyType() returns SgfcPropertyType::SZ. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
The ISgfcBoardSizeProperty interface is a specialization of ISgfcProperty for SgfcPropertyType::SZ. It simplifies access to the property value and provides the value in the form of an SgfcBoardSize object.
|
pure virtual |
Returns the property value interpreted as an SgfcBoardSize value.
SgfcBoardSize | If the property has a valid value. The value is guaranteed not to be SgfcConstants::BoardSizeNone nor SgfcConstants::BoardSizeInvalid. |
SgfcConstants::BoardSizeDefaultGo | If the property has no value, and gameType is SgfcGameType::Go. |
SgfcConstants::BoardSizeDefaultChess | If the property has no value, and gameType is SgfcGameType::Chess. |
SgfcConstants::BoardSizeNone | If the property has no value, but gameType is neither SgfcGameType::Go nor SgfcGameType::Chess. |
SgfcConstants::BoardSizeInvalid | If the property value(s) cannot be converted to an SgfcBoardSize value (the property has more than one value, or it has a single value that is neither a Number nor a composed value consisting of two Number values), or if conversion is possible but the SgfcBoardSize value violates the constraints defined by the SGF standard. See the documentation of SgfcConstants::BoardSizeInvalid for details. |
Implemented in LibSgfcPlusPlus::SgfcBoardSizeProperty.