de.adom.jade.world
Class Complex

java.lang.Object
  extended by de.adom.jade.kernel.GUIDCarrier
      extended by de.adom.jade.world.Complex
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DungeonComplex, HugeDungeonComplex, HumanVillageComplex, WorldComplex

public abstract class Complex
extends GUIDCarrier
implements java.io.Serializable

A complex is made up from a number of connected locations. The complex defines the types of locations.

See Also:
Serialized Form

Constructor Summary
Complex(int size)
          Defines a complex with a given size and a root location.
 
Method Summary
protected  void connectLocations()
          Connects all the locations in this complex.
protected  void connectLocations(int first, int last)
          Connects all the locations in this complex that belong to a certain range.
 Location getLocation(int index)
          Returns a specific location.
 int getLocationCount()
          Returns the number of locations in this complex.
 void setLocation(int index, Location location)
          Defines a new location in the complex.
 
Methods inherited from class de.adom.jade.kernel.GUIDCarrier
getGUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Complex

public Complex(int size)
Defines a complex with a given size and a root location.

Parameters:
size - the size of the complex
Method Detail

setLocation

public void setLocation(int index,
                        Location location)
Defines a new location in the complex. The location will be automatically registered in the location manager and it also will learn about the complex to which it belongs.

Parameters:
index - the index of the location
location - the location

getLocation

public Location getLocation(int index)
Returns a specific location.

Parameters:
index - the index of the location
Returns:
the location at the given index

getLocationCount

public int getLocationCount()
Returns the number of locations in this complex.

Returns:
the number of locations in this complex

connectLocations

protected void connectLocations()
Connects all the locations in this complex.


connectLocations

protected void connectLocations(int first,
                                int last)
Connects all the locations in this complex that belong to a certain range.

Parameters:
first - the start index of the locations
last - the last index of the locations