示例#1
0
        /// <summary>
        /// Add a new layer to the level
        /// </summary>
        private void AddNewLayer()
        {
            Layer layer = new Layer();

            for (int i = 0; i < gridW; i++)
            {
                for (int j = 0; j < gridH; j++)
                {
                    layer.AddTile(new Tile(i, j));
                }
            }
            level.AddALayer(layer);
        }
示例#2
0
        public void PrepareLevelTest()
        {
            List <Tile> tiles = new List <Tile>();

            for (int i = 0; i < 500; i++)
            {
                tiles.Add(new Tile());
            }

            Level lvl = new Level();

            lvl.AddALayer(new Layer(tiles));
            lvl.PrepareForSaving();
            Assert.AreEqual(0, lvl.Layers[0].Tiles.Count, "Level contains empty tiles");
        }