public class TypeComponent extends com.almasb.ents.component.ObjectComponent<Serializable> implements com.almasb.ents.serialization.SerializableComponent, com.almasb.ents.CopyableComponent<TypeComponent>
| Constructor and Description |
|---|
TypeComponent()
Constructs a component with no type.
|
TypeComponent(Serializable type)
Constructs a component with given type.
|
| Modifier and Type | Method and Description |
|---|---|
TypeComponent |
copy() |
boolean |
isType(Object type)
Example:
entity.getTypeComponent().isType(Type.PLAYER);
|
void |
read(com.almasb.easyio.serialization.Bundle bundle) |
String |
toString() |
void |
write(com.almasb.easyio.serialization.Bundle bundle) |
public TypeComponent()
public TypeComponent(Serializable type)
type - entity typepublic boolean isType(Object type)
Example:
entity.getTypeComponent().isType(Type.PLAYER);
type - entity typepublic String toString()
toString in class com.almasb.ents.component.ObjectComponent<Serializable>public void write(@NotNull
com.almasb.easyio.serialization.Bundle bundle)
write in interface com.almasb.easyio.serialization.SerializableTypepublic void read(@NotNull
com.almasb.easyio.serialization.Bundle bundle)
read in interface com.almasb.easyio.serialization.SerializableTypepublic TypeComponent copy()
copy in interface com.almasb.ents.CopyableComponent<TypeComponent>Copyright © 2016. All rights reserved.