Atavism Version 2018.1AGIS API

atavism.server.objects
Class SpawnData

java.lang.Object
  extended by atavism.server.objects.NamedPropertyClass
      extended by atavism.server.objects.Entity
          extended by atavism.server.objects.SpawnData
All Implemented Interfaces:
java.io.Serializable

public class SpawnData
extends Entity

Spawn generator definition.

See Also:
Serialized Form

Field Summary
protected  int templateID
           
protected  java.util.HashMap<java.lang.Integer,java.lang.Integer> templateIDs
           
 
Fields inherited from class atavism.server.objects.Entity
log, staticLock, subObjectNamespacesInt, transientPropertyKeys, type
 
Fields inherited from class atavism.server.objects.NamedPropertyClass
lock, name
 
Constructor Summary
SpawnData()
           
SpawnData(java.lang.String name, java.lang.String templateName, int category, java.lang.String factoryName, OID instanceOid, Point loc, Quaternion orient, java.lang.Integer spawnRadius, java.lang.Integer numSpawns, java.lang.Integer respawnTime)
          Create a SpawnData.
 
Method Summary
 void addTemplateID(int templateID, int chance)
           
 int getCategory()
          Get the template for spawning objects.
 java.lang.String getClassName()
          Get the spawn generator class name.
 java.lang.Integer getCorpseDespawnTime()
          Get the corpse despawn time (seconds).
 java.lang.String getFactoryName()
          Get the object factory name.
 OID getInstanceOid()
          Get the instance oid.
 Point getLoc()
          Get spawn area center point.
 java.lang.Integer getNumSpawns()
          Get the number of spawned objects.
 Quaternion getOrientation()
          Get the initial spawned object orientation.
 int getRandomTemplateID()
          Randomly chooses a templateID from the templateIDs map.
 java.lang.Integer getRespawnTime()
          Get the respawn time (seconds).
 java.lang.Integer getSpawnRadius()
          Get the spawn area radius.
 int getTemplateID()
          Get the template for spawning objects.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> getTemplateIDs()
          Get the template for spawning objects.
 java.lang.String getTemplateName()
          Get the template for spawning objects.
 void setCategory(int category)
          Set the template for spawning objects.
 void setClassName(java.lang.String className)
          Set the spawn generator class name.
 void setCorpseDespawnTime(java.lang.Integer time)
          Set the corpse despawn time (seconds).
 void setFactoryName(java.lang.String factoryName)
          Set the object factory name.
 void setInstanceOid(OID oid)
          Set the instance oid.
 void setLoc(Point loc)
          Set spawn area center point.
 void setNumSpawns(java.lang.Integer numSpawns)
          Set the number of spawned objects.
 void setOrientation(Quaternion orient)
          Set the initial spawned object orientation.
 void setRespawnTime(java.lang.Integer respawnTime)
          Set the respawn time (seconds).
 void setSpawnRadius(java.lang.Integer spawnRadius)
          Set the spawn area radius.
 void setTemplateID(int templateID)
          Set the template for spawning objects.
 void setTemplateIDs(java.util.HashMap<java.lang.Integer,java.lang.Integer> templateIDs)
          Set the template for spawning objects.
 void setTemplateName(java.lang.String templateName)
          Set the template for spawning objects.
 java.lang.String toString()
          Returns the string describing this entity, useful for logging.
 
Methods inherited from class atavism.server.objects.Entity
addSubObjectNamespace, equals, equals, getLock, getNamespace, getOid, getPersistenceFlag, getProperty, getSubObjectNamespaces, getSubObjectNamespacesInt, getTransientDataRef, getType, hashCode, hasSubObjectNamespace, isDeleted, registerTransientPropertyKey, removeProperty, removeSubObjectNamespace, setDeleted, setNamespace, setOid, setPersistenceFlag, setProperty, setSubObjectNamespaces, setSubObjectNamespacesInt, setType, toBytes, unregisterTransientPropertyKey
 
Methods inherited from class atavism.server.objects.NamedPropertyClass
getBooleanProperty, getIntProperty, getName, getPropertyMap, getPropertyMapRef, getStringProperty, lock, modifyIntProperty, setName, setPropertyMap, setupTransient, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

templateIDs

protected java.util.HashMap<java.lang.Integer,java.lang.Integer> templateIDs

templateID

protected int templateID
Constructor Detail

SpawnData

public SpawnData()

SpawnData

public SpawnData(java.lang.String name,
                 java.lang.String templateName,
                 int category,
                 java.lang.String factoryName,
                 OID instanceOid,
                 Point loc,
                 Quaternion orient,
                 java.lang.Integer spawnRadius,
                 java.lang.Integer numSpawns,
                 java.lang.Integer respawnTime)
Create a SpawnData.

Parameters:
name - The spawn generator name.
templateName - Template for spawning objects.
factoryName - Object factory name. Register object factories with ObjectFactory.register().
instanceOid - Instance oid.
loc - Spawn area center point.
orient - Spawn generator orientation. Sets spawned object's initial orientation.
spawnRadius - Spawn area radius.
numSpawns - Number of objects to spawn.
respawnTime - How long after object "dies" to spawn a replacement.
Method Detail

toString

public java.lang.String toString()
Description copied from class: Entity
Returns the string describing this entity, useful for logging.

Overrides:
toString in class Entity
Returns:
string describing entity

setClassName

public void setClassName(java.lang.String className)
Set the spawn generator class name. If not set, defaults to SpawnGenerator. The class name must be registered with MobManagerPlugin.registerSpawnGeneratorClass(). The registered class must be a SpawnGenerator sub-class. An instance is created using the no-argument constructor. Sub-classes may implement initialize(SpawnData) to override the initialization behavior.


getClassName

public java.lang.String getClassName()
Get the spawn generator class name.


setTemplateID

public void setTemplateID(int templateID)
Set the template for spawning objects.


getTemplateID

public int getTemplateID()
Get the template for spawning objects.


setTemplateIDs

public void setTemplateIDs(java.util.HashMap<java.lang.Integer,java.lang.Integer> templateIDs)
Set the template for spawning objects.


getTemplateIDs

public java.util.HashMap<java.lang.Integer,java.lang.Integer> getTemplateIDs()
Get the template for spawning objects.


addTemplateID

public void addTemplateID(int templateID,
                          int chance)

getRandomTemplateID

public int getRandomTemplateID()
Randomly chooses a templateID from the templateIDs map.

Returns:

setTemplateName

public void setTemplateName(java.lang.String templateName)
Set the template for spawning objects.


getTemplateName

public java.lang.String getTemplateName()
Get the template for spawning objects.


setCategory

public void setCategory(int category)
Set the template for spawning objects.


getCategory

public int getCategory()
Get the template for spawning objects.


setFactoryName

public void setFactoryName(java.lang.String factoryName)
Set the object factory name. Register object factories with ObjectFactory.register().


getFactoryName

public java.lang.String getFactoryName()
Get the object factory name.


getInstanceOid

public OID getInstanceOid()
Get the instance oid.


setInstanceOid

public void setInstanceOid(OID oid)
Set the instance oid.


setLoc

public void setLoc(Point loc)
Set spawn area center point.


getLoc

public Point getLoc()
Get spawn area center point.


setOrientation

public void setOrientation(Quaternion orient)
Set the initial spawned object orientation.


getOrientation

public Quaternion getOrientation()
Get the initial spawned object orientation.


setSpawnRadius

public void setSpawnRadius(java.lang.Integer spawnRadius)
Set the spawn area radius.


getSpawnRadius

public java.lang.Integer getSpawnRadius()
Get the spawn area radius.


setNumSpawns

public void setNumSpawns(java.lang.Integer numSpawns)
Set the number of spawned objects.


getNumSpawns

public java.lang.Integer getNumSpawns()
Get the number of spawned objects.


setRespawnTime

public void setRespawnTime(java.lang.Integer respawnTime)
Set the respawn time (seconds). How long after an object "dies" before spawning a replacement.


getRespawnTime

public java.lang.Integer getRespawnTime()
Get the respawn time (seconds).


setCorpseDespawnTime

public void setCorpseDespawnTime(java.lang.Integer time)
Set the corpse despawn time (seconds). How long after an object "dies" before despawning its corpse.


getCorpseDespawnTime

public java.lang.Integer getCorpseDespawnTime()
Get the corpse despawn time (seconds).



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