Пример #1
0
        public static TextLayer CompileLayer(TextLayer layer)
        {
            char[][] data = layer.Data;
            char[][] flippeddata;
            if (layer.XYView)
            {
                flippeddata = new char[data.Length][];
                for (int j = 0; j < data.Length; j++)
                {
                    flippeddata [0] = new char[data [0].Length];
                }

                for (int k = 0; k < data.Length; k++)
                {
                    for (int l = data [0].Length - 1; l >= 0; l--)
                    {
                        int x = k;
                        int y = data [0].Length - 1;
                        y -= l;
                        flippeddata [x] [y] = data [k] [l];
                    }
                }
            }
            else
            {
                flippeddata = data;
            }

            TextLayer nLayer = new TextLayer(layer.Width, layer.Height, layer.xyView);
            TextMap   nMap   = new TextMap(flippeddata);

            nLayer.AppendMap(nMap);
            return(nLayer);
        }
Пример #2
0
        protected override TextMap internalClone()
        {
            TextLayer tl = new TextLayer(Width, Height);
            TextMap   tm = base.internalClone();

            tl.AppendMap(tm);
            return(tl);
        }
Пример #3
0
        /// <summary>
        /// Merges this layer with another layer
        /// </summary>
        /// <returns>The merged layer</returns>
        /// <param name="other">Other layer</param>
        /// <param name="isOtherTop">If set to <c>true</c>, the other one is on top</param>
        public TextLayer MergeLayer(TextLayer other, bool isOtherTop)
        {
            TextLayer clone = (TextLayer)Clone();

            if (isOtherTop)
            {
                clone.AppendMap(other);
            }
            else
            {
                TextLayer result = (TextLayer)(other.Clone());
                result.AppendMap(clone);
                clone = result;
            }
            return(clone);
        }