java.lang.Object
org.jgrapht.graph.DefaultEdge
com.adventure.models.nodes.StoryNodeLink
- All Implemented Interfaces:
Serializable
,Cloneable
public class StoryNodeLink
extends org.jgrapht.graph.DefaultEdge
This class represents a game graph edge.
It connects two story-nodes and represents a possible path for a player.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
Action gettergetID()
Get String ID of the edgegetKey()
Key getter.boolean
Locked getter.int
Get int ID of the edgeint
hashCode()
void
Link another action to this edgevoid
setID()
Set numericID and stringID with IdManagervoid
setID
(int ID) Set numeric and stringID with IdManager given an int IDvoid
Key setter.void
setLocked
(boolean locked) Sets flag locked.boolean
Tries to unlock the link.Methods inherited from class org.jgrapht.graph.DefaultEdge
getSource, getTarget, toString
-
Constructor Details
-
StoryNodeLink
public StoryNodeLink()Default constructor -
StoryNodeLink
public StoryNodeLink(int id) Constructor for deserialization- Parameters:
id
- id to set when creating the edge
-
-
Method Details
-
getID
Get String ID of the edge- Returns:
- String ID of the edge
-
getNumericID
public int getNumericID()Get int ID of the edge- Returns:
- int ID of the edge
-
getLocked
public boolean getLocked()Locked getter.- Returns:
- Locked flag.
-
getKey
Key getter.- Returns:
- Key.
-
getAction
Action getter- Returns:
- Action linked with this edge
-
setID
public void setID(int ID) Set numeric and stringID with IdManager given an int ID- Parameters:
ID
- int ID to set for the edge
-
setID
public void setID()Set numericID and stringID with IdManager -
setAction
Link another action to this edge- Parameters:
switchAction
- new action to link to the edge
-
setLocked
public void setLocked(boolean locked) Sets flag locked.- Parameters:
locked
- Flag value.
-
setKey
Key setter. If a key is set, then the edge is automatically locked.- Parameters:
key
- key.
-
tryUnlock
Tries to unlock the link.- Parameters:
key
- Key used to unlock.- Returns:
- True if the link was unlocked successfully, false otherwise.
-
equals
-
hashCode
public int hashCode() -
clone
-