libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcBoardSizeProperty class provides an implementation of the ISgfcBoardSizeProperty interface. See the interface header file for documentation. More...
#include <SgfcBoardSizeProperty.h>
Public Member Functions | |
SgfcBoardSizeProperty () | |
Initializes a newly constructed SgfcBoardSizeProperty object. The property has no value. | |
SgfcBoardSizeProperty (std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) | |
Initializes a newly constructed SgfcBoardSizeProperty object. The property has the specified property value propertyValue. | |
SgfcBoardSizeProperty (std::shared_ptr< ISgfcComposedPropertyValue > propertyValue) | |
Initializes a newly constructed SgfcBoardSizeProperty object. The property has the specified property value propertyValue. | |
virtual | ~SgfcBoardSizeProperty () |
Destroys and cleans up the SgfcBoardSizeProperty object. | |
virtual const ISgfcBoardSizeProperty * | ToBoardSizeProperty () const override |
Returns an ISgfcBoardSizeProperty object if GetPropertyType() returns SgfcPropertyType::SZ. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
virtual SgfcBoardSize | GetBoardSize (SgfcGameType gameType) const override |
Returns the property value interpreted as an SgfcBoardSize value. | |
Public Member Functions inherited from LibSgfcPlusPlus::SgfcProperty | |
SgfcProperty (SgfcPropertyType propertyType, const std::string &propertyName) | |
Initializes a newly constructed SgfcProperty object. The property has the specified type propertyType and name propertyName. The property has no values. | |
SgfcProperty (SgfcPropertyType propertyType, const std::string &propertyName, const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues) | |
Initializes a newly constructed SgfcProperty object. The property has the specified type propertyType, name propertyName and property values propertyValues. | |
virtual | ~SgfcProperty () |
Destroys and cleans up the SgfcProperty object. | |
virtual SgfcPropertyType | GetPropertyType () const override |
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 override |
Returns the name of the property. | |
virtual SgfcPropertyCategory | GetPropertyCategory () const override |
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 override |
Returns the property's traits. | |
virtual bool | HasTrait (SgfcPropertyTrait trait) const override |
Returns true if the property has the trait trait. Returns false if the property does not have the trait trait. | |
virtual bool | HasPropertyValues () const override |
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 override |
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) override |
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) override |
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) override |
Removes propertyValue from the property's collection of values. | |
virtual void | RemoveAllPropertyValues () override |
Removes all values from the property's collection of values. | |
virtual std::shared_ptr< ISgfcPropertyValue > | GetPropertyValue () const override |
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 override |
Returns an ISgfcGameTypeProperty object if GetPropertyType() returns SgfcPropertyType::GM. Returns nullptr otherwise. The caller is not the owner of the returned object. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcProperty | |
ISgfcProperty () | |
Initializes a newly constructed ISgfcProperty object. | |
virtual | ~ISgfcProperty () |
Destroys and cleans up the ISgfcProperty object. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcBoardSizeProperty | |
ISgfcBoardSizeProperty () | |
Initializes a newly constructed ISgfcBoardSizeProperty object. | |
virtual | ~ISgfcBoardSizeProperty () |
Destroys and cleans up the ISgfcBoardSizeProperty object. | |
The SgfcBoardSizeProperty class provides an implementation of the ISgfcBoardSizeProperty interface. See the interface header file for documentation.
LibSgfcPlusPlus::SgfcBoardSizeProperty::SgfcBoardSizeProperty | ( | std::shared_ptr< ISgfcNumberPropertyValue > | propertyValue | ) |
Initializes a newly constructed SgfcBoardSizeProperty object. The property has the specified property value propertyValue.
This constructor constructs an ISgfcBoardSizeProperty object that describes a square board.
std::invalid_argument | Is thrown if propertyValue is nullptr. |
LibSgfcPlusPlus::SgfcBoardSizeProperty::SgfcBoardSizeProperty | ( | std::shared_ptr< ISgfcComposedPropertyValue > | propertyValue | ) |
Initializes a newly constructed SgfcBoardSizeProperty object. The property has the specified property value propertyValue.
This overload constructs an ISgfcBoardSizeProperty object that describes a rectangular board.
std::invalid_argument | Is thrown if propertyValue is nullptr, or if the propertyValue object is not composed of two ISgfcNumberPropertyValue objects. |
|
overridevirtual |
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. |
Implements LibSgfcPlusPlus::ISgfcBoardSizeProperty.
|
overridevirtual |
Returns an ISgfcBoardSizeProperty object if GetPropertyType() returns SgfcPropertyType::SZ. Returns nullptr otherwise. The caller is not the owner of the returned object.
Reimplemented from LibSgfcPlusPlus::SgfcProperty.