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;
}
}