HexSgUtil.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef HEXSGUTIL_HPP
00007 #define HEXSGUTIL_HPP
00008
00009 #include "SgBlackWhite.h"
00010 #include "SgPoint.h"
00011 #include "SgProp.h"
00012 #include "SgNode.h"
00013
00014 #include "Hex.hpp"
00015 #include "StoneBoard.hpp"
00016
00017 _BEGIN_BENZENE_NAMESPACE_
00018
00019
00020
00021
00022 namespace HexSgUtil
00023 {
00024
00025 SgPoint HexPointToSgPoint(HexPoint p, int height);
00026
00027
00028 HexPoint SgPointToHexPoint(SgPoint p, int height);
00029
00030
00031
00032 SgBlackWhite HexColorToSgColor(HexColor color);
00033
00034
00035 HexColor SgColorToHexColor(SgBlackWhite player);
00036
00037
00038 SgVector<SgPoint> BitsetToSgVector(const bitset_t& b, int height);
00039
00040
00041
00042
00043 void AddMoveToNode(SgNode* node, HexColor color,
00044 HexPoint cell, int height);
00045
00046
00047
00048
00049 bool NodeHasSetupInfo(SgNode* node);
00050
00051
00052
00053 void SetPositionInNode(SgNode* root,
00054 const StoneBoard& brd,
00055 HexColor color);
00056
00057
00058 void GetSetupPosition(const SgNode* node,
00059 int height,
00060 std::vector<HexPoint>& black,
00061 std::vector<HexPoint>& white,
00062 std::vector<HexPoint>& empty);
00063
00064
00065 void SetPositionInBoard(const SgNode* node, StoneBoard& brd);
00066
00067
00068
00069
00070
00071 bool WriteSgf(SgNode* tree, const char* filename, int boardsize);
00072 }
00073
00074
00075
00076 _END_BENZENE_NAMESPACE_
00077
00078 #endif // HEXSGUTIL_HPP