Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

FuegoMainEngine.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file FuegoMainEngine.cpp
00003     See FuegoMainEngine.h */
00004 //----------------------------------------------------------------------------
00005 
00006 #include "SgSystem.h"
00007 #include "FuegoMainEngine.h"
00008 
00009 #include "FuegoMainUtil.h"
00010 #include "GoGtpCommandUtil.h"
00011 #include "GoUctPlayer.h"
00012 
00013 using namespace std;
00014 
00015 //----------------------------------------------------------------------------
00016 
00017 FuegoMainEngine::FuegoMainEngine(int fixedBoardSize, const char* programPath,
00018                                  bool noHandicap)
00019     : GoGtpEngine(fixedBoardSize, programPath, false, noHandicap),
00020       m_uctCommands(Board(), m_player),
00021       m_autoBookCommands(Board(), m_player, m_autoBook),
00022       m_safetyCommands(Board())
00023 {
00024     m_uctCommands.Register(*this);
00025     m_safetyCommands.Register(*this);
00026     m_autoBookCommands.Register(*this);
00027     Register("fuego-license", &FuegoMainEngine::CmdLicense, this);
00028     SetPlayer(new PlayerType(Board()));
00029 }
00030 
00031 FuegoMainEngine::~FuegoMainEngine()
00032 {
00033 }
00034 
00035 void FuegoMainEngine::CmdAnalyzeCommands(GtpCommand& cmd)
00036 {
00037     GoGtpEngine::CmdAnalyzeCommands(cmd);
00038     m_uctCommands.AddGoGuiAnalyzeCommands(cmd);
00039     m_safetyCommands.AddGoGuiAnalyzeCommands(cmd);
00040     m_autoBookCommands.AddGoGuiAnalyzeCommands(cmd);
00041     cmd << "string/Fuego License/fuego-license\n";
00042     string response = cmd.Response();
00043     cmd.SetResponse(GoGtpCommandUtil::SortResponseAnalyzeCommands(response));
00044 }
00045 
00046 void FuegoMainEngine::CmdLicense(GtpCommand& cmd)
00047 {
00048     cmd << "\n" <<
00049         "Fuego " << FuegoMainUtil::Version() << "\n" <<
00050         "Copyright (C) 2009-2011 by the authors of the Fuego project.\n"
00051         "See http://fuego.sf.net for information about Fuego. Fuego comes\n"
00052         "with NO WARRANTY to the extent permitted by law. This program is\n"
00053         "free software; you can redistribute it and/or modify it under the\n"
00054         "terms of the GNU Lesser General Public License as published by the\n"
00055         "Free Software Foundation - version 3. For more information about\n"
00056         "these matters, see the files named COPYING and COPYING.LESSER\n";
00057 }
00058 
00059 void FuegoMainEngine::CmdName(GtpCommand& cmd)
00060 {
00061     cmd << "Fuego";
00062 }
00063 
00064 /** Return Fuego version.
00065     @see FuegoMainUtil::Version() */
00066 void FuegoMainEngine::CmdVersion(GtpCommand& cmd)
00067 {
00068     cmd << FuegoMainUtil::Version();
00069 }
00070 
00071 //----------------------------------------------------------------------------


Sun Mar 13 2011 Doxygen 1.7.1