本文整理汇总了C#中SevenWondersGUI.PlayerState.getMilitaryPower方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.getMilitaryPower方法的具体用法?C# PlayerState.getMilitaryPower怎么用?C# PlayerState.getMilitaryPower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SevenWondersGUI.PlayerState
的用法示例。
在下文中一共展示了PlayerState.getMilitaryPower方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getNextCard
public Card getNextCard(PlayerState p, List<Card> hand)
{
PlayerState left = ResourceManager.GetInstance().getGameState().getLeftPlayer(p);
PlayerState right = ResourceManager.GetInstance().getGameState().getRightPlayer(p);
int age = ResourceManager.GetInstance().getGameState().getAge();
Card cur;
//Checks to see if AI has enough MilitaryPower to win the
//the battles at the end of the Age
if ((left.getMilitaryPower() >= p.getMilitaryPower() - age) ||
(right.getMilitaryPower() >= p.getMilitaryPower() - age))
{
cur = ult.playPrimary(p, hand);
if (cur != null)
{
return cur;
}
}
//attempts to play wonder to increase military
if ((p.getBoard().getName().Equals("WB7"))
&& (p.getBoard().getCurrentWonderLevel() < 2)
&& (ResourceManager.GetInstance().ValidateWonder(p)))
{
for (int i = 0; i < hand.Count; i++)
{
if (hand[i].getType() != 6)
{
p.setWonderCards(hand[i]);
p.getBoard().incrementWonderLevel(p);
return hand[i];
}
}
}
if ((p.getBoard().getName().Equals("WB8"))
&& (p.getBoard().getCurrentWonderLevel() < 2)
&& (ResourceManager.GetInstance().ValidateWonder(p)))
{
for (int i = 0; i < hand.Count; i++)
{
if (hand[i].getType() != 6)
{
p.setWonderCards(hand[i]);
p.getBoard().incrementWonderLevel(p);
return hand[i];
}
}
}
cur = ult.playSecondary(p, hand);
if (cur != null)
{
return cur;
}
cur = ult.buildWonder(p, hand);
if (cur != null)
{
return cur;
}
return ult.playAnyCard(p, hand);
}
示例2: SetMilitaryStrategy
private Card SetMilitaryStrategy(PlayerState p, List<Card> hand)
{
int currentAge = ResourceManager.GetInstance().getGameState().getAge();
PlayerState left = ResourceManager.GetInstance().getGameState().getLeftPlayer(p);
PlayerState right = ResourceManager.GetInstance().getGameState().getRightPlayer(p);
if ((left.getMilitaryPower() >= p.getMilitaryPower() - currentAge)
|| (right.getMilitaryPower() >= p.getMilitaryPower() - currentAge))
{
strategy = new MilitaryStrategy();
Card c = strategy.getNextCard(p, hand);
return c;
}
return null;
}