public void TestInitializer() { Trace.WriteLine("Creating default map..."); map = new Map(new Size(100, 100), 1, MapGenerator.Grass); Trace.WriteLine("Generating terrain..."); mapGen = new MapGenerator(map); Assert.IsInstanceOfType(map, typeof(Map), "Failed to initialize map."); Assert.IsInstanceOfType(mapGen, typeof(MapGenerator), "Failed to initialize the map generator."); }
public void TestInitializer() { Trace.WriteLine("Creating default map..."); map = new Map(new Size(5, 5), 1, MapGenerator.Grass); Trace.WriteLine("Creating default player..."); player = new Player(map.Layers.First(), new Point(5)); Trace.WriteLine("Creating default mob..."); sword = new Item("Test sword", 5, 10, 1.5, 1, EquipSlot.Attack); Assert.IsInstanceOfType(map, typeof(Map), "Failed to initialize map."); Assert.IsInstanceOfType(player, typeof(Player), "Failed to initialize player."); Assert.IsInstanceOfType(sword, typeof(Item), "Failed to initialize item."); }
public void TestInitializer() { Trace.WriteLine("Creating default map..."); map = new Map(new Size(100, 100), 1, MapGenerator.Grass); Trace.WriteLine("Creating default player..."); player = new Player(map.Layers.First(), new Point(50, 50)); Trace.WriteLine("Creating default mob..."); mob = new Mob("TestMob", map.Layers.First(), new Point(1, 1), null, null, 2, 1, 0, 15, 'M', ConsoleColor.Black, MobType.Orc); Assert.IsInstanceOfType(map, typeof(Map), "Failed to initialize the map."); Assert.IsInstanceOfType(player, typeof(Player), "Failed to initiaze the player."); Assert.IsInstanceOfType(mob, typeof(Mob), "Failed to initialize the mob."); }
public MapGenerator(Map map) { this.Map = map; for (int i = 0; i < map.Depth; ++i) this.Generate(map[i]); }