LynnaLab.Room.ModifiedTileCallback C# (CSharp) Method

ModifiedTileCallback() private method

private ModifiedTileCallback ( int tile ) : void
tile int
return void
        void ModifiedTileCallback(int tile)
        {
            Graphics g = null;
            if (cachedImage != null)
                g = Graphics.FromImage(cachedImage);
            for (int x=0; x<Width; x++) {
                for (int y=0; y<Height; y++) {
                    if (GetTile(x, y) == tile) {
                        if (cachedImage != null)
                            g.DrawImageUnscaled(area.GetTileImage(GetTile(x,y)), x*16, y*16);
                        if (RoomModifiedEvent != null)
                            RoomModifiedEvent();
                    }
                }
            }
            if (g != null)
                g.Dispose();
        }