/**
 * 
 */
package authoring.panel;

import engine.Entity;
import javafx.beans.property.SimpleStringProperty;

/**
 * @author Elliott Bolzan
 *
 */
public class EntityWrapper {
	
	private SimpleStringProperty name;
	private SimpleStringProperty imagePath;
	private Entity entity;

	/**
	 * PROERTIES ARE SET BUT NOT ENTITIES
	 */
	public EntityWrapper(Entity entity) {
		this.entity = entity;
		name = new SimpleStringProperty(entity.getName());
		imagePath = new SimpleStringProperty(entity.getImagePath());
	}
	
	public SimpleStringProperty getName() {
		return name;
	}

	public void setName(SimpleStringProperty name) {
		this.name = name;
		//entity.setName(name.get());
	}

	public SimpleStringProperty getImagePath() {
		return imagePath;
	}

	public void setImagePath(SimpleStringProperty imagePath) {
		this.imagePath = imagePath;
		//entity.setImagePath(imagePath.get());
	}

	public Entity getEntity() {
		return entity;
	}

	public void setEntity(Entity entity) {
		this.entity = entity;
	}

}

/**
 * 
 */
package authoring.panel;

import engine.Entity;
import javafx.beans.property.SimpleStringProperty;

/**
 * @author Elliott Bolzan
 *
 */
public class EntityWrapper {

	private SimpleStringProperty name;
	private SimpleStringProperty imagePath;
	private Entity entity;

	/**
	 * 
	 */
	public EntityWrapper(Entity entity) {
		this.entity = entity;
		name = new SimpleStringProperty(entity.getName());
		imagePath = new SimpleStringProperty(entity.getImagePath());
		name.addListener((observable, oldValue, newValue) -> this.entity.setName(newValue));
		imagePath.addListener((observable, oldValue, newValue) -> this.entity.setImagePath(newValue));
	}

	public SimpleStringProperty getName() {
		return name;
	}

	public SimpleStringProperty getImagePath() {
		return imagePath;
	}
	
	public Entity getEntity() {
		return entity;
	}

}

Update the Entity when it's Wrapper is updated.
Update the Entity when it's Wrapper is updated.
