<commit_before>﻿// <copyright file="Tile.cs" company="<NAME>">
// Copyright (c) <NAME>. All rights reserved.
// </copyright>

using System.Diagnostics;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace HoardeGame.Level
{
    /// <summary>
    /// A representation of a tile in a <see cref="DungeonLevel"/>
    /// </summary>
    public class Tile
    {
        /// <summary>
        /// Gets or sets the position of this tile in meters
        /// </summary>
        public Vector2 Position
        {
            get { return body.Position; }
            set { body.Position = value; }
        }

        /// <summary>
        /// Gets or sets the position this tile in pixels
        /// </summary>
        public Vector2 ScreenPosition
        {
            get
            {
                return ConvertUnits.ToDisplayUnits(body.Position);
            }

            set
            {
                body.Position = ConvertUnits.ToSimUnits(value);
            }
        }

        /// <summary>
        /// Gets the size of this tile
        /// </summary>
        public Vector2 Scale { get; private set; }

        /// <summary>
        /// <see cref="Body"/> representing this tile
        /// </summary>
        private readonly Body body;

        private readonly Texture2D texture;

        /// <summary>
        /// Initializes a new instance of the <see cref="Tile"/> class.
        /// </summary>
        /// <param name="pos"><see cref="Vector2"/> to place the tile on</param>
        /// <param name="scale"><see cref="Vector2"/> to use for scaling</param>
        /// <param name="texture"><see cref="Texture2D"/> of the tile</param>
        /// <param name="collide">Whether to generate collision boxes</param>
        /// <param name="world"><see cref="World"/> to place this tile in</param>
        public Tile(Vector2 pos, Vector2 scale, Texture2D texture, bool collide, World world)
        {
            Scale = scale;
            this.texture = texture;

            if (collide)
            {
                body = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(scale.X), ConvertUnits.ToSimUnits(scale.Y), 1f);
                body.IsStatic = true;
                body.Position = ConvertUnits.ToSimUnits(pos);
            }
            else
            {
                body = BodyFactory.CreateBody(world);
                body.IsStatic = true;<commit_msg>Fixed Tile collision box<commit_after>﻿// <copyright file="Tile.cs" company="<NAME>">
// Copyright (c) <NAME>. All rights reserved.
// </copyright>

using System.Diagnostics;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace HoardeGame.Level
{
    /// <summary>
    /// A representation of a tile in a <see cref="DungeonLevel"/>
    /// </summary>
    public class Tile
    {
        /// <summary>
        /// Gets or sets the position of this tile in meters
        /// </summary>
        public Vector2 Position
        {
            get { return body.Position; }
            set { body.Position = value; }
        }

        /// <summary>
        /// Gets or sets the position this tile in pixels
        /// </summary>
        public Vector2 ScreenPosition
        {
            get
            {
                return ConvertUnits.ToDisplayUnits(body.Position);
            }

            set
            {
                body.Position = ConvertUnits.ToSimUnits(value);
            }
        }

        /// <summary>
        /// Gets the size of this tile
        /// </summary>
        public Vector2 Scale { get; private set; }

        /// <summary>
        /// <see cref="Body"/> representing this tile
        /// </summary>
        private readonly Body body;

        private readonly Texture2D texture;

        /// <summary>
        /// Initializes a new instance of the <see cref="Tile"/> class.
        /// </summary>
        /// <param name="pos"><see cref="Vector2"/> to place the tile on</param>
        /// <param name="scale"><see cref="Vector2"/> to use for scaling</param>
        /// <param name="texture"><see cref="Texture2D"/> of the tile</param>
        /// <param name="collide">Whether to generate collision boxes</param>
        /// <param name="world"><see cref="World"/> to place this tile in</param>
        public Tile(Vector2 pos, Vector2 scale, Texture2D texture, bool collide, World world)
        {
            Scale = scale;
            this.texture = texture;

            if (collide)
            {
                body = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(32), ConvertUnits.ToSimUnits(32), 1f, new Vector2(0, 24));
                body.IsStatic = true;
                body.Position = ConvertUnits.ToSimUnits(pos);
            }
            else
            {
                body = BodyFactory.CreateBody(world);
                body.IsStatic = true;
{'fraction_non_alphanumeric': 0.12428260439342964, 'fraction_numerical': 0.005937067088858104, 'mean_word_length': 1.7041198501872659, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, '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': '778315', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1327, 'n_words': 377}