Comment interfaces, expand the hittable interface.
This commit is contained in:
parent
2295d83ff9
commit
17aafe11f9
|
@ -2,7 +2,18 @@ package de.teamteamteam.spacescooter.entity;
|
|||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
/**
|
||||
* Interface providing everything needed for collision handling.
|
||||
*/
|
||||
public interface Collidable {
|
||||
|
||||
/**
|
||||
* Provide information about the position and dimensions of the Entity.
|
||||
*/
|
||||
public Rectangle getCollisionBox();
|
||||
|
||||
/**
|
||||
* Notify the Collidable that a collision happened.
|
||||
*/
|
||||
public void collideWith(Collidable entity);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,40 @@
|
|||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
/**
|
||||
* Interface providing everything needed to handle taking damage.
|
||||
*/
|
||||
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();
|
||||
|
||||
/**
|
||||
* Set the Hittables current health points.
|
||||
*/
|
||||
public int setHealthPoints();
|
||||
|
||||
/**
|
||||
* Get the Hittables current shield points.
|
||||
*/
|
||||
public int getShieldPoints();
|
||||
|
||||
/**
|
||||
* Set the Hittables current shield points.
|
||||
*/
|
||||
public int setShieldPoints();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,8 +2,14 @@ package de.teamteamteam.spacescooter.entity;
|
|||
|
||||
import java.awt.Graphics2D;
|
||||
|
||||
/**
|
||||
* Interface providing the paint method.
|
||||
*/
|
||||
public interface Paintable {
|
||||
|
||||
/**
|
||||
* All Paintable Entities need to implement this to paint themselves.
|
||||
*/
|
||||
public void paint(Graphics2D g);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
package de.teamteamteam.spacescooter.entity;
|
||||
|
||||
/**
|
||||
* Interface providing the update method.
|
||||
*/
|
||||
public interface Updateable {
|
||||
|
||||
/**
|
||||
* All entities are Updateable through this method.
|
||||
*/
|
||||
public void update();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue