コード例 #1
0
        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.");
        }
コード例 #2
0
ファイル: ItemTest.cs プロジェクト: Hyftar/ZodFortress
        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.");
        }
コード例 #3
0
        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.");
        }
コード例 #4
0
ファイル: MapGenerator.cs プロジェクト: Hyftar/ZodFortress
 public MapGenerator(Map map)
 {
     this.Map = map;
     for (int i = 0; i < map.Depth; ++i)
         this.Generate(map[i]);
 }