00001 //---------------------------------------------------------------------------- 00002 /** @file GoBoardUpdater.h */ 00003 //---------------------------------------------------------------------------- 00004 00005 #ifndef GO_BOARDUPDATER_H 00006 #define GO_BOARDUPDATER_H 00007 00008 #include <vector> 00009 00010 class GoBoard; 00011 class SgNode; 00012 00013 //---------------------------------------------------------------------------- 00014 00015 /** Updates a board to a node in a game tree. 00016 This could be a function, but is a class to reuse a locally used list for 00017 efficiency. The update is always done from scratch (initializing the board 00018 and applying all changes from the root node to the current node). */ 00019 class GoBoardUpdater 00020 { 00021 public: 00022 void Update(const SgNode* node, GoBoard& bd); 00023 00024 private: 00025 /** Local variable used in Update(). 00026 Member variable for avoiding frequent new memory allocations. */ 00027 std::vector<const SgNode*> m_nodes; 00028 }; 00029 00030 //---------------------------------------------------------------------------- 00031 00032 #endif // GO_BOARDUPDATER_H