Пример #1
0
        public bool compare(ColorPixel obj1)
        {
            ColorPixel p1     = this;
            ColorPixel p2     = obj1;
            bool       result = false;

            if (p1.Identified == p2.Identified)
            {
                result = true;
            }

            return(result);
        }
Пример #2
0
        private ColorPixel[,] createMatrix(int x, int y)
        {
            ColorPixel[,] result = new ColorPixel[this.height_cell, this.width_cell];

            for (int r = 0; r < this.height_cell; r++)
            {
                for (int c = 0; c < this.width_cell; c++)
                {
                    result[r, c] = ColorPixel.create(this.matrix[r + y, c + x].Identified);
                }
            }

            return(result);
        }
Пример #3
0
        public static WorldMap restore(int[,] map, List <Tile> list, int col, int row)
        {
            ColorPixel[,] matrix = new ColorPixel[row * 16, col *16];

            for (int r = 0; r < row; r++)
            {
                for (int c = 0; c < col; c++)
                {
                    int  value = map[r, c];
                    Tile tile  = list[map[r, c]];
                    for (int height = 0; height < 16; height++)
                    {
                        for (int width = 0; width < 16; width++)
                        {
                            matrix[r * 16 + height, c * 16 + width] = tile.Matrix[height, width];
                        }
                    }
                }
            }

            return(new WorldMap(matrix, col * 16, row * 16));
        }