WolveMain.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include "SgSystem.h"
00007
00008 #include "config.h"
00009 #include "HexProgram.hpp"
00010 #include "WolveEngine.hpp"
00011 #include "WolvePlayer.hpp"
00012 #include "SwapCheck.hpp"
00013
00014 using namespace benzene;
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace {
00042
00043 const char* build_date = __DATE__;
00044
00045 }
00046
00047
00048
00049 int main(int argc, char** argv)
00050 {
00051 HexProgram& program = HexProgram::Get();
00052 program.SetInfo("Wolve", VERSION, build_date);
00053 program.PrintStartupMessage();
00054 program.Initialize(argc, argv);
00055 WolvePlayer player;
00056 try
00057 {
00058 WolveEngine gh(program.BoardSize(), player);
00059 std::string config = program.ConfigFileToExecute();
00060 if (config != "")
00061 gh.ExecuteFile(config);
00062 GtpInputStream gin(std::cin);
00063 GtpOutputStream gout(std::cout);
00064 gh.MainLoop(gin, gout);
00065
00066 program.Shutdown();
00067 }
00068 catch (const GtpFailure& f)
00069 {
00070 std::cerr << f.Response() << std::endl;
00071 return 1;
00072 }
00073 return 0;
00074 }
00075
00076