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() |
boolean |
isType(Object type)
Example:
entity.getTypeComponent().isType(Type.PLAYER);
|
void |
read(com.almasb.fxgl.io.serialization.Bundle bundle) |
String |
toString() |
void |
write(com.almasb.fxgl.io.serialization.Bundle bundle) |
getValue, setValue, valuePropertygetEntity, onAdded, onRemovedpublic 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
com.almasb.fxgl.io.serialization.Bundle bundle)
write in interface com.almasb.fxgl.io.serialization.SerializableTypepublic void read(@NotNull
com.almasb.fxgl.io.serialization.Bundle bundle)
read in interface com.almasb.fxgl.io.serialization.SerializableTypepublic TypeComponent copy()
copy in interface CopyableComponent<TypeComponent>Copyright © 2017. All rights reserved.