00001
00002
00003
00004
00005
00006
00007 #ifndef GO_GTPCOMMANDUTIL_H
00008 #define GO_GTPCOMMANDUTIL_H
00009
00010 #include <cstddef>
00011 #include "SgBlackWhite.h"
00012 #include "SgBoardColor.h"
00013 #include "SgPoint.h"
00014 #include "SgVector.h"
00015
00016 class GtpCommand;
00017 class GoBoard;
00018 template<typename T> class SgPointArray;
00019
00020
00021
00022 namespace GoGtpCommandUtil
00023 {
00024
00025 SgEmptyBlackWhite EmptyBlackWhiteArg(const GtpCommand& cmd,
00026 std::size_t number);
00027
00028 SgBlackWhite BlackWhiteArg(const GtpCommand& cmd, std::size_t number);
00029
00030 SgPoint EmptyPointArg(const GtpCommand& cmd, std::size_t number,
00031 const GoBoard& board);
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 SgVector<SgPoint> GetHandicapStones(int size, int n);
00043
00044 SgMove MoveArg(const GtpCommand& cmd, std::size_t number,
00045 const GoBoard& board);
00046
00047
00048
00049
00050 void ParseMultiStoneArgument(GtpCommand& cmd,
00051 const GoBoard& board,
00052 SgBlackWhite& toPlay,
00053 SgBlackWhite& defender,
00054 SgVector<SgPoint>& crucial);
00055
00056 SgPoint PointArg(const GtpCommand& cmd, const GoBoard& board);
00057
00058 SgPoint PointArg(const GtpCommand& cmd, std::size_t number,
00059 const GoBoard& board);
00060
00061
00062
00063
00064 SgVector<SgPoint> PointListArg(const GtpCommand& cmd, std::size_t number,
00065 const GoBoard& board);
00066
00067
00068 SgVector<SgPoint> PointListArg(const GtpCommand& cmd,
00069 const GoBoard& board);
00070
00071 void RespondNumberArray(GtpCommand& cmd, const SgPointArray<int>& array,
00072 int scale, const GoBoard& board);
00073
00074
00075
00076
00077
00078
00079
00080
00081 std::string SortResponseAnalyzeCommands(const std::string& response);
00082
00083 SgPoint StoneArg(const GtpCommand& cmd, std::size_t number,
00084 const GoBoard& board);
00085 }
00086
00087 inline SgVector<SgPoint> GoGtpCommandUtil::PointListArg(const GtpCommand& cmd,
00088 const GoBoard& board)
00089 {
00090 return PointListArg(cmd, 0, board);
00091 }
00092
00093
00094
00095 #endif // GO_GTPCOMMANDUTIL_H
00096