本文整理匯總了C#中SevenWondersGUI.PlayerState.countCardType方法的典型用法代碼示例。如果您正苦於以下問題:C# PlayerState.countCardType方法的具體用法?C# PlayerState.countCardType怎麽用?C# PlayerState.countCardType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SevenWondersGUI.PlayerState
的用法示例。
在下文中一共展示了PlayerState.countCardType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GuildScore
private int GuildScore(PlayerState p, GameState g)
{
int score = 0;
List<GuildCard> glist = new List<GuildCard>();
//GameState g = ;
//Cycle through played cards
for (int i = 0; i < p.getPlayedCards().Count; i++)
{
if (p.getPlayedCards()[i].getType() == Card._GUILD)
{
glist.Add((GuildCard)p.getPlayedCards()[i]);
}
}
//Cycle through guild cards
for (int i = 0; i < glist.Count; i++)
{
//worker
if (glist[i].getNumber() == 98) { score = score + (2 * (g.getLeftPlayer(p).countCardType(2) + g.getRightPlayer(p).countCardType(2)));}
//craft
if (glist[i].getNumber() == 99) { score = score + (g.getLeftPlayer(p).countCardType(1) + g.getRightPlayer(p).countCardType(1)); }
//trader
if (glist[i].getNumber() == 100) { score = score + (g.getLeftPlayer(p).countCardType(4) + g.getRightPlayer(p).countCardType(4)); }
//Philospher
if (glist[i].getNumber() == 101) { score = score + (g.getLeftPlayer(p).countCardType(6) + g.getRightPlayer(p).countCardType(6)); }
//Spies
if (glist[i].getNumber() == 102) { score = score + (g.getLeftPlayer(p).countCardType(5) + g.getRightPlayer(p).countCardType(5)); }
//strat
if (glist[i].getNumber() == 103) { score = score + (g.getLeftPlayer(p).getNumLosses()) + (g.getRightPlayer(p).getNumLosses());}
//ship
if (glist[i].getNumber() == 104) { score = score + (p.countCardType(1)) + (p.countCardType(2)) + (p.countCardType(7));}
//Science
if (glist[i].getNumber() == 105) { scienceguildCard = true; }
//magistrat
if (glist[i].getNumber() == 106) { score = score + (g.getLeftPlayer(p).countCardType(3) + g.getRightPlayer(p).countCardType(3)); }
//builders
if (glist[i].getNumber() == 107) {
score = score + (g.getRightPlayer(p).getBoard().getCurrentWonderLevel());
score = score + (g.getLeftPlayer(p).getBoard().getCurrentWonderLevel());
score = score + (p.getBoard().getCurrentWonderLevel());
}
}
return score;
}