Пример #1
0
 internal void TakeIfBetter(GameState nextScoredMove, int scoreIndex, IPlayerMove thisMove)
 {
     double otherOffsetScore = nextScoredMove[scoreIndex] - Scores[scoreIndex];
     bool takeIt = false;
     if (Math.Abs(otherOffsetScore) < double.Epsilon)
     {
         if (nextScoredMove.Scores.Sum() < Scores.Sum())
         {
             takeIt = true;
         }
     }
     else if (otherOffsetScore < 0.0)
     {
         return; // not take it
     }
     else if (otherOffsetScore > 0.0)
     {
         takeIt = true;
     }
     if (takeIt)
     {
         NextGameState = nextScoredMove;
         Scores = nextScoredMove.Scores;
         BestMove = thisMove;
     }
 }
Пример #2
0
 internal void Remember(ulong hash, GameState bestMoves, int depth)
 {
     if (GetBestScoredMoves(hash, depth) == null)
     {
         _hashLookUp[hash] = new HashedGameInfo
                                 {
                                     BestMoves = bestMoves,
                                     Depth = depth
                                 };
     }
 }