Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Functions

SgNodeUtil Namespace Reference

Functions

int GetMoveNumber (const SgNode *node)
 Get number of moves since root or last node with setup properties.
void RemovePropInSubtree (SgNode &root, SgPropID id)
 Remove all occurrences of a property in the subtree of a node.
void UpdateTime (SgTimeRecord &time, const SgNode *node)
 Update the current time information corresponding to a node.

Function Documentation

int SgNodeUtil::GetMoveNumber ( const SgNode node  ) 

Get number of moves since root or last node with setup properties.

Definition at line 17 of file SgNodeUtil.cpp.

References SgNode::Father(), SgNode::HasProp(), SG_PROP_ADD_BLACK, SG_PROP_ADD_EMPTY, SG_PROP_ADD_WHITE, and SG_PROP_MOVE.

void SgNodeUtil::RemovePropInSubtree ( SgNode root,
SgPropID  id 
)

Remove all occurrences of a property in the subtree of a node.

Definition at line 33 of file SgNodeUtil.cpp.

References SgNode::Props(), and SgPropList::RemoveProp().

void SgNodeUtil::UpdateTime ( SgTimeRecord time,
const SgNode node 
)

Update the current time information corresponding to a node.

Visits all nodes in the path from root to the target node and applies the following properties to the time record: SG_PROP_LOSE_TIME, SG_PROP_OT_NU_MOVES, SG_PROP_OT_NU_MOVES, SG_PROP_OT_PERIOD, SG_PROP_OVERHEAD.

Todo:
Initial time settings property TM is not handled, SgTimeRecord does presently not support main time (without a finite number of moves left)

Definition at line 40 of file SgNodeUtil.cpp.

References SgNode::Father(), SgNode::GetIntProp(), SgNode::GetRealProp(), SgNode::HasProp(), SgTimeRecord::SetLoseOnTime(), SgTimeRecord::SetOTNumMoves(), SgTimeRecord::SetOTPeriod(), SgTimeRecord::SetOverhead(), SG_PROP_LOSE_TIME, SG_PROP_OT_NU_MOVES, SG_PROP_OT_PERIOD, and SG_PROP_OVERHEAD.


Sun Mar 13 2011 Doxygen 1.7.1