BenzenePlayer.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef BENZENEPLAYER_HPP
00007 #define BENZENEPLAYER_HPP
00008
00009 #include "HexBoard.hpp"
00010 #include "HexEval.hpp"
00011 #include "HexPlayer.hpp"
00012 #include "ICEngine.hpp"
00013
00014 _BEGIN_BENZENE_NAMESPACE_
00015
00016
00017
00018
00019 class BenzenePlayer: public HexPlayer
00020 {
00021 public:
00022 explicit BenzenePlayer();
00023
00024 virtual ~BenzenePlayer();
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 HexPoint GenMove(const HexState& state, const Game& game,
00037 HexBoard& brd, double maxTime, double& score);
00038
00039
00040 bool SearchSingleton() const;
00041
00042
00043 void SetSearchSingleton(bool flag);
00044
00045 protected:
00046 bool m_fillinCausedWin;
00047
00048 HexColor m_fillinWinner;
00049
00050 bool FillinCausedWin() const;
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 virtual HexPoint Search(const HexState& state, const Game& game,
00063 HexBoard& brd, const bitset_t& consider,
00064 double maxTime, double& score) = 0;
00065
00066 private:
00067 bool m_search_singleton;
00068
00069 HexPoint InitSearch(HexBoard& brd, HexColor color,
00070 bitset_t& consider, double& score);
00071
00072 HexPoint CheckEndgame(HexBoard& brd, HexColor color,
00073 bitset_t& consider, double& score);
00074 };
00075
00076 inline bool BenzenePlayer::SearchSingleton() const
00077 {
00078 return m_search_singleton;
00079 }
00080
00081 inline void BenzenePlayer::SetSearchSingleton(bool flag)
00082 {
00083 m_search_singleton = flag;
00084 }
00085
00086 inline bool BenzenePlayer::FillinCausedWin() const
00087 {
00088 return m_fillinCausedWin;
00089 }
00090
00091
00092
00093 _END_BENZENE_NAMESPACE_
00094
00095 #endif // BENZENEPLAYER_HPP