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 | List of all members
LibSgfcPlusPlus::SgfcGoMovePropertyValue Class Reference

The SgfcGoMovePropertyValue class provides an implementation of the ISgfcGoMovePropertyValue interface. See the interface header file for documentation. More...

#include <SgfcGoMovePropertyValue.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcGoMovePropertyValue:
LibSgfcPlusPlus::SgfcMovePropertyValue LibSgfcPlusPlus::ISgfcGoMovePropertyValue LibSgfcPlusPlus::SgfcSinglePropertyValue LibSgfcPlusPlus::ISgfcMovePropertyValue LibSgfcPlusPlus::ISgfcMovePropertyValue LibSgfcPlusPlus::ISgfcSinglePropertyValue LibSgfcPlusPlus::ISgfcSinglePropertyValue LibSgfcPlusPlus::ISgfcSinglePropertyValue LibSgfcPlusPlus::ISgfcPropertyValue LibSgfcPlusPlus::ISgfcPropertyValue LibSgfcPlusPlus::ISgfcPropertyValue

Public Member Functions

 SgfcGoMovePropertyValue (std::shared_ptr< ISgfcGoMove > goMove)
 Initializes a newly constructed SgfcGoMovePropertyValue object. The object holds a Move value represented by goMove.
 
virtual ~SgfcGoMovePropertyValue ()
 Destroys and cleans up the SgfcGoMovePropertyValue object.
 
virtual const ISgfcGoMovePropertyValueToGoMoveValue () const override
 Returns an ISgfcGoMovePropertyValue object if the property value object was created specifically for SgfcGameType::Go. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual std::shared_ptr< ISgfcGoMoveGetGoMove () const override
 Returns an ISgfcGoMove object that contains the property value data.
 
- Public Member Functions inherited from LibSgfcPlusPlus::SgfcMovePropertyValue
 SgfcMovePropertyValue (const std::string &rawValue, const SgfcMove &moveValue)
 Initializes a newly constructed SgfcMovePropertyValue object. The object holds the Move value moveValue and the corresponding raw string value rawValue.
 
virtual ~SgfcMovePropertyValue ()
 Destroys and cleans up the SgfcMovePropertyValue object.
 
virtual SgfcMove GetMoveValue () const override
 Returns the property value interpreted as an SgfcMove value.
 
virtual const ISgfcMovePropertyValueToMoveValue () const override
 Returns an ISgfcMovePropertyValue object if GetValueType() returns SgfcPropertyValueType::Move. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::SgfcSinglePropertyValue
 SgfcSinglePropertyValue (const std::string &rawValue)
 Initializes a newly constructed SgfcSinglePropertyValue object that has the raw property string value rawValue. The value type is SgfcPropertyValueType::Unknown, HasTypedValue() returns false and GetTypeConversionErrorMessage() returns an empty string.
 
 SgfcSinglePropertyValue (const std::string &rawValue, SgfcPropertyValueType valueType)
 Initializes a newly constructed SgfcSinglePropertyValue object that has the raw property string value rawValue and the value type valueType. HasTypedValue() returns true and GetTypeConversionErrorMessage() returns an empty string.
 
 SgfcSinglePropertyValue (const std::string &rawValue, SgfcPropertyValueType valueType, const std::string &typeConversionErrorMessage)
 Initializes a newly constructed SgfcSinglePropertyValue object that has the raw property string value rawValue and the value type valueType. HasTypedValue() returns false and GetTypeConversionErrorMessage() returns typeConversionErrorMessage.
 
virtual ~SgfcSinglePropertyValue ()
 Destroys and cleans up the SgfcSinglePropertyValue object.
 
virtual bool IsComposedValue () const override
 Returns true if the ISgfcPropertyValue object holds a "composed" value, i.e. a value that consists of a composite of two single values. Returns false if the ISgfcPropertyValue holds only a single value.
 
virtual const ISgfcSinglePropertyValueToSingleValue () const override
 Returns nullptr if IsComposedValue() returns true. Returns an ISgfcSinglePropertyValue object if IsComposedValue() returns false. The caller is not the owner of the ISgfcSinglePropertyValue object.
 
virtual SgfcPropertyValueType GetValueType () const override
 Returns the concrete type of the property value object. Depending on the value returned, a caller then knows which one of the convenience casting methods to use.
 
virtual bool HasTypedValue () const override
 Returns true if the raw string value returned by GetRawValue() is available as a typed value. Otherwise returns false.
 
virtual std::string GetTypeConversionErrorMessage () const override
 Returns an error message that describes why the raw string value returned by GetRawValue() could not be converted to the typed value returned by GetValueType().
 
virtual std::string GetRawValue () const override
 Returns the property value as a raw string, i.e. as close as possible as it appears in the original SGF content.
 
virtual const ISgfcNumberPropertyValueToNumberValue () const override
 Returns an ISgfcNumberPropertyValue object if GetValueType() returns SgfcPropertyValueType::Number. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcRealPropertyValueToRealValue () const override
 Returns an ISgfcRealPropertyValue object if GetValueType() returns SgfcPropertyValueType::Real. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcDoublePropertyValueToDoubleValue () const override
 Returns an ISgfcDoublePropertyValue object if GetValueType() returns SgfcPropertyValueType::Double. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcColorPropertyValueToColorValue () const override
 Returns an ISgfcColorPropertyValue object if GetValueType() returns SgfcPropertyValueType::Color. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcSimpleTextPropertyValueToSimpleTextValue () const override
 Returns an ISgfcSimpleTextPropertyValue object if GetValueType() returns SgfcPropertyValueType::SimpleText. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcTextPropertyValueToTextValue () const override
 Returns an ISgfcTextPropertyValue object if GetValueType() returns SgfcPropertyValueType::Text. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcPointPropertyValueToPointValue () const override
 Returns an ISgfcPointPropertyValue object if GetValueType() returns SgfcPropertyValueType::Point. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const ISgfcStonePropertyValueToStoneValue () const override
 Returns an ISgfcStonePropertyValue object if GetValueType() returns SgfcPropertyValueType::Stone. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcSinglePropertyValue
 ISgfcSinglePropertyValue ()
 Initializes a newly constructed ISgfcSinglePropertyValue object.
 
virtual ~ISgfcSinglePropertyValue ()
 Destroys and cleans up the ISgfcSinglePropertyValue object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcPropertyValue
 ISgfcPropertyValue ()
 Initializes a newly constructed ISgfcPropertyValue object.
 
virtual ~ISgfcPropertyValue ()
 Destroys and cleans up the ISgfcPropertyValue object.
 
virtual const ISgfcComposedPropertyValueToComposedValue () const
 Returns an ISgfcComposedPropertyValue object if IsComposedValue() returns true. Returns nullptr if IsComposedValue() returns false. The caller is not the owner of the ISgfcComposedPropertyValue object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcMovePropertyValue
 ISgfcMovePropertyValue ()
 Initializes a newly constructed ISgfcMovePropertyValue object.
 
virtual ~ISgfcMovePropertyValue ()
 Destroys and cleans up the ISgfcMovePropertyValue object.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcGoMovePropertyValue
 ISgfcGoMovePropertyValue ()
 Initializes a newly constructed ISgfcGoMovePropertyValue object.
 
virtual ~ISgfcGoMovePropertyValue ()
 Destroys and cleans up the ISgfcGoMovePropertyValue object.
 

Detailed Description

The SgfcGoMovePropertyValue class provides an implementation of the ISgfcGoMovePropertyValue interface. See the interface header file for documentation.

Constructor & Destructor Documentation

◆ SgfcGoMovePropertyValue()

LibSgfcPlusPlus::SgfcGoMovePropertyValue::SgfcGoMovePropertyValue ( std::shared_ptr< ISgfcGoMove > goMove)

Initializes a newly constructed SgfcGoMovePropertyValue object. The object holds a Move value represented by goMove.

If goMove is a pass move SgfcGoMovePropertyValue uses SgfcConstants::GoMovePassString as the raw property value.

If goMove is not a pass move SgfcGoMovePropertyValue uses the SGF notation of the ISgfcGoPoint object referenced by goMove (indirectly via ISgfcGoStone) as the raw property value. This refers to the location of the stone that is placed by the move on the board.

Exceptions
std::invalid_argumentIs thrown if goMove is nullptr.

Member Function Documentation

◆ GetGoMove()

std::shared_ptr< ISgfcGoMove > LibSgfcPlusPlus::SgfcGoMovePropertyValue::GetGoMove ( ) const
overridevirtual

Returns an ISgfcGoMove object that contains the property value data.

Implements LibSgfcPlusPlus::ISgfcGoMovePropertyValue.

◆ ToGoMoveValue()

const ISgfcGoMovePropertyValue * LibSgfcPlusPlus::SgfcGoMovePropertyValue::ToGoMoveValue ( ) const
overridevirtual

Returns an ISgfcGoMovePropertyValue object if the property value object was created specifically for SgfcGameType::Go. Returns nullptr otherwise. The caller is not the owner of the returned object.

Reimplemented from LibSgfcPlusPlus::SgfcMovePropertyValue.


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