<commit_before>mini.Module(
	"basic/mapbuilder"
)
.requires(
	"basic/shapebuilder",
	"basic/utils",
	"engine/input",
	"engine/map/entity",
	"bloob/entities/entitytest",
	"behaviour/trait",
	"logic/bodyenhancement",
	"engine/time/tween",
	"engine/rendering/texture",
	"engine/time/timer",
	"engine/rendering/image",
	"assets/loader"
)
.defines(function(
	ShapeBuilder,
	Utils,
	Input,
	Entity,
	EntityTest,
	Trait,
	BodyEnhancement,
	Tween,
	Texture,
	Timer,
	Image,
	Loader
) {
	var MapBuilder = {
		"onLoad": function(callBack) {
			MapBuilder.__callback__ = callBack;
			return MapBuilder;
		},
		"buildParticleAt": function(world, translate, rotate, scale) {
			return Jello.BodyFactory.createBluePrint(Jello.Body)
				.world(world)
				.shape(ShapeBuilder.Shapes.Particle)
				.pointMasses(1)
				.translate(translate)
				.rotate(rotate)
				.scale(scale)
				.isKinematic(false)
				.build();
		},
		"buildGroundRectangle": function(world, upperLeft, lowerRight, rotate) {
			var groundShape = ShapeBuilder.Shapes.Cube;

			var groundBody = Jello.BodyFactory.createBluePrint(Jello.SpringBody)
				.world(world)
				.shape(groundShape)
				.pointMasses(Utils.Array.fill(0, groundShape.getVertices().length))
				.translate(upperLeft.add(lowerRight).mulFloat(0.5))
				.rotate(rotate || 0)
				.scale(lowerRight.sub(upperLeft))
				.isKinematic(false)
				.edgeSpringK(300)
				.edgeSpringDamp(20)
				.shapeSpringK(150)
				.shapeSpringDamp(15)
				.build();
			groundBody.aName = "ground";

			return groundBody;
		},
		"generateRoundShape": function(m, r, startAngle, endAngle, step, context, callback) {
			var innerAddVertex = function(i) {
				callback.call(
					context,
					m.add(
						new Jello.Vector2(
							Math.cos(-i * (Math.PI / 180)),
							Math.sin(-i * (Math.PI / 180))
						).mulFloat(r)
					)
				);
			};
			step = step || 1;
			step = Math.abs(step);
			if(startAngle < endAngle)
				for(var i = startAngle; i <= endAngle; i += step)
					innerAddVertex(i);
			else
				for(var i = startAngle; i >= endAngle; i -= step)
					innerAddVertex(i);
		},
		// Enhance given world with several bodies, etc. for testing purpose.
		"setUpTestMap": function(layer, world) {
			var particleBluePrint = Jello.BodyFactory.createBluePrint(Jello.Body)
				.world(world)
				.shape(ShapeBuilder.Shapes.Particle)
				.pointMasses(1);
			
			/*
			 *  controllable blob:
			 */
			var pb = Jello.BodyFactory.createBluePrint(Jello.PressureBody)
				.world(world)
				.shape(ShapeBuilder.Shapes.Ball)
				.pointMasses(1.0)
				.translate(new Jello.Vector2(-25, 15))
				.rotate(0)
				.scale(Jello.Vector2.One.copy().mulFloat(2.0))<commit_msg>add guard to only enhance main Layer with tests<commit_after>mini.Module(
	"basic/mapbuilder"
)
.requires(
	"basic/shapebuilder",
	"basic/utils",
	"engine/input",
	"engine/map/entity",
	"bloob/entities/entitytest",
	"behaviour/trait",
	"logic/bodyenhancement",
	"engine/time/tween",
	"engine/rendering/texture",
	"engine/time/timer",
	"engine/rendering/image",
	"assets/loader"
)
.defines(function(
	ShapeBuilder,
	Utils,
	Input,
	Entity,
	EntityTest,
	Trait,
	BodyEnhancement,
	Tween,
	Texture,
	Timer,
	Image,
	Loader
) {
	var MapBuilder = {
		"onLoad": function(callBack) {
			MapBuilder.__callback__ = callBack;
			return MapBuilder;
		},
		"buildParticleAt": function(world, translate, rotate, scale) {
			return Jello.BodyFactory.createBluePrint(Jello.Body)
				.world(world)
				.shape(ShapeBuilder.Shapes.Particle)
				.pointMasses(1)
				.translate(translate)
				.rotate(rotate)
				.scale(scale)
				.isKinematic(false)
				.build();
		},
		"buildGroundRectangle": function(world, upperLeft, lowerRight, rotate) {
			var groundShape = ShapeBuilder.Shapes.Cube;

			var groundBody = Jello.BodyFactory.createBluePrint(Jello.SpringBody)
				.world(world)
				.shape(groundShape)
				.pointMasses(Utils.Array.fill(0, groundShape.getVertices().length))
				.translate(upperLeft.add(lowerRight).mulFloat(0.5))
				.rotate(rotate || 0)
				.scale(lowerRight.sub(upperLeft))
				.isKinematic(false)
				.edgeSpringK(300)
				.edgeSpringDamp(20)
				.shapeSpringK(150)
				.shapeSpringDamp(15)
				.build();
			groundBody.aName = "ground";

			return groundBody;
		},
		"generateRoundShape": function(m, r, startAngle, endAngle, step, context, callback) {
			var innerAddVertex = function(i) {
				callback.call(
					context,
					m.add(
						new Jello.Vector2(
							Math.cos(-i * (Math.PI / 180)),
							Math.sin(-i * (Math.PI / 180))
						).mulFloat(r)
					)
				);
			};
			step = step || 1;
			step = Math.abs(step);
			if(startAngle < endAngle)
				for(var i = startAngle; i <= endAngle; i += step)
					innerAddVertex(i);
			else
				for(var i = startAngle; i >= endAngle; i -= step)
					innerAddVertex(i);
		},
		// Enhance given world with several bodies, etc. for testing purpose.
		"setUpTestMap": function(layer, world) {
			if(layer.name !== "main") {
				if(typeof MapBuilder.__callback__ == "function")
					MapBuilder.__callback__();
				return;
			}
			
			var particleBluePrint = Jello.BodyFactory.createBluePrint(Jello.Body)
				.world(world)
				.shape(ShapeBuilder.Shapes.Particle)
				.pointMasses(1);
			
			/*
			 *  controllable blob:
			 */
			var pb = Jello.BodyFactory.createBluePrint(Jello.PressureBody)
				.world(world)
				.shape(ShapeBuilder.Shapes.Ball)
				.pointMasses(1.0)
				.translate(new Jello.Vector2(-25, 15))
				.rotate(0)
				.scale(Jello.Vector2.One.copy().mulFloat(2.0))
{'fraction_non_alphanumeric': 0.14590552617180375, 'fraction_numerical': 0.012766733540032828, 'mean_word_length': 3.373205741626794, 'pattern_counts': {'":': 10, '<': 7, '<?xml version=': 0, '>': 5, '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': '776726', 'n_tokens_mistral': 2419, 'n_tokens_neox': 1948, 'n_words': 332}