本文整理汇总了C#中Map.PlaceItem方法的典型用法代码示例。如果您正苦于以下问题:C# Map.PlaceItem方法的具体用法?C# Map.PlaceItem怎么用?C# Map.PlaceItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.PlaceItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: ItCanSayIfItAHasAnArrowInACavern
public void ItCanSayIfItAHasAnArrowInACavern()
{
var map = new Map();
Assert.IsFalse(map.HasArrowIn(1));
map.PlaceItem(1, MapItems.Arrow);
Assert.IsTrue(map.HasArrowIn(1));
}
示例3: ItCanSayIfItAHasAWumpusInACavern
public void ItCanSayIfItAHasAWumpusInACavern()
{
var map = new Map();
Assert.IsFalse(map.HasWumpusIn(1));
map.PlaceItem(1, MapItems.Wumpus);
Assert.IsTrue(map.HasWumpusIn(1));
}
示例4: 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());
}
示例5: 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();
}
示例6: 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();
}
示例7: ItAnnouncesGameOverOnPlayerDeath
public void ItAnnouncesGameOverOnPlayerDeath()
{
var presenter = Substitute.For<Presenter>();
var map = new Map();
var game = new Game(presenter, map);
game.SetPlayerQuiver(1);
map.PlaceItem(0, MapItems.Player);
game.Command(new Command
{
Direction = Command.Directions.East,
Order = Command.Commands.Shoot
});
presenter.Received().GameOver();
}
示例8: ItAnnouncesTheArrowKilledThePlayerIfHeShootsAWall
public void ItAnnouncesTheArrowKilledThePlayerIfHeShootsAWall()
{
var presenter = Substitute.For<Presenter>();
var map = new Map();
var game = new Game(presenter, map);
game.SetPlayerQuiver(1);
map.PlaceItem(0, MapItems.Player);
game.Command(new Command
{
Direction = Command.Directions.East,
Order = Command.Commands.Shoot
});
presenter.Received().Suicide();
}
示例9: 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);
}
示例10: 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);
}
示例11: ItOnlyAllowsOneWumpus
public void ItOnlyAllowsOneWumpus()
{
var map = new Map();
map.PlaceItem(1, MapItems.Wumpus);
map.PlaceItem(2, MapItems.Wumpus);
Assert.IsFalse(map.HasWumpusIn(1));
Assert.IsTrue(map.HasWumpusIn(2));
}
示例12: ItMovesThePlayerIfThePlayerIsPlacedAgain
public void ItMovesThePlayerIfThePlayerIsPlacedAgain()
{
var map = new Map();
map.PlaceItem(0, MapItems.Player);
map.PlaceItem(1, MapItems.Player);
Assert.AreEqual(1, map.PlayersCurrentCavern());
}
示例13: ItSetsTheGameToOverOnPlayerDeath
public void ItSetsTheGameToOverOnPlayerDeath()
{
var presenter = Substitute.For<Presenter>();
var map = new Map();
var game = new Game(presenter, map);
game.SetPlayerQuiver(1);
map.PlaceItem(0, MapItems.Player);
Assert.IsFalse(game.IsOver());
game.Command(new Command
{
Direction = Command.Directions.East,
Order = Command.Commands.Shoot
});
Assert.IsTrue(game.IsOver());
}
示例14: 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]);
}
示例15: ItReturnsThePlayersCurrentCavernIfThereIsOne
public void ItReturnsThePlayersCurrentCavernIfThereIsOne()
{
var map = new Map();
map.PlaceItem(1, MapItems.Player);
Assert.AreEqual(1, map.PlayersCurrentCavern());
}