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


C# Map.AddPath方法代码示例

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


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

示例1: ItCantMoveThePlayerWhenThereIsNoPlayer

        public void ItCantMoveThePlayerWhenThereIsNoPlayer()
        {
            var map = new Map();
            map.AddPath(0, 1, Command.Directions.South);

            map.MovePlayer(Command.Directions.South);

            Assert.IsNull(map.PlayersCurrentCavern());
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:9,代码来源:MapTest.cs

示例2: ItCantMoveThePlayerAnInvalidDirection

        public void ItCantMoveThePlayerAnInvalidDirection()
        {
            var map = new Map();
            map.AddPath(0, 1, Command.Directions.East);
            map.PlaceItem(0, MapItems.Player);

            map.MovePlayer(Command.Directions.South);

            Assert.AreEqual(0, map.PlayersCurrentCavern());
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:10,代码来源:MapTest.cs

示例3: ItAnnouncesNoArrowsIfThePlayerHasNone

        public void ItAnnouncesNoArrowsIfThePlayerHasNone()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);

            map.AddPath(0, 1, Command.Directions.East);
            map.PlaceItem(0, MapItems.Player);

            game.Command(new Command {
                Direction = Command.Directions.East,
                Order = Command.Commands.Shoot});

            presenter.Received().OutOfArrows();
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:15,代码来源:GameTest.cs

示例4: ItAnnouncesTheArrowWasShot

        public void ItAnnouncesTheArrowWasShot()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);
            game.SetPlayerQuiver(1);

            map.PlaceItem(0, MapItems.Player);
            map.AddPath(0, 1, Command.Directions.East);

            game.Command(new Command {
                Direction = Command.Directions.East,
                Order = Command.Commands.Shoot});

            presenter.Received().ArrowWasFired();
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:16,代码来源:GameTest.cs

示例5: ItRetrievesItsHighestNumberedCavern

        public void ItRetrievesItsHighestNumberedCavern()
        {
            var map = new Map();

            map.AddPath(3, 4, Command.Directions.East);
            map.PlaceItem(2, MapItems.Player);

            Assert.AreEqual(4, map.MaxCavern);
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:9,代码来源:MapTest.cs

示例6: ItStoresItsLowestNumberedCavern

        public void ItStoresItsLowestNumberedCavern()
        {
            var map = new Map();

            map.AddPath(3, 4, Command.Directions.East);
            map.PlaceItem(2, MapItems.Player);

            Assert.AreEqual(2, map.MinCavern);
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:9,代码来源:MapTest.cs

示例7: ItDoesntClearThePathsOnClear

        public void ItDoesntClearThePathsOnClear()
        {
            var map = new Map();

            map.AddPath(0, 1, Command.Directions.East);

            map.Clear();

            Assert.AreEqual(Command.Directions.East, map.AvailableMoves(0)[0]);
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:10,代码来源:MapTest.cs

示例8: ItDoesntMistakeAnEmptyCaveForAWumpus

        public void ItDoesntMistakeAnEmptyCaveForAWumpus()
        {
            var map = new Map();
            map.AddPath(0, 1, Command.Directions.West);

            Assert.IsFalse(map.HasWumpusIn(0));
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:7,代码来源:MapTest.cs

示例9: ItAnnouncesTheNumberOfArrowsWhenThePlayerHasOne

        public void ItAnnouncesTheNumberOfArrowsWhenThePlayerHasOne()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);

            map.AddPath(0, 1, Command.Directions.West);
            map.PlaceItem(0, MapItems.Player);
            map.PlaceItem(1, MapItems.Arrow);

            game.Command(new Command {
                Direction = Command.Directions.West,
                Order = Command.Commands.Go});

            presenter.Received().DisplayArrowStatus(1);
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:16,代码来源:GameTest.cs

示例10: ItDetectsIfTheMapHasAPlayer

        public void ItDetectsIfTheMapHasAPlayer()
        {
            var map = new Map();

            map.AddPath(0, 1, Command.Directions.West);
            map.PlaceItem(0, MapItems.Player);

            Assert.IsTrue(map.HasPlayer());
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:9,代码来源:MapTest.cs

示例11: ItAnnouncesWhenYouCanSmellTheWumpus

        public void ItAnnouncesWhenYouCanSmellTheWumpus()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);

            map.AddPath(0, 1, Command.Directions.West);
            map.AddPath(1, 2, Command.Directions.South);
            map.PlaceItem(0, MapItems.Player);
            map.PlaceItem(2, MapItems.Wumpus);

            game.Command(new Command {
                Direction = Command.Directions.West,
                Order = Command.Commands.Go
                });

            presenter.Received().WumpusCanSeeYou();
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:18,代码来源:GameTest.cs

示例12: ItAnnouncesWhenAPlayerFindsAnArrow

        public void ItAnnouncesWhenAPlayerFindsAnArrow()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);

            map.AddPath(0, 1, Command.Directions.North);
            map.PlaceItem(0, MapItems.Player);
            map.PlaceItem(1, MapItems.Arrow);
            game.Command(new Command{ Order = Command.Commands.Go,
                                      Direction = Command.Directions.North});

            presenter.Received().FoundAnArrow();
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:14,代码来源:GameTest.cs

示例13: KillWumpus

        protected void KillWumpus(Game game, Map map)
        {
            game.SetPlayerQuiver(1);

            map.PlaceItem(0, MapItems.Player);
            map.PlaceItem(2, MapItems.Wumpus);
            map.AddPath(0, 1, Command.Directions.East);
            map.AddPath(0, 2, Command.Directions.East);

            game.Command(new Command
                             {
                                 Direction = Command.Directions.East,
                                 Order = Command.Commands.Shoot
                             });
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:15,代码来源:GameTest.cs

示例14: ItMovesAnArrowInTheCommandedDirection

        public void ItMovesAnArrowInTheCommandedDirection()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);
            game.SetPlayerQuiver(1);

            map.PlaceItem(0, MapItems.Player);
            map.AddPath(0, 1, Command.Directions.East);

            game.Command(new Command {
                Direction = Command.Directions.East,
                Order = Command.Commands.Shoot});

            Assert.AreEqual(MapItems.Arrow, map.ItemsInCavern(1)[0]);
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:16,代码来源:GameTest.cs

示例15: ItDoesntShootIfThePlayerHasNoArrows

        public void ItDoesntShootIfThePlayerHasNoArrows()
        {
            var presenter = Substitute.For<Presenter>();
            var map = new Map();
            var game = new Game(presenter, map);

            map.AddPath(0, 1, Command.Directions.East);
            map.PlaceItem(0, MapItems.Player);

            game.Command(new Command {
                Direction = Command.Directions.East,
                Order = Command.Commands.Shoot
            });

            presenter.DidNotReceive().ArrowWasFired();
            Assert.AreEqual(0, map.ArrowsInCavern(1));
        }
开发者ID:paytonrules,项目名称:HuntTheWumpus,代码行数:17,代码来源:GameTest.cs


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