|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Screen<B extends Block<B,E>,E extends GameEntity<B,E>>
This class represents a single "screen" in the game. This given by a fixed grid of unchanging entries that specify what is to be drawn and give information on how the user is supposed to interact with it. It also has a list of objects that are in the room. This includes both the moving and non-moving entities for the game.
This class is a generic that takes the general block type and the general entity type for each game.
Method Summary | |
---|---|
void |
addEntity(E ge)
Add the specified entity to the list for this screen. |
java.util.Iterator<E> |
createEntityIterator()
Returns an Iterator object that can be used to "walk through" the list of entities on this screen. |
java.awt.Container |
editPropertiesPanel()
This method returns a panel that should be set up so that users can edit the properties of this screen. |
B |
getBlock(int x,
int y)
Returns the block at location x,y. |
B |
getBlockOfType(int type)
Takes a number between 0 and getNumBlockTypes()-1 and returns an instance of a block corresponding to that number. |
E |
getEntityOfType(int type)
Takes a number between 0 and getNumEntityTypes()-1 and returns an instance of an entity corresponding to that number. |
int |
getNumBlockTypes()
Returns the number of different blocks that the screen editor should set up for adding on this type of screen. |
int |
getNumEntityTypes()
Returns the number of different entities that the screen editor should set up for adding on this type of screen. |
java.awt.Dimension |
getSize()
This method returns how many blocks the screen is in width and height. |
void |
removeEntity(E ge)
This method searches for the specified entity in this screen and removes it if found. |
void |
setBlock(int x,
int y,
B b)
Sets the block at location x,y to be b. |
Method Detail |
---|
B getBlock(int x, int y)
x
- The x location of where you are looking.y
- The y location of where you are looking.
java.awt.Dimension getSize()
Dimension
java.util.Iterator<E> createEntityIterator()
Iterator
void addEntity(E ge)
ge
- This is the entity that is to be added to the screen.void removeEntity(E ge) throws java.util.NoSuchElementException
ge
- The GameEntity that you want to remove from this screen.
java.util.NoSuchElementException
int getNumBlockTypes()
void setBlock(int x, int y, B b)
x
- The x location to be set.y
- The y location to be set.b
- The block that you want it to be set to.B getBlockOfType(int type)
type
- The integer specifying what type to return.
int getNumEntityTypes()
E getEntityOfType(int type)
type
- The integer specifying what type to return.
java.awt.Container editPropertiesPanel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |