Interface Block

All Known Implementing Classes:
BasicBlock

public interface Block
extends Serializable

This interface will be implemented for any class that should represent a
block on a screen in the game. They basically provide a background upon
which the player interacts with things.


Method Summary
 ContainergetEditPropertiesPanel()
          This method returns a panel that should be set up so that users can
edit the properties of this block.
 ImagegetImage()
          This returns the image that should be drawn for this block.
 LocationgetLinkLocation()
          Returns the location that this block links to.
 voidsetLinkLocation(Location location)
          Sets the location that this block links to.

Method Detail

getEditPropertiesPanel

public Container getEditPropertiesPanel()
This method returns a panel that should be set up so that users can
edit the properties of this block. Block properties can be used to
reduce the number of block types that you create if you have many blocks
in your game that server very similar functions. The returned value can
be any java.awt.Container though I recommend that you use javax.swing.JPanel.
The properties for blocks don't have to include link locations because
the screen editor handles those in another way.
Returns: A Container with a GUI set up for editing properties. If there are no editable properties it should return null.

getImage

public Image getImage()
This returns the image that should be drawn for this block. What is
returned will be scaled to the size of one block for drawing. Note that
blocks will not properly display animations.
Returns: The image that is to be drawn for this block.

getLinkLocation

public Location getLinkLocation()
Returns the location that this block links to. When an entity that
follows links moves onto a block with a link it will be "transported"
to that location. If a given type of block should never have a link
from it, this can simply return null.
Returns: The location this block links to or null if no link.

setLinkLocation

public void setLinkLocation(Location location)
Sets the location that this block links to. Some blocks can ignore this
if they don't support linking.
Parameters:
location The location the block should link to.