当前位置: 首页>>代码示例>>C#>>正文


C# Space.ReturnToPlayer方法代码示例

本文整理汇总了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;
        }
开发者ID:immeraufdemhund,项目名称:StoneAge,代码行数:101,代码来源:Game.cs


注:本文中的Space.ReturnToPlayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。