org.molwind.view
Class AbstractTile

java.lang.Object
  extended by org.molwind.view.AbstractTile
All Implemented Interfaces:
Tile

public abstract class AbstractTile
extends java.lang.Object
implements Tile

AbstractTile holds the entities visible on the tile.

Version:
1.0
Author:
Oliver Karch

Constructor Summary
protected AbstractTile(LayeredPosition newPosition)
           
 
Method Summary
 void addEntities(java.util.Iterator it)
          Adds entities to this tile.
protected  java.awt.image.BufferedImage getEmptyImage()
           
 int getEntityCount()
          Returns the number of entities on this tile.
 java.util.Iterator getEntityIterator()
          Returns an iterator over the entities of this tile.
 java.lang.String getImageType()
          Get the ImageType value.
 LayeredPosition getPosition()
          Get the Position value.
 void setImageType(java.lang.String newImageType)
          Set the ImageType value.
 void setPosition(LayeredPosition newPosition)
          Set the Position value.
abstract  void writeTo(java.io.OutputStream output)
          Writes the tile's image to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTile

protected AbstractTile(LayeredPosition newPosition)
Method Detail

getEmptyImage

protected java.awt.image.BufferedImage getEmptyImage()

getImageType

public java.lang.String getImageType()
Get the ImageType value.

Returns:
the ImageType value

setImageType

public void setImageType(java.lang.String newImageType)
Set the ImageType value.

Parameters:
newImageType - the new ImageType value

writeTo

public abstract void writeTo(java.io.OutputStream output)
                      throws java.io.IOException
Writes the tile's image to the given output stream.

Specified by:
writeTo in interface Tile
Parameters:
output - the output stream
Throws:
java.io.IOException - is thrown upon i/o error

getPosition

public LayeredPosition getPosition()
Get the Position value.

Returns:
the Position value

setPosition

public void setPosition(LayeredPosition newPosition)
Set the Position value.

Parameters:
newPosition - the new Position value

addEntities

public void addEntities(java.util.Iterator it)
Adds entities to this tile.

Parameters:
it - a collection of entities

getEntityIterator

public java.util.Iterator getEntityIterator()
Returns an iterator over the entities of this tile.

Returns:
an entity iterator

getEntityCount

public int getEntityCount()
Returns the number of entities on this tile.

Returns:
the number of entities


Copyright © 2008-2010. All Rights Reserved.