本文整理汇总了C#中HRSim.Playfield.getBestPlace方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.getBestPlace方法的具体用法?C# Playfield.getBestPlace怎么用?C# Playfield.getBestPlace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRSim.Playfield
的用法示例。
在下文中一共展示了Playfield.getBestPlace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getMoveList
public List<Action> getMoveList(Playfield p, bool isLethalCheck, bool usePenalityManager, bool useCutingTargets)
{
bool own = p.isOwnTurn;
Player mPlayer, ePlayer;
if (own)
{
mPlayer = p.playerFirst;
ePlayer = p.playerSecond;
}
else {
mPlayer = p.playerSecond;
ePlayer = p.playerFirst;
}
//generates only own moves
List<Action> ret = new List<Action>();
List<Minion> trgts = new List<Minion>();
if (p.complete || mPlayer.ownHero.Hp <= 0)
{
return ret;
}
//play cards:
List<CardDB.cardName> playedcards = new List<CardDB.cardName>();
foreach (Handmanager.Handcard hc in mPlayer.owncards)
{
CardDB.Card c = hc.card;
//implementation
if (c.name == CardDB.cardName.armorplating)
{
p.moveTrigger.hasOwnTargetMove = true;
}
//end of implementation
if (playedcards.Contains(c.name) || !hc.canplayCard(p, own)) continue; // dont play the same card in one loop
//playedcards.Add(c.name);
int isChoice = (c.choice) ? 1 : 0;
for (int i = 0 + 1 * isChoice; i < 1 + 2 * isChoice; i++)
{
if (isChoice == 1) c = getChooseCard(hc.card, i); // do all choice
int manaCost = hc.getManaCost(p, own);
if (mPlayer.mana >= manaCost) // if enough manna
{
int cardplayPenality = 0;
int bestplace = p.getBestPlace(c, isLethalCheck, own);
//if (c.cardIDenum == CardDB.cardIDEnum.NEW1_005) {
// int toBreak = 1;
//}
trgts = c.getTargetsForCard(p, isLethalCheck, own);
float bestReward = Single.MinValue;
List<Tuple<Action, float>> tempRet = new List<Tuple<Action, float>>();
foreach (Minion trgt in trgts)
{
if (usePenalityManager) cardplayPenality = pen.getPlayCardPenality(hc.card, trgt, p, i, isLethalCheck);
if (cardplayPenality <= 499)
{
Action a = new Action(actionEnum.playcard, hc, null, bestplace, trgt, cardplayPenality, i, manaCost); //i is the choice
ret.Add(a);
if (trgt != null && trgt.own == p.isOwnTurn)
{
p.moveTrigger.hasOwnTargetMove = true;
}
//if (trgt != null)
//{
// if (trgt.isHero && trgt.Hp <= 12)
// {
// ret.Add(a);
// continue;
// }
// float reward = pen.getOffenseReward(a, p);
// tempRet.Add(new Tuple<Action, float>(a, reward));
//}
//else
//{
// ret.Add(a);
//}
}
}
//tempRet.Sort((x, y) => y.Item2.CompareTo(x.Item2));
//if (tempRet.Count > 0)
//{
// ret.Add(tempRet[0].Item1);
// if (tempRet[0].Item1.target.own == p.isOwnTurn)
// {
// p.moveTrigger.hasOwnTargetMove = true;
// }
//}
//if (tempRet.Count > 1)
//{
// ret.Add(tempRet[1].Item1);
// if (tempRet[1].Item1.target.own == p.isOwnTurn)
// {
// p.moveTrigger.hasOwnTargetMove = true;
// }
//.........这里部分代码省略.........