示例#1
0
 // Normalize the new winner hand distribution, resetting it to the default distribution if it sums up to zero
 protected void RenormalizeCardDistribution(ref float[] Distr, int HandOwnerIndex = -1)
 {
     if (AIUtil.NormalizeProbabilitiesArray(ref Distr) <= 0)
     {
         if (HandOwnerIndex >= 0)
         {
             if (PlayerIsKnockedOut[HandOwnerIndex])
             {
                 return;
             }
             Debug.LogWarningFormat("{0}'s beliefs about {1}'s hand sum up to 0! Resetting to default...", MyController, MyController.Game.Players[HandOwnerIndex]);
         }
         else
         {
             if (MyController.Game.Deck.CountCardsLeft == 0)
             {
                 return;
             }
             Debug.LogWarningFormat("{0}'s beliefs about deck contents sum up to 0! Resetting to default...", MyController);
         }
         Array.Copy(BaseDeckDistribution, Distr, CARD_VECTOR_LENGTH);
     }
 }