#include <SgProp.h>
Implemented as list of pointers to objects derived from Property.
Definition at line 133 of file SgProp.h.
Public Member Functions | |
SgPropList () | |
~SgPropList () | |
bool | IsEmpty () const |
Return whether this list contains zero elements. | |
void | Clear () |
Remove all elements in this list, disposing each property. | |
SgProp * | Get (SgPropID id) const |
Return the first property in the list that matches the given ID. | |
SgProp * | GetPropContainingText (const std::string &findText) const |
Return the first property in the list that matches the given text. | |
void | Add (const SgProp *prop) |
Add the property to this property list. | |
void | MoveToFront (SgPropID id) |
If the property with the given ID exists, move it to the front of this property list. | |
bool | Remove (const SgProp *prop) |
Remove the property from the property list. | |
void | Remove (SgPropID id, const SgProp *protectProp) |
Remove any properties that match 'id' from this list, and dispose them, except don't touch *protectProp if it's in the list. | |
void | RemoveProp (SgPropID id) |
bool | AppendMoveAnnotation (std::string *s) const |
Add the move annotations at the end of '*string'. | |
Private Member Functions | |
SgPropList (const SgPropList &) | |
not implemented | |
SgPropList & | operator= (const SgPropList &) |
not implemented | |
Private Attributes | |
SgVectorOf< SgProp > | m_list |
property list implemented as list of properties | |
Friends | |
class | SgPropListIterator |
SgPropList::SgPropList | ( | ) |
Definition at line 142 of file SgProp.cpp.
SgPropList::~SgPropList | ( | ) |
SgPropList::SgPropList | ( | const SgPropList & | ) | [private] |
not implemented
void SgPropList::Add | ( | const SgProp * | prop | ) |
Add the property to this property list.
Enforces that no two properties of the same kind are added.
Definition at line 169 of file SgProp.cpp.
References SgProp::Flag(), SgProp::ID(), SgVectorOf< T >::Include(), m_list, Remove(), SG_ASSERT, SG_PROP_MOVE, SG_PROP_MOVE_ANNO, SG_PROP_POS_ANNO, SG_PROP_UNKNOWN, SG_PROPCLASS_ANNO_MOVE, SG_PROPCLASS_ANNO_POS, and SG_PROPCLASS_MOVE.
Referenced by SgNode::Add().
bool SgPropList::AppendMoveAnnotation | ( | std::string * | s | ) | const |
Add the move annotations at the end of '*string'.
!! very good move SG_PROP_GOOD_MOVE[2]
! good move SG_PROP_GOOD_MOVE[1]
!? interesting move SG_PROP_INTERESTING
?! doubtful move SG_PROP_DOUBTFUL
? bad move SG_PROP_BAD_MOVE[1]
?? very bad move SG_PROP_BAD_MOVE[2]
Return true if a move annotation was added.
Definition at line 220 of file SgProp.cpp.
References Get(), SgProp::ID(), SG_PROP_BAD_MOVE, SG_PROP_DOUBTFUL, SG_PROP_GOOD_MOVE, SG_PROP_INTERESTING, SG_PROP_MOVE_ANNO, and SgPropInt::Value().
void SgPropList::Clear | ( | ) |
Remove all elements in this list, disposing each property.
Definition at line 151 of file SgProp.cpp.
References SgVector< T >::Clear(), and m_list.
Referenced by ~SgPropList().
Return the first property in the list that matches the given ID.
Note that SG_PROP_INFO, SG_PROP_ANNOTATE, SG_PROP_POS_ANNO, SG_PROP_MOVE_ANNO, and SG_PROP_COUNT match any property that has the corresponding flag set.
Definition at line 158 of file SgProp.cpp.
References m_list.
Referenced by AppendMoveAnnotation(), SgNode::Get(), and MoveToFront().
SgProp * SgPropList::GetPropContainingText | ( | const std::string & | findText | ) | const |
Return the first property in the list that matches the given text.
Definition at line 239 of file SgProp.cpp.
References m_list.
Referenced by SgNode::ContainsText().
bool SgPropList::IsEmpty | ( | ) | const |
Return whether this list contains zero elements.
Definition at line 204 of file SgProp.h.
References SgVector< T >::IsEmpty(), and m_list.
void SgPropList::MoveToFront | ( | SgPropID | id | ) |
If the property with the given ID exists, move it to the front of this property list.
Definition at line 190 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), Get(), m_list, and SgVectorOf< T >::PushFront().
Referenced by SgGameWriter::WriteGame().
SgPropList& SgPropList::operator= | ( | const SgPropList & | ) | [private] |
not implemented
Remove any properties that match 'id' from this list, and dispose them, except don't touch *protectProp if it's in the list.
Definition at line 204 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), m_list, SgProp::MatchesID(), and SgVectorOf< T >::PushBack().
bool SgPropList::Remove | ( | const SgProp * | prop | ) |
Remove the property from the property list.
Return true if the property was in the list.
Definition at line 197 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), and m_list.
Referenced by Add(), and RemoveProp().
void SgPropList::RemoveProp | ( | SgPropID | id | ) |
friend class SgPropListIterator [friend] |
SgVectorOf<SgProp> SgPropList::m_list [private] |
property list implemented as list of properties
Definition at line 195 of file SgProp.h.
Referenced by Add(), Clear(), Get(), GetPropContainingText(), IsEmpty(), MoveToFront(), and Remove().