Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgNodeUtil Namespace Reference


Functions

int GetMoveNumber (const SgNode *node)
 Get number of moves since root or last node with setup properties.
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 18 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::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 34 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.


17 Jun 2010 Doxygen 1.4.7