|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.trinity.cs.gamecore.basic.BasicScreen
public class BasicScreen
This class is a very basic implementation of the Screen interface. You will write your own, but this one is included for the first assignment.
Constructor Summary | |
---|---|
BasicScreen()
|
|
BasicScreen(int sx,
int sy)
|
Method Summary | |
---|---|
void |
addEntity(BasicEntity ge)
Add the specified entity to the list for this screen. |
java.util.Iterator<BasicEntity> |
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. |
BasicBlock |
getBlock(int x,
int y)
Returns the block at location x,y. |
BasicBlock |
getBlockOfType(int type)
Takes a number between 0 and getNumBlockTypes()-1 and returns an instance of a block corresponding to that number. |
BasicEntity |
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(BasicEntity ge)
This method searches for the specified entity in this screen and removes it if found. |
void |
setBlock(int x,
int y,
BasicBlock b)
Sets the block at location x,y to be b. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicScreen()
public BasicScreen(int sx, int sy)
Method Detail |
---|
public BasicBlock getBlock(int x, int y)
Screen
getBlock
in interface Screen<BasicBlock,BasicEntity>
x
- The x location of where you are looking.y
- The y location of where you are looking.
public java.awt.Dimension getSize()
Screen
getSize
in interface Screen<BasicBlock,BasicEntity>
Dimension
public int getNumBlockTypes()
Screen
getNumBlockTypes
in interface Screen<BasicBlock,BasicEntity>
public int getNumEntityTypes()
Screen
getNumEntityTypes
in interface Screen<BasicBlock,BasicEntity>
public void setBlock(int x, int y, BasicBlock b)
Screen
setBlock
in interface Screen<BasicBlock,BasicEntity>
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.public BasicBlock getBlockOfType(int type)
Screen
getBlockOfType
in interface Screen<BasicBlock,BasicEntity>
type
- The integer specifying what type to return.
public BasicEntity getEntityOfType(int type)
Screen
getEntityOfType
in interface Screen<BasicBlock,BasicEntity>
type
- The integer specifying what type to return.
public void addEntity(BasicEntity ge)
Screen
addEntity
in interface Screen<BasicBlock,BasicEntity>
ge
- This is the entity that is to be added to the screen.public void removeEntity(BasicEntity ge) throws java.util.NoSuchElementException
Screen
removeEntity
in interface Screen<BasicBlock,BasicEntity>
ge
- The GameEntity that you want to remove from this screen.
java.util.NoSuchElementException
public java.awt.Container editPropertiesPanel()
Screen
editPropertiesPanel
in interface Screen<BasicBlock,BasicEntity>
public java.util.Iterator<BasicEntity> createEntityIterator()
createEntityIterator
in interface Screen<BasicBlock,BasicEntity>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |