Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

HexPlayer.hpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file HexPlayer.hpp
00003  */
00004 //----------------------------------------------------------------------------
00005 
00006 #ifndef HEXPLAYER_HPP
00007 #define HEXPLAYER_HPP
00008 
00009 #include "Game.hpp"
00010 #include "HexBoard.hpp"
00011 #include "HexState.hpp"
00012 
00013 _BEGIN_BENZENE_NAMESPACE_
00014 
00015 //----------------------------------------------------------------------------
00016 
00017 /** Abstract base class for all players.
00018     
00019     Players are responsible for generating moves from a given
00020     boardstate.
00021 */
00022 class HexPlayer
00023 {
00024 public:
00025 
00026     /** Destructor. */
00027     virtual ~HexPlayer() { };
00028 
00029     /** Returns a unique identifier for this player. */
00030     virtual std::string Name() const = 0;
00031 
00032     /** Generates a move from this game position. If maxTime is
00033         negative, then there is no timelimit. Otherwise, maxTime is
00034         the number of seconds the player has to generate this move. If
00035         game is already over, player should return RESIGN. The player
00036         can store a score for the move it generated in score.
00037 
00038         @param state Position and color to play.
00039         @param game Game history up to this position.
00040         @param brd HexBoard to do work on.
00041         @param maxTime Time in which to return the move. 
00042         @param score Return score of move here. 
00043     */
00044     virtual HexPoint GenMove(const HexState& state, const Game& game, 
00045                              HexBoard& brd, double maxTime, 
00046                              double& score) = 0;
00047 };
00048 
00049 //----------------------------------------------------------------------------
00050 
00051 _END_BENZENE_NAMESPACE_
00052 
00053 #endif // HEXPLAYER_HPP


6 Jan 2011 Doxygen 1.6.3