<commit_before>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using Sphere.Core.Utility;

namespace Sphere.Core
{
    /// <summary>
    /// A Sphere Tile object.
    /// </summary>
    public class Tile
    {
        private Bitmap _graphic;

        /// <summary>
        /// Creates a tile object, from an existing image.
        /// </summary>
        /// <param name="image">System.Drawing.Image object to use.</param>
        public Tile(Bitmap image)
        {
            Obstructions = new List<Line>();
            Width = image.Width;
            Height = image.Height;
            _graphic = image;
        }

        /// <summary>
        /// Create's a new tile object.
        /// </summary>
        /// <param name="width">The width of the tile.</param>
        /// <param name="height">The height of the tile.</param>
        public Tile(int width, int height)
        {
            Obstructions = new List<Line>();
            Name = "";
            Width = width;
            Height = height;
            _graphic = new Bitmap(width, height, PixelFormat.Format32bppPArgb);
            using (Graphics g = Graphics.FromImage(_graphic))
            {
                g.FillRectangle(Brushes.Black, new Rectangle(0, 0, width, height));
            }
        }

        /// <summary>
        /// Gets or sets the width of the tile in pixels.
        /// </summary>
        public int Width { get; set; }

        /// <summary>
        /// Gets or sets the height of the tile in pixels.
        /// </summary><commit_msg>Hotfix for tileset saving crash<commit_after>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using Sphere.Core.Utility;

namespace Sphere.Core
{
    /// <summary>
    /// A Sphere Tile object.
    /// </summary>
    public class Tile
    {
        private Bitmap _graphic;

        /// <summary>
        /// Creates a tile object, from an existing image.
        /// </summary>
        /// <param name="image">System.Drawing.Image object to use.</param>
        public Tile(Bitmap image)
        {
            Obstructions = new List<Line>();
            Name = "";
            Width = image.Width;
            Height = image.Height;
            _graphic = image;
        }

        /// <summary>
        /// Create's a new tile object.
        /// </summary>
        /// <param name="width">The width of the tile.</param>
        /// <param name="height">The height of the tile.</param>
        public Tile(int width, int height)
        {
            Obstructions = new List<Line>();
            Name = "";
            Width = width;
            Height = height;
            _graphic = new Bitmap(width, height, PixelFormat.Format32bppPArgb);
            using (Graphics g = Graphics.FromImage(_graphic))
            {
                g.FillRectangle(Brushes.Black, new Rectangle(0, 0, width, height));
            }
        }

        /// <summary>
        /// Gets or sets the width of the tile in pixels.
        /// </summary>
        public int Width { get; set; }

        /// <summary>
        /// Gets or sets the height of the tile in pixels.
        /// </summary>
{'fraction_non_alphanumeric': 0.1268262356232515, 'fraction_numerical': 0.0024867889337892445, 'mean_word_length': 1.553968253968254, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3055034', 'n_tokens_mistral': 889, 'n_tokens_neox': 856, 'n_words': 258}