|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Libraries.layouts.DefaultLayoutNode
public class DefaultLayoutNode
| Field Summary | |
|---|---|
Room |
associatedRoom
|
long[] |
coord
|
java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> |
links
|
| Constructor Summary | |
|---|---|
DefaultLayoutNode(long[] coord)
|
|
DefaultLayoutNode(long x,
long y)
|
|
| Method Summary | |
|---|---|
long[] |
coord()
Returns x,y coordinates of this node. |
void |
crossLink(AreaGenerationLibrary.LayoutNode to)
Uses this nodes coordinates, as well as the coordinates of the given connected node, this method will create a link between them of the appropriate direction see delLink(LayoutNode) |
void |
deLink()
Removes all links from other nodes to this one, and removes all links from this node to others. |
void |
delLink(AreaGenerationLibrary.LayoutNode linkNode)
Removes all directional links between this node and the given node. |
void |
flag(AreaGenerationLibrary.LayoutFlags flag)
Flags this node with one of the visual layout flags, telling whether it is at an intersection, or on a corner, or something like that. |
void |
flagRun(AreaGenerationLibrary.LayoutRuns run)
Flags this node as being part of a street-like run. |
java.lang.String |
getColorRepresentation(char roomChar,
int line)
Returns one line of a 3x3 character representation. |
AreaGenerationLibrary.LayoutRuns |
getFlagRuns()
Return whether this node is flagged as being part of a street-like run. |
AreaGenerationLibrary.LayoutNode |
getLink(int d)
Returns a link from this node in the given direction. |
boolean |
isFlagged(AreaGenerationLibrary.LayoutFlags flag)
Returns whether this node is flagged with one of the visual layout flags, telling whether it is an intersectino, or on a corner, or something like that. |
boolean |
isStreetLike()
Returns true if the first two linked nodes to this node are in the same general direction, this making this node look like a street node. |
java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> |
links()
Returns a map of directions to other layoutnodes. |
void |
reType(AreaGenerationLibrary.LayoutTypes type)
Sets the layout type flag that this node represents, denoting whether it is a leaf, a street, or some other role. |
Room |
room()
Returns the room object assigned to this node. |
void |
setExits(int[] dirs)
Sets the exit available link directions, without setting the nodes they are linked to -- what good is this? Well, it sets the LayoutTags.NODEEXITS string, which makes some sense I guess. |
void |
setRoom(Room room)
Sets the room object assigned to this node. |
java.util.Map<AreaGenerationLibrary.LayoutTags,java.lang.String> |
tags()
Returns comma-delimited values of each LayoutTag type, through a may of layouttag to string mapping. |
java.lang.String |
toString()
|
AreaGenerationLibrary.LayoutTypes |
type()
Returns the layout type flag that this node represents, denoting whether it is a leaf, a street, or some other role. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public long[] coord
public Room associatedRoom
public java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> links
| Constructor Detail |
|---|
public DefaultLayoutNode(long[] coord)
public DefaultLayoutNode(long x,
long y)
| Method Detail |
|---|
public Room room()
AreaGenerationLibrary.LayoutNode
room in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutNode.setRoom(Room)public void setRoom(Room room)
AreaGenerationLibrary.LayoutNode
setRoom in interface AreaGenerationLibrary.LayoutNoderoom - the room object assigned to this node.AreaGenerationLibrary.LayoutNode.room()public long[] coord()
AreaGenerationLibrary.LayoutNode
coord in interface AreaGenerationLibrary.LayoutNodepublic java.util.Map<AreaGenerationLibrary.LayoutTags,java.lang.String> tags()
AreaGenerationLibrary.LayoutNode
tags in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutTagspublic java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> links()
AreaGenerationLibrary.LayoutNode
links in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutNode.deLink(),
AreaGenerationLibrary.LayoutNode.getLink(int)public void crossLink(AreaGenerationLibrary.LayoutNode to)
AreaGenerationLibrary.LayoutNode
crossLink in interface AreaGenerationLibrary.LayoutNodeto - the node to connect this one to.AreaGenerationLibrary.LayoutNode.getLink(int),
AreaGenerationLibrary.LayoutNode.links(),
AreaGenerationLibrary.LayoutNode.deLink()public boolean isFlagged(AreaGenerationLibrary.LayoutFlags flag)
AreaGenerationLibrary.LayoutNode
isFlagged in interface AreaGenerationLibrary.LayoutNodeflag - the flag to check for
public AreaGenerationLibrary.LayoutRuns getFlagRuns()
AreaGenerationLibrary.LayoutNode
getFlagRuns in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutRunspublic void delLink(AreaGenerationLibrary.LayoutNode linkNode)
AreaGenerationLibrary.LayoutNode
delLink in interface AreaGenerationLibrary.LayoutNodelinkNode - the node to de-link from.AreaGenerationLibrary.LayoutNode.getLink(int),
AreaGenerationLibrary.LayoutNode.links(),
AreaGenerationLibrary.LayoutNode.deLink()public AreaGenerationLibrary.LayoutNode getLink(int d)
AreaGenerationLibrary.LayoutNode
getLink in interface AreaGenerationLibrary.LayoutNoded - the direction code
AreaGenerationLibrary.LayoutNode.links(),
AreaGenerationLibrary.LayoutNode.deLink()public boolean isStreetLike()
AreaGenerationLibrary.LayoutNode
isStreetLike in interface AreaGenerationLibrary.LayoutNodepublic void deLink()
AreaGenerationLibrary.LayoutNode
deLink in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutNode.links(),
AreaGenerationLibrary.LayoutNode.getLink(int)public java.lang.String toString()
toString in class java.lang.Objectpublic void flag(AreaGenerationLibrary.LayoutFlags flag)
AreaGenerationLibrary.LayoutNode
flag in interface AreaGenerationLibrary.LayoutNodeflag - the flag to set.public void flagRun(AreaGenerationLibrary.LayoutRuns run)
AreaGenerationLibrary.LayoutNode
flagRun in interface AreaGenerationLibrary.LayoutNoderun - the direction of the runAreaGenerationLibrary.LayoutRunspublic AreaGenerationLibrary.LayoutTypes type()
AreaGenerationLibrary.LayoutNode
type in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutTypespublic void setExits(int[] dirs)
AreaGenerationLibrary.LayoutNode
setExits in interface AreaGenerationLibrary.LayoutNodedirs - the array of Direction codes to set.public void reType(AreaGenerationLibrary.LayoutTypes type)
AreaGenerationLibrary.LayoutNode
reType in interface AreaGenerationLibrary.LayoutNodetype - the type of this nodeAreaGenerationLibrary.LayoutTypes
public java.lang.String getColorRepresentation(char roomChar,
int line)
AreaGenerationLibrary.LayoutNode
getColorRepresentation in interface AreaGenerationLibrary.LayoutNoderoomChar - the char to use for this roomline - which line, 0, 1, or 2
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||