|
|||||||||
| Version 1.5 | APIs subject to change! | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmultiverse.server.objects.ObjectType
public class ObjectType
Multiverse object type. Classifies Entity and
MVObject 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. |
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 |
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(multiverse.server.network.MVByteBuffer buf)
Internal use only. |
java.lang.String |
toString()
|
java.lang.Object |
unmarshalObject(multiverse.server.network.MVByteBuffer 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 java.lang.String toString()
toString in class java.lang.Objectpublic short getTypeId()
public java.lang.String getTypeName()
public boolean isStructure()
public boolean isMob()
public boolean isPlayer()
public int getBaseType()
public void marshalObject(multiverse.server.network.MVByteBuffer buf)
marshalObject in interface Marshallablebuf - The byte bufferpublic java.lang.Object unmarshalObject(multiverse.server.network.MVByteBuffer buf)
unmarshalObject in interface Marshallable
|
Copyright © 2008 The Multiverse Network, Inc. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||