Class WebVertex
- java.lang.Object
-
- com.runemate.game.api.hybrid.location.navigation.web.WebVertex
-
- All Implemented Interfaces:
Locatable
,SerializableVertex
,Usable
,java.io.Serializable
- Direct Known Subclasses:
CoordinateVertex
,NpcVertex
,ObjectVertex
,TeleportVertex
,UtilityVertex
public abstract class WebVertex extends java.lang.Object implements SerializableVertex, Locatable, Usable
A vertex for use in a Web- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AVATAR
static java.lang.String
AVATAR_POS
static java.lang.String
GAMEOBJECT_CACHE
static java.lang.String
INDEX_IN_STEPS
static java.lang.String
ITEM_CACHE
static java.lang.String
NPC_CACHE
static java.lang.String
PREFERS_VIEWPORT
static java.lang.String
PREVIOUS
static java.lang.String
REACHABLE
static java.lang.String
REGION
static java.lang.String
REGION_BASE
static java.lang.String
STEPS
-
Constructor Summary
Constructors Constructor Description WebVertex(@NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements)
WebVertex(@NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements, java.util.Collection<WebRequirement> mustFulfillNoneOfRequirements)
WebVertex(@NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements, java.util.Collection<WebRequirement> mustFulfillNoneOfRequirements, int protocol, java.io.ObjectInput stream)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBidirectionalEdge(WebVertex target)
Adds a bidirectional edge between this vertex and the target with a weight equaling the value returned by {code WebVertex#getDefaultWeightTo(WebVertex)}void
addBidirectionalEdge(WebVertex target, double weight)
Adds a bidirectional edge with the specified weight between this vertex and the target.void
addDirectedEdge(WebVertex target)
Adds a directed edge with a weight equaling the value returned by {code WebVertex#getDefaultWeightTo(WebVertex)}void
addDirectedEdge(WebVertex target, double weight)
Adds a directed edge with the specified weightboolean
equals(java.lang.Object o)
Area.Rectangular
getArea()
The coordinate area occupied on the world-graphjava.util.Collection<WebRequirement>
getBlockingConditions()
Deprecated.static double
getDefaultWeightBetween(WebVertex first, WebVertex second)
Calculates the weight between twoWebVertex
s using the default algorithmdouble
getDefaultWeightTo(WebVertex target)
Calculates the default weight that would be used between this vertex and the target vertexCoordinate.HighPrecision
getHighPrecisionPosition()
The exact coordinate position of this entity on the region-graph (accurate to hundreds of units per tile)java.lang.Double
getInputCost(WebVertex vertex)
java.util.Map<WebVertex,java.lang.Double>
getInputCosts()
java.util.Collection<WebVertex>
getInputs()
java.lang.Double
getOutputCost(WebVertex vertex)
java.util.Map<WebVertex,java.lang.Double>
getOutputCosts()
java.util.Collection<WebVertex>
getOutputs()
@NonNull Coordinate
getPosition()
The exact coordinate position of this entity on the world-graphjava.util.Collection<WebRequirement>
getRequirements()
abstract int
hashCode()
boolean
isIsolated()
boolean
isUsable()
Determines if the web vertex can be traversed over because all of its requirements are met.boolean
removeBidirectionalEdge(WebVertex target)
Removed a directional edge that exists between this vertex and the target vertex.boolean
removeDirectedEdge(WebVertex target)
Removes an edge from this vertex to the target vertex, including the output edge from this vertex and the input edge for the target vertex.void
removeEdges()
Removes all edges that all connected to this vertex.abstract boolean
step()
abstract boolean
step(boolean prefersViewport)
void
substitute(Web web, WebVertex vertex, double cost)
java.lang.String
toString()
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Locatable
distanceTo, distanceTo, getLocalPosition
-
Methods inherited from interface com.runemate.game.api.hybrid.location.navigation.web.vertex_types.SerializableVertex
deserialize, getOpcode, serialize
-
-
-
-
Field Detail
-
PREVIOUS
public static final java.lang.String PREVIOUS
- See Also:
- Constant Field Values
-
STEPS
public static final java.lang.String STEPS
- See Also:
- Constant Field Values
-
AVATAR
public static final java.lang.String AVATAR
- See Also:
- Constant Field Values
-
REGION
public static final java.lang.String REGION
- See Also:
- Constant Field Values
-
REACHABLE
public static final java.lang.String REACHABLE
- See Also:
- Constant Field Values
-
REGION_BASE
public static final java.lang.String REGION_BASE
- See Also:
- Constant Field Values
-
AVATAR_POS
public static final java.lang.String AVATAR_POS
- See Also:
- Constant Field Values
-
INDEX_IN_STEPS
public static final java.lang.String INDEX_IN_STEPS
- See Also:
- Constant Field Values
-
NPC_CACHE
public static final java.lang.String NPC_CACHE
- See Also:
- Constant Field Values
-
GAMEOBJECT_CACHE
public static final java.lang.String GAMEOBJECT_CACHE
- See Also:
- Constant Field Values
-
ITEM_CACHE
public static final java.lang.String ITEM_CACHE
- See Also:
- Constant Field Values
-
PREFERS_VIEWPORT
public static final java.lang.String PREFERS_VIEWPORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WebVertex
public WebVertex(@NonNull @NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements, java.util.Collection<WebRequirement> mustFulfillNoneOfRequirements)
-
WebVertex
public WebVertex(@NonNull @NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements)
-
WebVertex
public WebVertex(@NonNull @NonNull Coordinate position, java.util.Collection<WebRequirement> mustFulfillAnyOfRequirements, java.util.Collection<WebRequirement> mustFulfillNoneOfRequirements, int protocol, java.io.ObjectInput stream)
-
-
Method Detail
-
getDefaultWeightBetween
public static double getDefaultWeightBetween(WebVertex first, WebVertex second)
Calculates the weight between twoWebVertex
s using the default algorithm
-
addBidirectionalEdge
public final void addBidirectionalEdge(WebVertex target)
Adds a bidirectional edge between this vertex and the target with a weight equaling the value returned by {code WebVertex#getDefaultWeightTo(WebVertex)}
-
addBidirectionalEdge
public final void addBidirectionalEdge(WebVertex target, double weight)
Adds a bidirectional edge with the specified weight between this vertex and the target.
-
addDirectedEdge
public void addDirectedEdge(WebVertex target, double weight)
Adds a directed edge with the specified weight
-
addDirectedEdge
public final void addDirectedEdge(WebVertex target)
Adds a directed edge with a weight equaling the value returned by {code WebVertex#getDefaultWeightTo(WebVertex)}
-
getDefaultWeightTo
public double getDefaultWeightTo(WebVertex target)
Calculates the default weight that would be used between this vertex and the target vertex
-
getInputCost
public java.lang.Double getInputCost(WebVertex vertex)
-
getInputCosts
public java.util.Map<WebVertex,java.lang.Double> getInputCosts()
-
getInputs
public java.util.Collection<WebVertex> getInputs()
-
getOutputCost
public java.lang.Double getOutputCost(WebVertex vertex)
-
getOutputCosts
public java.util.Map<WebVertex,java.lang.Double> getOutputCosts()
-
getOutputs
public java.util.Collection<WebVertex> getOutputs()
-
getPosition
@NonNull public final @NonNull Coordinate getPosition()
Description copied from interface:Locatable
The exact coordinate position of this entity on the world-graph- Specified by:
getPosition
in interfaceLocatable
- Returns:
- The coordinate position, or null if unavailable
-
getHighPrecisionPosition
@NonNull public final Coordinate.HighPrecision getHighPrecisionPosition()
Description copied from interface:Locatable
The exact coordinate position of this entity on the region-graph (accurate to hundreds of units per tile)- Specified by:
getHighPrecisionPosition
in interfaceLocatable
-
getArea
@NonNull public Area.Rectangular getArea()
Description copied from interface:Locatable
The coordinate area occupied on the world-graph
-
getRequirements
public final java.util.Collection<WebRequirement> getRequirements()
-
getBlockingConditions
@Deprecated public final java.util.Collection<WebRequirement> getBlockingConditions()
Deprecated.
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isIsolated
public boolean isIsolated()
-
isUsable
public final boolean isUsable()
Determines if the web vertex can be traversed over because all of its requirements are met.
-
removeBidirectionalEdge
public final boolean removeBidirectionalEdge(WebVertex target)
Removed a directional edge that exists between this vertex and the target vertex.- Parameters:
target
- the vertex to to disconnect this vertex from
-
removeDirectedEdge
public final boolean removeDirectedEdge(WebVertex target)
Removes an edge from this vertex to the target vertex, including the output edge from this vertex and the input edge for the target vertex.- Parameters:
target
- the vertex to remove the edge towards.
-
removeEdges
public final void removeEdges()
Removes all edges that all connected to this vertex.
-
step
public abstract boolean step()
-
step
public abstract boolean step(boolean prefersViewport)
-
-