package net.alcuria.umbracraft.engine.entities;

import net.alcuria.umbracraft.Game;
import net.alcuria.umbracraft.engine.components.AnimationComponent;
import net.alcuria.umbracraft.engine.components.InputComponent;
import net.alcuria.umbracraft.engine.components.PhysicsComponent;
import net.alcuria.umbracraft.engine.events.CameraTargetEvent;
import net.alcuria.umbracraft.engine.map.Map;

import com.badlogic.gdx.Gdx;

/** The EntityCreator is responsible for instantiating various game objects
 * (players, etc) to be used by the {@link EntityManager}
 * @author Andrew Keturi */
public class EntityCreator {

	/** @param map
	 * @return A player {@link Entity} */
	public static Entity player(final Map map) {
		Entity player = new Entity();
		/*
		 * new BaseComponent() { private TextureRegion character; private
		 * TextureRegion shadow;
		 *
		 * @Override public void create() { character = new
		 * TextureRegion(Game.assets( ).get("sprites/andoru.png",
		 * Texture.class), 16, 27); shadow = new TextureRegion
		 * (Game.assets().get("sprites/shadow.png", Texture.class), 16, 16); }
		 *
		 * @Override public void dispose() {
		 *
		 * }
		 *
		 * @Override public void render(Entity object) {
		 * Game.batch().draw(shadow, object.position.x - 1, object.position.y -
		 * 6 + 16 * map.getAltitudeAt(object.position.x / 16, object.position.y
		 * / 16)); Game.batch().draw(character, object.position.x,
		 * object.position.y + object.altitude); }
		 *
		 * @Override public void update(Entity object) {
		 *
		 * } }
		 */
		// input
		final InputComponent input = new InputComponent();
		Gdx.input.setInputProcessor(input);
		player.addComponent(input);
		player.addComponent(new PhysicsComponent(map));
		player.addComponent(new AnimationComponent(Game.db().anim("Spin")));
		Game.publisher().publish(new CameraTargetEvent(player));
		return player;
	}
}

@@ -549,16 +549,81 @@
 Manager%7D
+. TODO: perhaps read%0A * all these entity definitions from a file.
 %0A * @aut
@@ -650,16 +650,22 @@
 %0Apublic 
+final 
 class En
@@ -816,810 +816,8 @@
 ();%0A
-%09%09/*%0A%09%09 * new BaseComponent() %7B private TextureRegion character; private%0A%09%09 * TextureRegion shadow;%0A%09%09 *%0A%09%09 * @Override public void create() %7B character = new%0A%09%09 * TextureRegion(Game.assets( ).get(%22sprites/andoru.png%22,%0A%09%09 * Texture.class), 16, 27); shadow = new TextureRegion%0A%09%09 * (Game.assets().get(%22sprites/shadow.png%22, Texture.class), 16, 16); %7D%0A%09%09 *%0A%09%09 * @Override public void dispose() %7B%0A%09%09 *%0A%09%09 * %7D%0A%09%09 *%0A%09%09 * @Override public void render(Entity object) %7B%0A%09%09 * Game.batch().draw(shadow, object.position.x - 1, object.position.y -%0A%09%09 * 6 + 16 * map.getAltitudeAt(object.position.x / 16, object.position.y%0A%09%09 * / 16)); Game.batch().draw(character, object.position.x,%0A%09%09 * object.position.y + object.altitude); %7D%0A%09%09 *%0A%09%09 * @Override public void update(Entity object) %7B%0A%09%09 *%0A%09%09 * %7D %7D%0A%09%09 */%0A%09%09// input%0A
 %09%09fi
@@ -1132,11 +1132,42 @@
 ayer;%0A%09%7D
+%0A%0A%09private EntityCreator() %7B%0A%09%7D
 %0A%7D%0A

Clean up creator