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


C# GameState.RegressTimeTracker方法代码示例

本文整理汇总了C#中FuryOfDracula.GameLogic.GameState.RegressTimeTracker方法的典型用法代码示例。如果您正苦于以下问题:C# GameState.RegressTimeTracker方法的具体用法?C# GameState.RegressTimeTracker怎么用?C# GameState.RegressTimeTracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FuryOfDracula.GameLogic.GameState的用法示例。


在下文中一共展示了GameState.RegressTimeTracker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PlayLongDay

 /// <summary>
 /// Resolves the Long Day Event
 /// </summary>
 /// <param name="game">The GameState</param>
 /// <param name="hunterPlayingEvent">The Hunter playing the Event</param>
 private static void PlayLongDay(GameState game, Hunter hunterPlayingEvent)
 {
     if (game.TimeOfDay == TimeOfDay.Dawn)
     {
         Console.WriteLine("You cannot play this card during Dawn. Take the card back.");
         var longDayCard = game.EventDiscard.Find(card => card.Event == Event.LongDay);
         game.Hunters[(int)hunterPlayingEvent].EventsKnownToDracula.Add(longDayCard);
         game.EventDiscard.Remove(longDayCard);
         game.Hunters[(int)hunterPlayingEvent].DrawEventCard();
         return;
     }
     game.RegressTimeTracker();
 }
开发者ID:UncleGus,项目名称:dracula,代码行数:18,代码来源:Program.cs

示例2: EndHunterTurn

        /// <summary>
        /// Allows Dracula to take his turn
        /// </summary>
        /// <param name="game">The GameState</param>
        /// <param name="logic">The artificial intelligence component</param>
        private static void EndHunterTurn(GameState game, DecisionMaker logic)
        {
            game.AdvanceTimeTracker();
            logic.UpdateStrategy(game);
            bool firstMove = true;
            var power = Power.None;
            Location destination;
            destination = logic.ChooseDestinationAndPower(game, out power);

            var catacombsSlotsCleared = logic.ChooseWhichCatacombsCardsToDiscard(game, destination);
            if (catacombsSlotsCleared.Count() > 0)
            {
                Console.Write("Dracula discarded cards from Catacombs positions: ");
                foreach (var i in catacombsSlotsCleared)
                {
                    Console.Write("{0} ", i + 1);
                }
                Console.WriteLine("");
                game.Dracula.DiscardCatacombsCards(game, catacombsSlotsCleared);
            }
            if (game.DraculaAlly != null && game.DraculaAlly.Event == Event.QuinceyPMorris)
            {
                var victim = logic.ChooseVictimForQuinceyPMorris(game);
                Console.WriteLine("Dracula is targetting {0} with Quincey P. Morris", victim.Name());
                Console.WriteLine("What Item does {0} have? 0= Nothing, 1= Crucifix, 2= Heavenly Host", victim.Name());
                var answer = -1;
                while (answer == -1)
                {
                    if (int.TryParse(Console.ReadLine(), out answer))
                    {
                        if (answer < 0 || answer > 2)
                        {
                            answer = -1;
                        }
                    }
                }
                switch (answer)
                {
                    case 0:
                        Console.WriteLine("{0} loses 1 health", victim.Name());
                        game.Hunters[(int)victim].AdjustHealth(-1);
                        CheckForHunterDeath(game); break;
                    case 1:
                        Console.WriteLine("Health loss cancelled");
                        AddItemCardToDraculaKnownCardsIfNotAlreadyKnown(game, game.Hunters[(int)victim], Item.Crucifix); break;
                    case 2:
                        Console.WriteLine("Health loss cancelled");
                        AddItemCardToDraculaKnownCardsIfNotAlreadyKnown(game, game.Hunters[(int)victim], Item.HeavenlyHost); break;
                }
            }
            var eventPlayed = Event.None;
            var numberOfMoves = 1;
            do
            {
                var devilishPowerTarget = DevilishPowerTarget.None;
                var roadBlock1 = Location.Nowhere;
                var roadBlock2 = Location.Nowhere;
                var roadBlockType = ConnectionType.None;
                eventPlayed = logic.ChooseEventCardToPlayAtStartOfDraculaTurn(game, out devilishPowerTarget,
                    out roadBlock1, out roadBlock2, out roadBlockType);
                if (eventPlayed != Event.None)
                {
                    Console.WriteLine("Dracula played {0}", eventPlayed.Name());
                    game.Dracula.DiscardEvent(eventPlayed, game.EventDiscard);
                    if (HunterPlayingGoodLuckToCancelDraculaEvent(game, eventPlayed, eventPlayed, logic) > 0)
                    {
                        Console.WriteLine("{0} cancelled", eventPlayed.Name());
                    }
                    else
                    {
                        switch (eventPlayed)
                        {
                            case Event.DevilishPower:
                                switch (devilishPowerTarget)
                                {
                                    case DevilishPowerTarget.HeavenlyHost1:
                                        Console.WriteLine("Heavenly Host discarded from {0}", game.HeavenlyHostLocation1);
                                        game.HeavenlyHostLocation1 = Location.Nowhere; break;
                                    case DevilishPowerTarget.HeavenlyHost2:
                                        Console.WriteLine("Heavenly Host discarded from {0}", game.HeavenlyHostLocation2);
                                        game.HeavenlyHostLocation2 = Location.Nowhere; break;
                                    case DevilishPowerTarget.HunterAlly:
                                        Console.WriteLine("{0} discarded from play", game.HunterAlly.Event.Name());
                                        game.EventDiscard.Add(game.HunterAlly);
                                        game.HunterAlly = null; break;
                                }
                                break;
                            case Event.UnearthlySwiftness:
                                numberOfMoves = 2; break;
                            case Event.TimeRunsShort:
                                game.RegressTimeTracker(); break;
                            case Event.Roadblock:
                                game.RoadBlockLocation1 = roadBlock1;
                                game.RoadBlockLocation2 = roadBlock2;
                                game.RoadBlockConnectionType = roadBlockType;
//.........这里部分代码省略.........
开发者ID:UncleGus,项目名称:dracula,代码行数:101,代码来源:Program.cs


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