示例#1
0
        public TextureGrid CreateDeepCopy()
        {
            var retval = new TextureGrid(FormattingMetaData.CreateCopy(),
                                         TextureTileFormattingMetaData.CreateCopy())
            {
                X           = X,
                Y           = Y,
                Width       = Width,
                Height      = Height,
                AnchorX     = AnchorX,
                AnchorY     = AnchorY,
                CellWidth   = CellWidth,
                CellHeight  = CellHeight,
                CellSpacing = CellSpacing,
                MatcherType = MatcherType,
                Pattern     = Pattern,
                Name        = Name,
            };

            foreach (var tile in Tiles)
            {
                retval.Tiles.Add(tile.CreateDeepCopy());
            }

            foreach (var m in CellMappings)
            {
                retval.CellMappings.Add(m.CreateCopy());
            }

            return(retval);
        }
示例#2
0
        public TileTextureCollection CreateDeepCopy()
        {
            var retval = new TileTextureCollection(FormattingMetaData.CreateCopy());

            foreach (var g in Grids)
            {
                retval.Grids.Add(g.CreateDeepCopy());
            }

            return(retval);
        }