public class SPStoryPlace extends Object
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!
Modifier and Type | Field and Description |
---|---|
protected String |
insidePlaceName |
Constructor and Description |
---|
SPStoryPlace(String name) |
SPStoryPlace(String name,
SPStoryPlace inside) |
Modifier and Type | Method and Description |
---|---|
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)
|
String |
toString()
DO NOT ALTER!
|
@XStreamAsAttribute protected String insidePlaceName
public SPStoryPlace(String name, SPStoryPlace inside)
public SPStoryPlace(String name)
protected void setInsidePlace(SPStoryPlace place)
Can't be called if insidePlace is already bound (RuntimeException).
place
- 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 navpointpublic String toString()
Used during translation into prolog!
public boolean contains(SPStoryPlace place)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.