<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Box2D.XNA;
using Microsoft.Xna.Framework;
using Configuration;

namespace Squircle
{
    public enum LevelElementType
    {
        Wall,
        Ground
    }

    public class LevelElementInfo
    {
        public LevelElementType type { get; set; }
    }

    public class LevelGenerator
    {
        private List<Body> bodyList = new List<Body>();
        public Level level { get; set; }

        private struct EdgeInfo
        {
            public EdgeShape shape;
            public bool isVertical;
        }

        public LevelGenerator(Level level)
        {
            this.level = level;
        }

        public List<Body> generateLevel()
        {
            String pathToCollisionFile = level.levelConfig.GlobalSection["collision"];

            var vertices = new Vector2[4];

            var startPointsStatic = new List<Vector2>();
            var startPointsDynamic = new List<Vector2>();

            var grays = new List<Vector2>();

            var map = new Bitmap(pathToCollisionFile);

            for (int x = 0; x < map.Size.Width; ++x)
            {
                for (int y = 0; y < map.Size.Height; ++y)
                {
                    var pixel = map.GetPixel(x, y);
                    if (isRed(pixel))
                    {
                        startPointsStatic.Add(new Vector2(x, y));
                    }
                    if (isGreen(pixel))
                    {
                        startPointsDynamic.Add(new Vector2(x, y));
                    }
                }
            }

            foreach (var startPoint in startPointsDynamic)
            {
                vertices = GetVertices(map, startPoint);
                var bodyDef = new BodyDef();
                bodyDef.type = BodyType.Dynamic;

                bodyDef.angle = 0;
                bodyDef.position = level.ConvertToBox2D(startPoint);
                bodyDef.inertiaScale = 1.0f;

                var body = level.World.CreateBody(bodyDef);

                var polygon = new PolygonShape();
                polygon.Set(vertices, vertices.Length);

                var fixture = new FixtureDef();
                fixture.restitution = 0.7f;
                fixture.shape = polygon;
                body.CreateFixture(fixture);

                bodyList.Add(body);
            }

            foreach (var startPoint in startPointsStatic)
            {
                vertices = GetVertices(map, startPoint);
                var bodyDef = new BodyDef();
                bodyDef.type = BodyType.Static;

                bodyDef.angle = 0;
                bodyDef.position = level.ConvertToBox2D(startPoint);

                var body = level.World.CreateBody(bodyDef);

                var edges = new List<EdgeInfo>();

                if (vertices.Length < 2)<commit_msg>Remove dead code<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Box2D.XNA;
using Microsoft.Xna.Framework;
using Configuration;

namespace Squircle
{
    public enum LevelElementType
    {
        Wall,
        Ground
    }

    public class LevelElementInfo
    {
        public LevelElementType type { get; set; }
    }

    public class LevelGenerator
    {
        private List<Body> bodyList = new List<Body>();
        public Level level { get; set; }

        private struct EdgeInfo
        {
            public EdgeShape shape;
            public bool isVertical;
        }

        public LevelGenerator(Level level)
        {
            this.level = level;
        }

        public List<Body> generateLevel()
        {
            String pathToCollisionFile = level.levelConfig.GlobalSection["collision"];

            var vertices = new Vector2[4];

            var startPointsStatic = new List<Vector2>();

            var grays = new List<Vector2>();

            var map = new Bitmap(pathToCollisionFile);

            for (int x = 0; x < map.Size.Width; ++x)
            {
                for (int y = 0; y < map.Size.Height; ++y)
                {
                    var pixel = map.GetPixel(x, y);
                    if (isRed(pixel))
                    {
                        startPointsStatic.Add(new Vector2(x, y));
                    }
                }
            }

            foreach (var startPoint in startPointsStatic)
            {
                vertices = GetVertices(map, startPoint);
                var bodyDef = new BodyDef();
                bodyDef.type = BodyType.Static;

                bodyDef.angle = 0;
                bodyDef.position = level.ConvertToBox2D(startPoint);

                var body = level.World.CreateBody(bodyDef);

                var edges = new List<EdgeInfo>();

                if (vertices.Length < 2)
{'fraction_non_alphanumeric': 0.08695652173913043, 'fraction_numerical': 0.00612369871402327, 'mean_word_length': 1.4305555555555556, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 16, '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': '4321414', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1222, 'n_words': 311}