cz.cuni.amis.pogamut.ut2004.storyworld.place
Class SPStoryWorld

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.storyworld.place.SPStoryWorld

public class SPStoryWorld
extends java.lang.Object

TODO: CURRENTLY IT DOES NOT WORK!


Constructor Summary
SPStoryWorld(java.io.File worldXMLDefinition, IWorldView ww, java.util.logging.Logger log)
           
SPStoryWorld(SPStoryWorldData data, IWorldView ww, java.util.logging.Logger log)
           
SPStoryWorld(java.lang.String worldXMLDefinitionFile, IWorldView ww, java.util.logging.Logger log)
           
 
Method Summary
 java.util.Set<SPStoryPlaceBase> at(SPLocation location)
          Nearest navpoint must be max "NEAR" far.
protected  java.util.Map<Token,SPStoryPlace> getAllPlaces()
           
 SPStoryPlaceBase getBase(java.lang.String name)
           
 SPStoryPlaceBase getBase(Token name)
           
 java.util.Set<SPStoryPlaceBase> getBase(UnrealId navPointId)
           
 NavPoint getFurthestNavPoint(SPLocation location)
           
 FloydWarshallMap getNavigation()
           
 NavPoint getNavPoint(java.lang.String id)
           
 java.util.Set<NavPoint> getNavPoints()
          Returns places inside the virtual world.
protected  HashMapSet<UnrealId,SPStoryPlaceBase> getNavPointsToPlaceMap()
           
 NavPoint getNearestNavPoint(SPLocation location)
           
 java.util.List<NavPoint> getPath(SPLocation from, NavPoint to)
          Finds path between navpoint that is the nearest to "from" and navpoint "to".
 java.util.List<NavPoint> getPath(SPLocation from, SPLocation to)
          Finds path between navpoints that are the nearest to "from" / "to" location.
 java.util.List<NavPoint> getPath(SPLocation from, SPStoryPlace place)
          Finds shortest path between the nearest navpoint to "from" and the "place", searching all the navpoints that is contained inside the place.
 SPStoryPlace getPlace(java.lang.String name)
           
 SPStoryPlace getPlace(Token name)
           
 SPStoryWorldData getStoryWorldData()
           
 boolean isInside(SPLocation location, SPStoryPlace place)
          Returns whether 'location' belongs to the 'place'.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPStoryWorld

public SPStoryWorld(java.lang.String worldXMLDefinitionFile,
                    IWorldView ww,
                    java.util.logging.Logger log)
             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

SPStoryWorld

public SPStoryWorld(java.io.File worldXMLDefinition,
                    IWorldView ww,
                    java.util.logging.Logger log)
             throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

SPStoryWorld

public SPStoryWorld(SPStoryWorldData data,
                    IWorldView ww,
                    java.util.logging.Logger log)
Method Detail

getPlace

public SPStoryPlace getPlace(Token name)

getPlace

public SPStoryPlace getPlace(java.lang.String name)

getBase

public SPStoryPlaceBase getBase(Token name)

getNavPoint

public NavPoint getNavPoint(java.lang.String id)

getBase

public SPStoryPlaceBase getBase(java.lang.String name)

getBase

public java.util.Set<SPStoryPlaceBase> getBase(UnrealId navPointId)

at

public java.util.Set<SPStoryPlaceBase> at(SPLocation location)
Nearest navpoint must be max "NEAR" far.

Parameters:
location -
Returns:

getNearestNavPoint

public NavPoint getNearestNavPoint(SPLocation location)

getFurthestNavPoint

public NavPoint getFurthestNavPoint(SPLocation location)

isInside

public boolean isInside(SPLocation location,
                        SPStoryPlace place)
Returns whether 'location' belongs to the 'place'. Nearest navpoint must be at least 1000 close not to return false automatically.

Parameters:
location -
place -
Returns:

getNavPoints

public java.util.Set<NavPoint> getNavPoints()
Returns places inside the virtual world.

Can't be called before the definition of all story places are defined, otherwise it won't contains all places. (Lazy initialization.)

Returns:

getNavPointsToPlaceMap

protected HashMapSet<UnrealId,SPStoryPlaceBase> getNavPointsToPlaceMap()

getAllPlaces

protected java.util.Map<Token,SPStoryPlace> getAllPlaces()

getNavigation

public FloydWarshallMap getNavigation()

getPath

public java.util.List<NavPoint> getPath(SPLocation from,
                                        SPLocation to)
Finds path between navpoints that are the nearest to "from" / "to" location.

Parameters:
from -
to -
Returns:

getPath

public java.util.List<NavPoint> getPath(SPLocation from,
                                        NavPoint to)
Finds path between navpoint that is the nearest to "from" and navpoint "to".

Parameters:
from -
to -
Returns:

getPath

public java.util.List<NavPoint> getPath(SPLocation from,
                                        SPStoryPlace place)
Finds shortest path between the nearest navpoint to "from" and the "place", searching all the navpoints that is contained inside the place.

Parameters:
from -
place -
Returns:

getStoryWorldData

public SPStoryWorldData getStoryWorldData()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object