[Housebot-developers] SF.net SVN: housebot: [467] trunk/housebot/src
Status: Alpha
Brought to you by:
j_house
|
From: <j_...@us...> - 2007-02-07 01:56:48
|
Revision: 467
http://svn.sourceforge.net/housebot/?rev=467&view=rev
Author: j_house
Date: 2007-02-06 17:56:38 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
Several updates based on an honest attempt to review GTP operation
* Many registered GTP commands within src/brains.cpp duplicate other GTP commands with no harm done. Rather than comment out all my hard work, they have been re-added
* Altered undo functionality and comments about it. Bypassing a call to ApplyGameTree almost required another undo to supplement operation. I don't think this was the right approach and I left the src/brains.cpp function commented out but gave an attempt at a comment as to why. There is a "todo" item there.
* The time_left command is also uncommented. I may have left this commented incorrectly in my last commit. This'll be a nice feature for future tournaments. It needs some testing...
Modified Paths:
--------------
trunk/housebot/src/brains.cpp
trunk/housebot/src/gtp/GTPGoBoard.h
Modified: trunk/housebot/src/brains.cpp
===================================================================
--- trunk/housebot/src/brains.cpp 2007-02-07 00:16:24 UTC (rev 466)
+++ trunk/housebot/src/brains.cpp 2007-02-07 01:56:38 UTC (rev 467)
@@ -580,11 +580,11 @@
void
collective::register_gtp(GTPBoard >p_engine){
- /// \bug since these command bypass the GoBoardInterface and other data structures, like the GameTree, are not updated and causes the program to crash.
-// gtp_engine.RegisterCommand("boardsize", GTPCommandCallBack1(new boost::function1<void, int> (boost::lambda::bind(boost::mem_fn(&collective::reinitialize), (collective*)this, boost::lambda::_1))));
-// gtp_engine.RegisterCommand("clear_board", GTPCommandCallBack0(new boost::function0<void> (boost::lambda::bind(boost::mem_fn(&collective::clear), (collective*)this))));
-// gtp_engine.RegisterCommand("komi", GTPCommandCallBack1(new boost::function1<void, float>(boost::lambda::bind(boost::mem_fn(&collective::set_komi), (collective*)this, boost::lambda::_1))));
-// gtp_engine.RegisterCommand("time_left", GTPCommandCallBack3(new boost::function3<void, color_t, int, int>(boost::lambda::bind(boost::mem_fn(&collective::time_left), (collective*)this, boost::lambda::_1, boost::lambda::_2, boost::lambda::_3))));
+ gtp_engine.RegisterCommand("boardsize", GTPCommandCallBack1(new boost::function1<void, int> (boost::lambda::bind(boost::mem_fn(&collective::reinitialize), (collective*)this, boost::lambda::_1))));
+ gtp_engine.RegisterCommand("clear_board", GTPCommandCallBack0(new boost::function0<void> (boost::lambda::bind(boost::mem_fn(&collective::clear), (collective*)this))));
+ gtp_engine.RegisterCommand("komi", GTPCommandCallBack1(new boost::function1<void, float>(boost::lambda::bind(boost::mem_fn(&collective::set_komi), (collective*)this, boost::lambda::_1))));
+ gtp_engine.RegisterCommand("time_left", GTPCommandCallBack3(new boost::function3<void, color_t, int, int>(boost::lambda::bind(boost::mem_fn(&collective::time_left), (collective*)this, boost::lambda::_1, boost::lambda::_2, boost::lambda::_3))));
+ /// \todo This undo implementation is far faster than the other one (that replays the entire game) and saves a lot of cached data. It doesn't, however, honor the actual stored game tree in the sgf utility. Some enhanced implementation should be done to get both the speed and preserve the game tree.
// gtp_engine.RegisterCommand("undo", GTPCommandCallBack0(new boost::function0<void> (boost::lambda::bind(boost::mem_fn(&collective::undo), (collective*)this))));
}
Modified: trunk/housebot/src/gtp/GTPGoBoard.h
===================================================================
--- trunk/housebot/src/gtp/GTPGoBoard.h 2007-02-07 00:16:24 UTC (rev 466)
+++ trunk/housebot/src/gtp/GTPGoBoard.h 2007-02-07 01:56:38 UTC (rev 467)
@@ -150,7 +150,7 @@
{
GameTree lGameTree = _GTPGoBoard(pGTPBoard).mGameTree;
lGameTree.RemoveLastMove();
- //Board(pGTPBoard).ApplyGameTree(lGameTree);
+ Board(pGTPBoard).ApplyGameTree(lGameTree);
}
return GTPInternalResponse(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|