vooga.engine.factory
Class MapReader

java.lang.Object
  extended by vooga.engine.factory.MapReader

public class MapReader
extends java.lang.Object

This class can be used to read in .txt files that serve as a map for placement of different Sprites. This is a unique implementation of a level.


Constructor Summary
MapReader(java.lang.String pathName, PlayField level)
          This MapReader will be instantiated by the LevelParser class if it contains a tag.
 
Method Summary
 void addAssociationClass(java.lang.String key, java.lang.String className)
           
 void addAssociationImage(java.lang.String key, java.lang.String imageName)
           
 void addAssociationItem(java.lang.String key, Item item)
           
 void loadMappedSprites(java.lang.String pathName)
           
 PlayField processMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapReader

public MapReader(java.lang.String pathName,
                 PlayField level)
This MapReader will be instantiated by the LevelParser class if it contains a tag. This tag will store all information about Sprites unique to the mapping representation of the text file. This constructor returns the PlayField that is represented by the current level from the LevelParser. This constructor will update the PlayField based on all the information in the tag.

Method Detail

addAssociationClass

public void addAssociationClass(java.lang.String key,
                                java.lang.String className)

addAssociationImage

public void addAssociationImage(java.lang.String key,
                                java.lang.String imageName)

processMap

public PlayField processMap()

loadMappedSprites

public void loadMappedSprites(java.lang.String pathName)
                       throws java.io.IOException
Throws:
java.io.IOException

addAssociationItem

public void addAssociationItem(java.lang.String key,
                               Item item)