feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AIReverseEvaluateValueListOrder
|
||||
{
|
||||
private List<float> evalvalues = new List<float>();
|
||||
|
||||
private List<AIVirtualCard> cards = new List<AIVirtualCard>();
|
||||
|
||||
public void AddData(float value, AIVirtualCard card)
|
||||
{
|
||||
if (card == null)
|
||||
{
|
||||
AIConsoleUtility.LogError("CompValue:AddData() Target card is null");
|
||||
}
|
||||
else if (evalvalues.Any())
|
||||
{
|
||||
bool flag = false;
|
||||
for (int i = 0; i < evalvalues.Count; i++)
|
||||
{
|
||||
if (evalvalues[i] > value)
|
||||
{
|
||||
evalvalues.Insert(i, value);
|
||||
cards.Insert(i, card);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
evalvalues.Add(value);
|
||||
cards.Add(card);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
evalvalues.Add(value);
|
||||
cards.Add(card);
|
||||
}
|
||||
}
|
||||
|
||||
public List<AIVirtualCard> GetCardList(int takeCount)
|
||||
{
|
||||
if (takeCount <= 0 || cards.Count < takeCount)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<AIVirtualCard> list = new List<AIVirtualCard>();
|
||||
for (int i = 0; i < takeCount; i++)
|
||||
{
|
||||
list.Add(cards[i]);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public AIVirtualCard GetFirst()
|
||||
{
|
||||
if (cards == null || cards.Count <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return cards[0];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user