本文整理汇总了C#中Space.ReturnToPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# Space.ReturnToPlayer方法的具体用法?C# Space.ReturnToPlayer怎么用?C# Space.ReturnToPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Space
的用法示例。
在下文中一共展示了Space.ReturnToPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseAction
//.........这里部分代码省略.........
var wholeResources = diceSum / (int)Resource.Stone;
Board.StoneAvailable -= wholeResources;
player.PlayerBoard.Resources[Resource.Stone] += wholeResources;
break;
}
case BoardSpace.River:
{
// TODO: be sure to test max on food track, population, tools, resources
result = _dicePouch.Roll(space.QuantityPlaced(player));
var diceSum = result.Sum();
var wholeResources = diceSum / (int)Resource.Gold;
Board.GoldAvailable -= wholeResources;
player.PlayerBoard.Resources[Resource.Gold] += wholeResources;
break;
}
case BoardSpace.ToolMaker:
{
// TODO: be sure to test max on food track, population, tools, resources
var tools = player.PlayerBoard.Tools;
var minValue = tools.Min(t => t.Value);
var hasAToolFree = tools.Any(t => !t.Used);
for (int toolPosition = 0; toolPosition < tools.Length; toolPosition++)
{
if (hasAToolFree && tools[toolPosition].Used)
continue;
if (tools[toolPosition].Value == minValue)
{
tools[toolPosition] = Tool.ByValue(minValue + 1);
// TODO: remove tool from stack
// TODO: add tool back to stack when upgrading from 1/2 to 3/4
break;
}
}
break;
}
case BoardSpace.Hut:
{
// TODO: be sure to test max on food track, population, tools, resources
++player.PlayerBoard.PeopleToPlace;
++player.PlayerBoard.TotalPeople;
break;
}
case BoardSpace.Field:
{
// TODO: be sure to test max on food track, population, tools, resources
++player.PlayerBoard.FoodTrack;
break;
}
case BoardSpace.CivilizationCardSlot1:
{
player.PayingForSpace = BoardSpace.CivilizationCardSlot1;
break;
}
case BoardSpace.CivilizationCardSlot2:
{
player.PayingForSpace = BoardSpace.CivilizationCardSlot2;
break;
}
case BoardSpace.CivilizationCardSlot3:
{
player.PayingForSpace = BoardSpace.CivilizationCardSlot3;
break;
}
case BoardSpace.CivilizationCardSlot4:
{
player.PayingForSpace = BoardSpace.CivilizationCardSlot4;
break;
}
case BoardSpace.BuildingTileSlot1:
{
throw new NotImplementedException();
break;
}
case BoardSpace.BuildingTileSlot2:
{
throw new NotImplementedException();
break;
}
case BoardSpace.BuildingTileSlot3:
{
throw new NotImplementedException();
break;
}
case BoardSpace.BuildingTileSlot4:
{
throw new NotImplementedException();
break;
}
default:
{
throw new NotImplementedException();
}
}
space.ReturnToPlayer(player);
return result;
}