Gridarta Editor
net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference

Contains a list of (typically wall-)arches which do autojoining. More...

+ Inheritance diagram for net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

 AutojoinList (@NotNull final Iterable< List< R >> archetypes) throws IllegalAutojoinListException
 Creates a new instance. More...
 
int getAlternativeIndex (@NotNull final R archetype)
 Returns the index of an Archetype if it is an alternative archetype for any direction. More...
 
getArchetype (final int index)
 
Iterable< R > getArchetypes (final int index)
 Returns all archetypes for an index. More...
 
int getIndex (@NotNull final R archetype)
 Looks up the given node in the archetype array of this class. More...
 
boolean isMainIndex (@NotNull final R archetype)
 Returns the index of an Archetype if it is a main archetype for any direction. More...
 

Static Public Attributes

static final int EAST = 2
 
static final int NORTH = 1
 
static final int SIZE = 16
 The number of archetypes in an autojoin list. More...
 
static final int SOUTH = 4
 
static final int WEST = 8
 

Static Private Member Functions

static< R extends Archetype<?, ?, R > List< R > validate (@NotNull final Iterable< R > archetypeList) throws IllegalAutojoinListException
 Validates a list of archetypes: no entry must be. More...
 

Private Attributes

final List< List< R > > archetypes
 Maps index to list of archetypes representing autojoin-able archetypes for this direction. More...
 

Static Private Attributes

static final Category LOG = Logger.getLogger(AutojoinList.class)
 The Logger for printing log messages. More...
 
static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

Contains a list of (typically wall-)arches which do autojoining.

Author
Andreas Vogl

Definition at line 39 of file AutojoinList.java.

Constructor & Destructor Documentation

◆ AutojoinList()

Member Function Documentation

◆ getAlternativeIndex()

◆ getArchetype()

◆ getArchetypes()

Iterable<R> net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getArchetypes ( final int  index)

Returns all archetypes for an index.

Parameters
indexthe index
Returns
the archetypes; the result contains at least one entry

Definition at line 199 of file AutojoinList.java.

References net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.archetypes.

◆ getIndex()

◆ isMainIndex()

◆ validate()

static <R extends Archetype<?, ?, R> List<R> net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.validate ( @NotNull final Iterable< R >  archetypeList) throws IllegalAutojoinListException
staticprivate

Validates a list of archetypes: no entry must be.

null

, no duplicate entry must exist, at least one entry must exist.

Parameters
archetypeListthe archetype list to validate
Returns
a copy of the validated archetype list
Exceptions
IllegalAutojoinListExceptionif a validation error was detected

Definition at line 118 of file AutojoinList.java.

Referenced by net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.AutojoinList().

+ Here is the caller graph for this function:

Member Data Documentation

◆ archetypes

final List<List<R> > net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.archetypes
private

Maps index to list of archetypes representing autojoin-able archetypes for this direction.

The first archetype is the main archetype that can be converted into other archetypes. Following archetypes are alternative variants that are recognized but never converted. Examples for alternative archetypes are walls having windows.

The indices are interpreted in following order (0-15):

  1. index: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  2. means: 0, N, E, NE, S, NS, ES, NES, W, WN, WE, WNE, SW, SWN, ESW, NESW
  3. (0 = no connection, N = north, E = east, S = south, W = west)

Definition at line 84 of file AutojoinList.java.

Referenced by net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.AutojoinList(), net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getAlternativeIndex(), net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getArchetype(), net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getArchetypes(), net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getIndex(), and net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isMainIndex().

◆ EAST

◆ LOG

final Category net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.LOG = Logger.getLogger(AutojoinList.class)
staticprivate

◆ NORTH

◆ serialVersionUID

final long net.sf.gridarta.model.autojoin.AutojoinList< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 44 of file AutojoinList.java.

◆ SIZE

◆ SOUTH

◆ WEST


The documentation for this class was generated from the following file: