added a Entity.java class that handles position rotation and collition. collition has jet not been made.

This commit is contained in:
Ziver Koc 2007-03-13 18:37:22 +00:00
parent dbee794932
commit 0044d4fff4
17 changed files with 154 additions and 55 deletions

View file

@ -0,0 +1,103 @@
/**
*
*/
package ei.engine.scene;
import ei.engine.math.Vector2D;
import ei.engine.math.Vector2I;
/**
* This class is the root class of all the objects that
* will show on the scrren. This class handles the position
* and rotation and the colitions of the objects.
* @author Ziver
*/
public abstract class Entity {
/** The name of this sprite */
private String name;
/** The location of this entity in pixels*/
private Vector2D location;
/** The rotation of this entity in pixels*/
private Vector2D rotation;
/** The size of this entity in pixels*/
private Vector2I size;
/**
* creates a new entity
*
* @param name The name of the entity
*/
public Entity(String name){
this.name = name;
location = new Vector2D(0,0);
}
/**
* @return The name of the entity
*/
public String getName() {
return name;
}
/**
* Get the Location of the entity
*
* @return The Location of the entity
*/
public Vector2D getLocation() {
return location;
}
/**
* set the location of this entity in pixels
*
* @param l The location of the entity
*/
public void setLocation(Vector2D l) {
location = l;
}
/**
* Get the rotation of the entity
*
* @return The Location of the entity
*/
public Vector2D getRotation() {
return rotation;
}
/**
* set the rotation of this entity in pixels
*
* @param r The rotation of the entity
*/
public void setRotation(Vector2D r) {
rotation = r;
}
/**
* Get the size of the entity
*
* @return The Location of the entity
*/
public Vector2I getSize() {
return size;
}
/**
* set the size of this entity in pixels
*
* @param s The size of the entity
*/
public void setSize(Vector2I s) {
size = s;
}
/**
* the render method shuold beimplemented for every entity
*/
public abstract void render();
}