コード例 #1
0
        public void CloneTileLayer()
        {
            TileLayer layer  = new MultiTileGridLayer("layer", 16, 24, 30, 50);
            TileLayer layer2 = layer.Clone() as TileLayer;

            Assert.AreEqual(16, layer2.TileWidth);
            Assert.AreEqual(24, layer2.TileHeight);
        }
コード例 #2
0
ファイル: LayerTests.cs プロジェクト: Jorch72/CS-Treefrog
        public void CloneLayerTest()
        {
            Layer layer = new MultiTileGridLayer("layer", 16, 16, 16, 16);

            layer.Opacity   = 0.5f;
            layer.IsVisible = false;

            Property prop = new StringProperty("author", "Justin");

            layer.CustomProperties.Add(prop);

            Layer layer2 = layer.Clone() as Layer;

            Assert.AreEqual(layer.Opacity, layer2.Opacity);
            Assert.AreEqual(layer.IsVisible, layer2.IsVisible);
            Assert.AreEqual(1, layer2.CustomProperties.Count);
            Assert.AreNotSame(prop, layer2.CustomProperties["author"]);
            Assert.AreEqual("Justin", layer2.CustomProperties["author"].ToString());
        }