Move passenger-handling to Entity

This commit is contained in:
Erik Broes 2011-03-29 23:09:05 +02:00
parent 9baed69563
commit 57b1b50610
2 changed files with 30 additions and 30 deletions

View File

@ -109,4 +109,34 @@ public interface Entity {
* @return Server instance running this Entity * @return Server instance running this Entity
*/ */
public Server getServer(); public Server getServer();
/**
* Gets the primary passenger of a vehicle. For vehicles that could have
* multiple passengers, this will only return the primary passenger.
*
* @return an entity
*/
public abstract Entity getPassenger();
/**
* Set the passenger of a vehicle.
*
* @param passenger
* @return false if it could not be done for whatever reason
*/
public abstract boolean setPassenger(Entity passenger);
/**
* Returns true if the vehicle has no passengers.
*
* @return
*/
public abstract boolean isEmpty();
/**
* Eject any passenger. True if there was a passenger.
*
* @return
*/
public abstract boolean eject();
} }

View File

@ -21,34 +21,4 @@ public interface Vehicle extends Entity {
* @param vel velocity vector * @param vel velocity vector
*/ */
public void setVelocity(Vector vel); public void setVelocity(Vector vel);
/**
* Gets the primary passenger of a vehicle. For vehicles that could have
* multiple passengers, this will only return the primary passenger.
*
* @return an entity
*/
public Entity getPassenger();
/**
* Set the passenger of a vehicle.
*
* @param passenger
* @return false if it could not be done for whatever reason
*/
public boolean setPassenger(Entity passenger);
/**
* Returns true if the vehicle has no passengers.
*
* @return
*/
public boolean isEmpty();
/**
* Eject any passenger. True if there was a passenger.
*
* @return
*/
public boolean eject();
} }