|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.objects.ObjectType
public class ObjectType
Atavism object type. Classifies Entity
and
AOObject
objects by their basic type. ObjectTypes have
a string name and a short id. The name and id must be unique.
All plugins must use the same names and ids.
Object types may have one or more "base types". The base types
are BASE_STRUCTURE
, BASE_MOB
, and BASE_PLAYER
.
Methods isStructure()
, isMob()
, and isPlayer()
reflect the base type.
Applications should use the ObjectTypes defined in ObjectTypes
rather than defining their own.
Applications create ObjectTypes using intern()
.
Multiple calls to intern() in the same process with the same
parameters will return the same instance.
Nested Class Summary | |
---|---|
static class |
ObjectType.PersistenceDelegate
Internal use only. |
Field Summary | |
---|---|
static int |
BASE_MOB
Mob base type. |
static int |
BASE_PLAYER
Player base type. |
static int |
BASE_STRUCTURE
Structure base type. |
Constructor Summary | |
---|---|
ObjectType()
No-arg constructor required for marshalling. |
Method Summary | |
---|---|
int |
getBaseType()
Get the object base type. |
static ObjectType |
getObjectType(short typeId)
Get object type. |
static ObjectType |
getObjectType(java.lang.String typeName)
Get object type. |
short |
getTypeId()
Get the object type number. |
java.lang.String |
getTypeName()
Get the object type name. |
static ObjectType |
intern(short typeId,
java.lang.String typeName)
Get or create an ObjectType. |
static ObjectType |
intern(short typeId,
java.lang.String typeName,
int baseType)
Get or create an ObjectType. |
boolean |
isA(ObjectType objectType)
True if object type is a given object type, or object base type 'is a' given ObjectType. |
boolean |
isMob()
True if object base type is a mob. |
boolean |
isPlayer()
True if object base type is a player. |
boolean |
isStructure()
True if object base type is a structure. |
void |
marshalObject(AOByteBuffer buf)
Internal use only. |
java.lang.String |
toString()
|
java.lang.Object |
unmarshalObject(AOByteBuffer buf)
Internal use only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BASE_STRUCTURE
public static final int BASE_MOB
public static final int BASE_PLAYER
Constructor Detail |
---|
public ObjectType()
Method Detail |
---|
public static ObjectType intern(short typeId, java.lang.String typeName)
typeId
- Unique type number.typeName
- Unique type name.public static ObjectType intern(short typeId, java.lang.String typeName, int baseType)
typeId
- Unique type number.typeName
- Unique type name.baseType
- Bitwise OR of BASE_STRUCTURE
, BASE_MOB
, and BASE_PLAYER
.public static ObjectType getObjectType(short typeId)
typeId
does not exist (use intern() to
create the object type.)public static ObjectType getObjectType(java.lang.String typeName)
typeName
does not exist (use intern() to
create the object type.)public java.lang.String toString()
toString
in class java.lang.Object
public short getTypeId()
public java.lang.String getTypeName()
public boolean isStructure()
public boolean isA(ObjectType objectType)
public boolean isMob()
public boolean isPlayer()
public int getBaseType()
public void marshalObject(AOByteBuffer buf)
marshalObject
in interface Marshallable
buf
- The byte bufferpublic java.lang.Object unmarshalObject(AOByteBuffer buf)
unmarshalObject
in interface Marshallable
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |