本文整理汇总了C#中Map.ItemsInCavern方法的典型用法代码示例。如果您正苦于以下问题:C# Map.ItemsInCavern方法的具体用法?C# Map.ItemsInCavern怎么用?C# Map.ItemsInCavern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.ItemsInCavern方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ItPutsAnItemInItsMap
public void ItPutsAnItemInItsMap()
{
var map = new Map();
var editor = new MapEditor(map);
editor.PutInCavern("Wumpus", 1);
Assert.AreEqual(MapItems.Wumpus, map.ItemsInCavern(1)[0]);
}
示例2: ItAllowsAnotherItemWithTheWumpus
public void ItAllowsAnotherItemWithTheWumpus()
{
var map = new Map();
map.PlaceItem(1, MapItems.Wumpus);
map.PlaceItem(1, MapItems.Arrow);
Assert.IsTrue(map.HasWumpusIn(1));
Assert.AreEqual(2, map.ItemsInCavern(1).Count);
}
示例3: ItClearsTheItemsOnClear
public void ItClearsTheItemsOnClear()
{
var map = new Map();
map.PlaceItem(2, MapItems.Player);
map.PlaceItem(1, MapItems.Wumpus);
map.Clear();
Assert.AreEqual(0, map.ItemsInCavern(1).Count);
Assert.AreEqual(0, map.ItemsInCavern(2).Count);
}
示例4: ItReturnsTheListOfItemsInACavern
public void ItReturnsTheListOfItemsInACavern()
{
var map = new Map();
map.PlaceItem(1, MapItems.Arrow);
map.PlaceItem(1, MapItems.Arrow);
map.PlaceItem(1, MapItems.Wumpus);
var items = map.ItemsInCavern(1);
var expectedMapItems = new List<MapItems>
{
MapItems.Arrow,
MapItems.Arrow,
MapItems.Wumpus
};
Assert.IsTrue(items.SequenceEqual(expectedMapItems));
}
示例5: ItReturnsAnImmutableListOfItems
public void ItReturnsAnImmutableListOfItems()
{
var map = new Map();
map.PlaceItem(1, MapItems.Arrow);
var items = map.ItemsInCavern(1);
items.Add(MapItems.Player);
Assert.AreEqual(1, map.ItemsInCavern(1).Count);
}
示例6: ItReturnsAnEmptyListIfTheCavernDoesntExist
public void ItReturnsAnEmptyListIfTheCavernDoesntExist()
{
var map = new Map();
var items = map.ItemsInCavern(1);
Assert.AreEqual(0, items.Count);
}
示例7: 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]);
}
示例8: ItContinuesMovingTheArrowUntilThereAreNoMovesInThatDirection
public void ItContinuesMovingTheArrowUntilThereAreNoMovesInThatDirection()
{
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);
map.AddPath(1, 2, Command.Directions.East);
game.Command( new Command {
Order = Command.Commands.Shoot,
Direction = Command.Directions.East});
Assert.AreEqual(MapItems.Arrow, map.ItemsInCavern(2)[0]);
}