|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.ut2004.storyworld.place.SPStoryPlace
public class SPStoryPlace
Basic interface for all story places.
Contains two methods that provides a means to create hierarchical description of places.
(Kitchen is in House that is in the City that is in the Czech Republic...)
We don't support changing the story-place-graph at runtime!
Field Summary | |
---|---|
protected java.lang.String |
insidePlaceName
|
Constructor Summary | |
---|---|
SPStoryPlace(java.lang.String name)
|
|
SPStoryPlace(java.lang.String name,
SPStoryPlace inside)
|
Method Summary | |
---|---|
boolean |
contains(SPStoryPlace place)
|
boolean |
equals(java.lang.Object obj)
|
SPLocation |
getCenter()
|
NavPoint |
getCenterNavPoint()
|
java.util.Set<SPStoryPlace> |
getContainsAllPlaces()
Returns all places that are inside this one. |
java.util.Set<SPStoryPlace> |
getContainsPlaces()
Returns set with places this one contains (not recursive!). |
NavPoint |
getFurthestNavPoint(SPLocation location)
|
java.util.Set<SPStoryPlace> |
getHigherPlaces()
Returns set of all places this one is a part of. |
SPStoryPlace |
getInsidePlace()
Returns the place that this one is a part. |
java.lang.String |
getInsidePlaceName()
Returns name of the place this one is inside. |
Token |
getName()
|
java.util.Map<NavPoint,java.lang.Double> |
getNavPointDistances(SPLocation location)
|
java.util.Map<java.lang.Double,NavPoint> |
getNavPointDistancesSwapped(SPLocation location)
|
java.util.Set<NavPoint> |
getNavPoints()
Returns places inside the virtual world that belongs to this place. |
java.util.List<NavPoint> |
getNavPointsList()
Returns places inside the virtual world that belongs to this place. |
NavPoint |
getNearestNavPoint(SPLocation location)
|
NavPoint |
getRandomNavPoint()
|
NavPoint |
getRandomNavPoint(SPLocation location,
double distance)
|
int |
hashCode()
|
protected void |
setInsidePlace(SPStoryPlace place)
Used to inject the insidePlace after construction with "name" only (needed because the xml definition may be written the way it needs to be processed twiced, 1) create SPStoryPlaces, 2) inject inside) |
java.lang.String |
toString()
DO NOT ALTER! |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@XStreamAsAttribute protected java.lang.String insidePlaceName
Constructor Detail |
---|
public SPStoryPlace(java.lang.String name, SPStoryPlace inside)
public SPStoryPlace(java.lang.String name)
Method Detail |
---|
protected void setInsidePlace(SPStoryPlace place)
Can't be called if insidePlace is already bound (RuntimeException).
place
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Token getName()
public SPStoryPlace getInsidePlace()
If null - that means it's the highest
public java.lang.String getInsidePlaceName()
public java.util.Set<SPStoryPlace> getHigherPlaces()
(You may ask whether this Kitchen in Czech Republic
Can't be called before the definition of all places is completed otherwise it won't contain all higher places! (Lazy initialization.)
public java.util.Set<SPStoryPlace> getContainsPlaces()
public java.util.Set<SPStoryPlace> getContainsAllPlaces()
Can't be called before the definition of all story places are defined, otherwise it won't contains all places. (Lazy initialization.)
public java.util.Set<NavPoint> getNavPoints()
Can't be called before the definition of all story places are defined, otherwise it won't contains all places. (Lazy initialization.)
public java.util.List<NavPoint> getNavPointsList()
Can't be called before the definition of all story places are defined, otherwise it won't contains all places. (Lazy initialization.)
public SPLocation getCenter()
public NavPoint getCenterNavPoint()
public NavPoint getRandomNavPoint()
public NavPoint getNearestNavPoint(SPLocation location)
public NavPoint getFurthestNavPoint(SPLocation location)
public java.util.Map<NavPoint,java.lang.Double> getNavPointDistances(SPLocation location)
public java.util.Map<java.lang.Double,NavPoint> getNavPointDistancesSwapped(SPLocation location)
public NavPoint getRandomNavPoint(SPLocation location, double distance)
distance
- must be <0,1> ... 0 ~ pick from all possible navpoint, 1 ~ pick the furthest navpoint
public java.lang.String toString()
Used during translation into prolog!
toString
in class java.lang.Object
public boolean contains(SPStoryPlace place)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |