edu.trinity.cs.gamecore
Interface PriorityQueue<B extends Block<B,E>,E extends GameEntity<B,E>>

All Known Implementing Classes:
ListBasedPriorityQueue

public interface PriorityQueue<B extends Block<B,E>,E extends GameEntity<B,E>>

The PriorityQueue interface is used to keep track of which entities should be updated in any given time step. This general API can be implemented in a number of different ways that provide different levels of performance.

This class is a generic that takes the general block type and the general entity type for each game.


Method Summary
 void add(E ge)
          This method adds a GameEntity into the queue.
 E getFirst()
          This method should return the first entity in the queue.
 void removeFirst()
          This method removes the first entity from the queue assuming one is present.
 

Method Detail

add

void add(E ge)
This method adds a GameEntity into the queue. It calls the getUpdateTime() method of the GameEntity to determine where it should be placed in the queue.

Parameters:
ge - The game entity to be added.

removeFirst

void removeFirst()
This method removes the first entity from the queue assuming one is present.


getFirst

E getFirst()
This method should return the first entity in the queue. Notice that it does not remove it. A separate call to removeFirst must be made to remove the item from the queue.

Returns:
The first GameEntity in the queue or null if the queue is empty.