com.planet_ink.coffee_mud.Libraries.layouts
Class AbstractLayout
java.lang.Object
com.planet_ink.coffee_mud.Libraries.layouts.AbstractLayout
- All Implemented Interfaces:
- AreaGenerationLibrary.LayoutManager
- Direct Known Subclasses:
- ApartmentLayout, BoxCityLayout, CrossLayout, GridCityLayout, MazeLayout, TreeLayout
public abstract class AbstractLayout
- extends java.lang.Object
- implements AreaGenerationLibrary.LayoutManager
Abstract area layout pattern
node tags:
nodetype: surround, leaf, offleaf, street, square, interior
nodeexits: n,s,e,w, n,s, e,w, n,e,w, etc
nodeflags: corner, gate, intersection, tee
NODEGATEEXIT: (for gate, offleaf, square): n s e w etc
noderun: (for surround, street): n,s e,w
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractLayout
public AbstractLayout()
diff
public int diff(int width,
int height,
int num)
name
public abstract java.lang.String name()
- Description copied from interface:
AreaGenerationLibrary.LayoutManager
- The name of the layout manager
- Specified by:
name
in interface AreaGenerationLibrary.LayoutManager
- Returns:
- name of the layout manager
generate
public abstract java.util.List<AreaGenerationLibrary.LayoutNode> generate(int num,
int dir)
- Description copied from interface:
AreaGenerationLibrary.LayoutManager
- Generates a list of layout nodes, each
of which reprents a single room in the area.
The first node is always the entry room, which
is entered from the direction given to this method.
- Specified by:
generate
in interface AreaGenerationLibrary.LayoutManager
- Parameters:
num
- the number of nodes to generatedir
- the direction of entry into this group of nodes.
- Returns:
- a list of layout nodes
- See Also:
AreaGenerationLibrary.LayoutNode
getDirection
public static int getDirection(AreaGenerationLibrary.LayoutNode from,
AreaGenerationLibrary.LayoutNode to)
getRunDirection
public static AreaGenerationLibrary.LayoutRuns getRunDirection(int dirCode)