Atavism Version 2018.1AGIS API

atavism.server.objects
Class Region

java.lang.Object
  extended by atavism.server.objects.Region
All Implemented Interfaces:
java.io.Serializable

public class Region
extends java.lang.Object
implements java.io.Serializable

Regions are bounded areas of the world with zero or more features. Regions are two-dimensional (they have no Y component) and are pinned to the terrain. Several features can be assigned to a region such as sound, light, fog, grass, and water. A region can have multiple features, but only one of a given type. Regions are placed in the world using the WorldEditor tool.

Regions have a name, a boundary (ordered list of points), a set of region configs, and a set of properties. The region configs describe the builtin region features applied to the region. The properties are the NameValue properties defined in the WorldEditor. Custom region triggers are called when the "onEnter" or "onLeave" properties are set. See RegionTrigger.

See Also:
Serialized Form

Nested Class Summary
static class Region.Search
          Region search parameters.
 
Field Summary
static java.lang.Integer DEFAULT_PRIORITY
           
static ObjectType OBJECT_TYPE
          Region object type.
static long PROP_ALL
          Get all region information (search selection flag).
static long PROP_BOUNDARY
          Get the region boundary (search selection flag).
static long PROP_PROPERTIES
          Get the region properties (search selection flag).
 
Constructor Summary
Region()
           
Region(java.lang.String name)
           
 
Method Summary
 void addConfig(RegionConfig config)
          Add a region config (builtin region feature).
 Boundary getBoundary()
          Get the region boundary.
 RegionConfig getConfig(java.lang.String type)
          Get the region config by type.
 java.util.Collection<RegionConfig> getConfigs()
          Get all the region configs.
 java.lang.String getName()
          Get the region name.
 java.lang.Integer getPriority()
          Get the region priority.
 java.io.Serializable getProperty(java.lang.String key)
          Get property value.
 java.util.Map<java.lang.String,java.io.Serializable> getPropertyMapRef()
          Get the property map.
 void setBoundary(Boundary b)
          Set the region boundary.
 void setName(java.lang.String name)
          Set the region name.
 void setPriority(java.lang.Integer priority)
          Set the region priority.
 void setProperties(java.util.Map<java.lang.String,java.io.Serializable> props)
          Set the region property map.
 java.io.Serializable setProperty(java.lang.String key, java.io.Serializable value)
          Set property value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PRIORITY

public static java.lang.Integer DEFAULT_PRIORITY

PROP_BOUNDARY

public static final long PROP_BOUNDARY
Get the region boundary (search selection flag).

See Also:
Constant Field Values

PROP_PROPERTIES

public static final long PROP_PROPERTIES
Get the region properties (search selection flag).

See Also:
Constant Field Values

PROP_ALL

public static final long PROP_ALL
Get all region information (search selection flag).

See Also:
Constant Field Values

OBJECT_TYPE

public static final ObjectType OBJECT_TYPE
Region object type.

Constructor Detail

Region

public Region()

Region

public Region(java.lang.String name)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setName

public void setName(java.lang.String name)
Set the region name.


getName

public java.lang.String getName()
Get the region name.


setPriority

public void setPriority(java.lang.Integer priority)
Set the region priority. Determines which region applies in the presence of multiple overlapping regions. Lower numbers are higher priority. The default priority is DEFAULT_PRIORITY.


getPriority

public java.lang.Integer getPriority()
Get the region priority.


setBoundary

public void setBoundary(Boundary b)
Set the region boundary. In the world manager, changing a region boundary has undefined effect.


getBoundary

public Boundary getBoundary()
Get the region boundary.


addConfig

public void addConfig(RegionConfig config)
Add a region config (builtin region feature). Only one RegionConfig of a given type is supported.


getConfig

public RegionConfig getConfig(java.lang.String type)
Get the region config by type.


getConfigs

public java.util.Collection<RegionConfig> getConfigs()
Get all the region configs.


getProperty

public java.io.Serializable getProperty(java.lang.String key)
Get property value.

Parameters:
key - Property name
Returns:
Property value, null if property does not exist.
See Also:
setProperty(String, Serializable)

setProperty

public java.io.Serializable setProperty(java.lang.String key,
                                        java.io.Serializable value)
Set property value.

Parameters:
key - Property name.
value - Property value.
Returns:
Previous property value, or null if did not exist.

getPropertyMapRef

public java.util.Map<java.lang.String,java.io.Serializable> getPropertyMapRef()
Get the property map. Changes to the return value directly affect the region's properties.


setProperties

public void setProperties(java.util.Map<java.lang.String,java.io.Serializable> props)
Set the region property map. The supplied map is copied.



Copyright © 2018 Dragonsan Studios Sp. z o.o.