本文整理汇总了C#中SevenWondersGUI.PlayerState.getSeatNumber方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.getSeatNumber方法的具体用法?C# PlayerState.getSeatNumber怎么用?C# PlayerState.getSeatNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SevenWondersGUI.PlayerState
的用法示例。
在下文中一共展示了PlayerState.getSeatNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getRightPlayer
public PlayerState getRightPlayer(PlayerState p)
{
if (p.getSeatNumber() == (players.Count-1))
{
return this.players[0];//first player
}
else
{
return this.players[(p.getSeatNumber() + 1)];
}
}
示例2: getLeftPlayer
public PlayerState getLeftPlayer(PlayerState p)
{
if (p == null) { Console.WriteLine("Snap: PlayerState is null"); }
if (p.getSeatNumber() == 0)
{
return this.players[players.Count-1];//last player
}
else
{
return this.players[(p.getSeatNumber()-1)];
}
}
示例3: UpdateResources
private void UpdateResources(PlayerState p, Card c)
{
//_logger.UpdatingPlayersResources(p,c);
//_logger.DisplayResourceCost(p,c);
if (c is CommerceCard)
{
KensUtilityfunctions k = new KensUtilityfunctions();
int income = k.calcCommerceIncome(c, gameState, p.getSeatNumber());
p.updateCoins(income);
return;
}
if (c is ResourceCard)
{
//_logger.CheckResourceCard(p,c);
//_logger.DisplayPlayersResources(p, hashtable);
List<int> current = baseResources[p.getName()];
if (((ResourceCard)c).hasTradableResources())
{
if ((((ResourceCard)c).getNumber() > 7) && (((ResourceCard)c).getNumber() < 14))
{
//populate Special Resource Hashmap if the Card is a special resource
List<ResourceCard> srlst = SResources[p.getName()];
srlst.Add((ResourceCard)c);
SResources[p.getName()] = srlst;
System.Console.WriteLine(p.getName() + " is adding Special Resource Card: {" + ((ResourceCard)c).getResources()[0] + "," + ((ResourceCard)c).getResources()[1] + "," + ((ResourceCard)c).getResources()[2] + "," + ((ResourceCard)c).getResources()[3] + "," + ((ResourceCard)c).getResources()[4] + "," + ((ResourceCard)c).getResources()[5] + "," + ((ResourceCard)c).getResources()[6] + "}");
}
else
{
int[] tradableResources = ((ResourceCard)c).getResources();
for (int index = 0; index < tradableResources.Count(); index++)
{
switch (index)
{
case (int)Resource.Wood:
current[(int)Resource.Wood] += tradableResources[index];
break;
case (int)Resource.Stone:
current[(int)Resource.Stone] += tradableResources[index];
break;
case (int)Resource.Clay:
current[(int)Resource.Clay] += tradableResources[index];
break;
case (int)Resource.Ore:
current[(int)Resource.Ore] += tradableResources[index];
break;
case (int)Resource.Glass:
current[(int)Resource.Glass] += tradableResources[index];
break;
case (int)Resource.Loom:
current[(int)Resource.Loom] += tradableResources[index];
break;
case (int)Resource.Paper:
current[(int)Resource.Paper] += tradableResources[index];
break;
}
}
System.Console.WriteLine(p.getName() +" is adding: {" + tradableResources[0] + "," + tradableResources[1] + "," + tradableResources[2] + "," + tradableResources[3] + "," + tradableResources[4] + "," + tradableResources[5] + "," + tradableResources[6] + "}");
baseResources[p.getName()] = current;
//_logger.DisplayPlayersResources(p, hashtable);
}
}
return;
}
//_logger.CheckDictionary(p,hashtable);
//_logger.DisplayPlayersResources(p, hashtable);
}
开发者ID:sunneh,项目名称:7Wonders,代码行数:71,代码来源:ResourceManager+(Scott+Needham's+conflicted+copy+2013-04-05).cs
示例4: coinExchange
//CoinTransaction
public void coinExchange(PlayerState p) {
gameState.getLeftPlayer(p).updateCoins(coinTransactions[0]);
gameState.getRightPlayer(p).updateCoins(coinTransactions[1]);
gameState.getPlayers()[p.getSeatNumber()].updateCoins(0 - coinTransactions[0] - coinTransactions[1]);
System.Console.WriteLine("Coins Exchanged! Left: " + coinTransactions[0] + " Right: " + coinTransactions[1] + " You: " + (0 - coinTransactions[0] - coinTransactions[1]));
}