|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.udk.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 String |
insidePlaceName
|
Constructor Summary | |
---|---|
SPStoryPlace(String name)
|
|
SPStoryPlace(String name,
SPStoryPlace inside)
|
Method Summary | |
---|---|
boolean |
contains(SPStoryPlace place)
|
boolean |
equals(Object obj)
|
SPLocation |
getCenter()
|
NavPoint |
getCenterNavPoint()
|
Set<SPStoryPlace> |
getContainsAllPlaces()
Returns all places that are inside this one. |
Set<SPStoryPlace> |
getContainsPlaces()
Returns set with places this one contains (not recursive!). |
NavPoint |
getFurthestNavPoint(SPLocation location)
|
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. |
String |
getInsidePlaceName()
Returns name of the place this one is inside. |
cz.cuni.amis.utils.token.Token |
getName()
|
Map<NavPoint,Double> |
getNavPointDistances(SPLocation location)
|
Map<Double,NavPoint> |
getNavPointDistancesSwapped(SPLocation location)
|
Set<NavPoint> |
getNavPoints()
Returns places inside the virtual world that belongs to this place. |
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) Can't be called if insidePlace is already bound (RuntimeException). |
String |
toString()
DO NOT ALTER! |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@XStreamAsAttribute protected String insidePlaceName
Constructor Detail |
---|
public SPStoryPlace(String name, SPStoryPlace inside)
public SPStoryPlace(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 Object
public boolean equals(Object obj)
equals
in class Object
public cz.cuni.amis.utils.token.Token getName()
public SPStoryPlace getInsidePlace()
If null - that means it's the highest
public String getInsidePlaceName()
public 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 Set<SPStoryPlace> getContainsPlaces()
public 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 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 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 Map<NavPoint,Double> getNavPointDistances(SPLocation location)
public Map<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 String toString()
Used during translation into prolog!
toString
in class Object
public boolean contains(SPStoryPlace place)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |