public class AutojoinList<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
EAST |
static int |
NORTH |
static int |
SIZE
The number of archetypes in an autojoin list.
|
static int |
SOUTH |
static int |
WEST |
Constructor and Description |
---|
AutojoinList(@NotNull java.lang.Iterable<java.util.List<R>> archetypes)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlternativeIndex(R archetype)
Returns the index of an
Archetype if it is an alternative
archetype for any direction. |
R |
getArchetype(int index) |
@NotNull java.lang.Iterable<R> |
getArchetypes(int index)
Returns all archetypes for an index.
|
int |
getIndex(R archetype)
Looks up the given node in the archetype array of this class.
|
boolean |
isMainIndex(R archetype)
Returns the index of an
Archetype if it is a main archetype for
any direction. |
public static final int SIZE
public static final int NORTH
public static final int EAST
public static final int SOUTH
public static final int WEST
public AutojoinList(@NotNull @NotNull java.lang.Iterable<java.util.List<R>> archetypes) throws IllegalAutojoinListException
archetypes
- the archetypes that form a set of join-able archetypesIllegalAutojoinListException
- if the autojoin list cannot be
createdpublic int getIndex(@NotNull R archetype)
archetype
- the node to lookuppublic boolean isMainIndex(@NotNull R archetype)
Archetype
if it is a main archetype for
any direction.archetype
- the archetype to checkpublic int getAlternativeIndex(@NotNull R archetype)
Archetype
if it is an alternative
archetype for any direction.archetype
- the archetype to check-1
@NotNull public R getArchetype(int index)
@NotNull public @NotNull java.lang.Iterable<R> getArchetypes(int index)
index
- the index