public class TypeComponent extends ObjectComponent<Serializable> implements SerializableComponent, CopyableComponent<TypeComponent>
valueProperty| 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()
Copies this component.
|
boolean |
isType(Object type)
Example:
entity.getTypeComponent().isType(Type.PLAYER);
|
void |
read(Bundle bundle) |
String |
toString() |
void |
write(Bundle bundle) |
getValue, setValue, valuePropertypublic 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 ObjectComponent<Serializable>public void write(@NotNull
Bundle bundle)
public void read(@NotNull
Bundle bundle)
public TypeComponent copy()
CopyableComponentObject.clone().
The 'depth' of the copy should be determined by the user.copy in interface CopyableComponent<TypeComponent>Copyright © 2017. All rights reserved.