public void Level_DecoratedOnce_LevelIsOne() { // Arrange ICharacter character = new Character(); // Act character = new BarbarianDecorator(character); // Assert Assert.AreEqual(1, character.Level); }
public void Level_DecoratedTwiceWithDifferentClasses_LevelIsTwo() { // Arrange ICharacter character = new Character(); // Act character = new WizardDecorator(character); character = new BarbarianDecorator(character); // Assert Assert.AreEqual(2, character.Level); }
public void Classes_DecoratedOnce_ShowsCorrectClass() { // Arrange ICharacter character = new Character(); // Act character = new BarbarianDecorator(character); // Assert Assert.AreEqual(1, character.Classes.Count()); Assert.AreEqual(1, character.Classes.Count(x => x.Name == "Barbarian")); }
public void Classes_DecoratedTwiceWithDifferentClasses_ShowsCorrectClasses() { // Arrange ICharacter character = new Character(); // Act character = new WizardDecorator(character); character = new BarbarianDecorator(character); // Assert Assert.AreEqual(2, character.Classes.Count()); Assert.AreEqual(1, character.Classes.Count(x => x.Name == "Wizard")); Assert.AreEqual(1, character.Classes.Count(x => x.Name == "Barbarian")); }
public void PaintWorld(WorldLayer layer) { var players = Hud.Game.Players.Where(player => player.CoordinateKnown && (player.HeadStone == null)); foreach (var player in players) { if (player.IsMe) { MeDecorator.Paint(layer, null, player.FloorCoordinate, null); } else { switch (player.HeroClassDefinition.HeroClass) { case HeroClass.Wizard: WizardDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.WitchDoctor: WitchDoctorDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.Barbarian: BarbarianDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.DemonHunter: DemonHunterDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.Crusader: CrusaderDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.Monk: MonkDecorator.Paint(layer, null, player.FloorCoordinate, null); break; case HeroClass.Necromancer: NecDecorator.Paint(layer, null, player.FloorCoordinate, null); break; } } } }