AreaGenerationLibrary.LayoutNodepublic class DefaultLayoutNode extends java.lang.Object implements AreaGenerationLibrary.LayoutNode
| Modifier and Type | Field | Description | 
|---|---|---|
| Room | associatedRoom | |
| long[] | coord | |
| java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> | links | 
| Constructor | Description | 
|---|---|
| DefaultLayoutNode(long[] coord) | |
| DefaultLayoutNode(long x,
                 long y) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| 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. | 
public long[] coord
public Room associatedRoom
public java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> links
public DefaultLayoutNode(long[] coord)
public DefaultLayoutNode(long x,
                         long y)
public Room room()
AreaGenerationLibrary.LayoutNoderoom in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutNode.setRoom(Room)public void setRoom(Room room)
AreaGenerationLibrary.LayoutNodesetRoom in interface AreaGenerationLibrary.LayoutNoderoom - the room object assigned to this node.AreaGenerationLibrary.LayoutNode.room()public long[] coord()
AreaGenerationLibrary.LayoutNodecoord in interface AreaGenerationLibrary.LayoutNodepublic java.util.Map<AreaGenerationLibrary.LayoutTags,java.lang.String> tags()
AreaGenerationLibrary.LayoutNodetags in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutTagspublic java.util.Map<java.lang.Integer,AreaGenerationLibrary.LayoutNode> links()
AreaGenerationLibrary.LayoutNodelinks in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutNode.deLink(), 
AreaGenerationLibrary.LayoutNode.getLink(int)public void crossLink(AreaGenerationLibrary.LayoutNode to)
AreaGenerationLibrary.LayoutNodecrossLink 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.LayoutNodeisFlagged in interface AreaGenerationLibrary.LayoutNodeflag - the flag to check forpublic AreaGenerationLibrary.LayoutRuns getFlagRuns()
AreaGenerationLibrary.LayoutNodegetFlagRuns in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutRunspublic void delLink(AreaGenerationLibrary.LayoutNode linkNode)
AreaGenerationLibrary.LayoutNodedelLink 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.LayoutNodegetLink in interface AreaGenerationLibrary.LayoutNoded - the direction codeAreaGenerationLibrary.LayoutNode.links(), 
AreaGenerationLibrary.LayoutNode.deLink()public boolean isStreetLike()
AreaGenerationLibrary.LayoutNodeisStreetLike in interface AreaGenerationLibrary.LayoutNodepublic void deLink()
AreaGenerationLibrary.LayoutNodedeLink 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.LayoutNodeflag in interface AreaGenerationLibrary.LayoutNodeflag - the flag to set.public void flagRun(AreaGenerationLibrary.LayoutRuns run)
AreaGenerationLibrary.LayoutNodeflagRun in interface AreaGenerationLibrary.LayoutNoderun - the direction of the runAreaGenerationLibrary.LayoutRunspublic AreaGenerationLibrary.LayoutTypes type()
AreaGenerationLibrary.LayoutNodetype in interface AreaGenerationLibrary.LayoutNodeAreaGenerationLibrary.LayoutTypespublic void setExits(int[] dirs)
AreaGenerationLibrary.LayoutNodesetExits in interface AreaGenerationLibrary.LayoutNodedirs - the array of Direction codes to set.public void reType(AreaGenerationLibrary.LayoutTypes type)
AreaGenerationLibrary.LayoutNodereType in interface AreaGenerationLibrary.LayoutNodetype - the type of this nodeAreaGenerationLibrary.LayoutTypespublic java.lang.String getColorRepresentation(char roomChar,
                                               int line)
AreaGenerationLibrary.LayoutNodegetColorRepresentation in interface AreaGenerationLibrary.LayoutNoderoomChar - the char to use for this roomline - which line, 0, 1, or 2