Comment interfaces, expand the hittable interface.

This commit is contained in:
Jan Philipp Timme 2014-11-07 21:01:13 +01:00
parent 2295d83ff9
commit 17aafe11f9
4 changed files with 54 additions and 0 deletions

View File

@ -2,7 +2,18 @@ package de.teamteamteam.spacescooter.entity;
import java.awt.Rectangle; import java.awt.Rectangle;
/**
* Interface providing everything needed for collision handling.
*/
public interface Collidable { public interface Collidable {
/**
* Provide information about the position and dimensions of the Entity.
*/
public Rectangle getCollisionBox(); public Rectangle getCollisionBox();
/**
* Notify the Collidable that a collision happened.
*/
public void collideWith(Collidable entity); public void collideWith(Collidable entity);
} }

View File

@ -1,9 +1,40 @@
package de.teamteamteam.spacescooter.entity; package de.teamteamteam.spacescooter.entity;
/**
* Interface providing everything needed to handle taking damage.
*/
public interface Hittable { public interface Hittable {
/**
* Notify the Hittable that it took damage.
*/
public void takeDamage(int damage);
/**
* Tell whether the Hittable is still alive.
*/
public boolean isAlive();
/**
* Get the Hittables current health points.
*/
public int getHealthPoints(); public int getHealthPoints();
/**
* Set the Hittables current health points.
*/
public int setHealthPoints();
/**
* Get the Hittables current shield points.
*/
public int getShieldPoints(); public int getShieldPoints();
/**
* Set the Hittables current shield points.
*/
public int setShieldPoints();
} }

View File

@ -2,8 +2,14 @@ package de.teamteamteam.spacescooter.entity;
import java.awt.Graphics2D; import java.awt.Graphics2D;
/**
* Interface providing the paint method.
*/
public interface Paintable { public interface Paintable {
/**
* All Paintable Entities need to implement this to paint themselves.
*/
public void paint(Graphics2D g); public void paint(Graphics2D g);
} }

View File

@ -1,7 +1,13 @@
package de.teamteamteam.spacescooter.entity; package de.teamteamteam.spacescooter.entity;
/**
* Interface providing the update method.
*/
public interface Updateable { public interface Updateable {
/**
* All entities are Updateable through this method.
*/
public void update(); public void update();
} }