public abstract class StringComponent extends Component implements SerializableComponent
Example: public class NameComponent extends StringComponent { public NameComponent(String initialValue) { super(initialValue); } } Entity player = ... player.addComponent(new NameComponent("PlayerName")); String name = player.getComponent(NameComponent.class).getValue();
Type | Property and Description |
---|---|
javafx.beans.property.StringProperty |
value |
Constructor and Description |
---|
StringComponent()
No-arg ctor, initializes the value to empty string.
|
StringComponent(String initialValue)
Constructs a string value component with given
initial value.
|
Modifier and Type | Method and Description |
---|---|
String |
getValue() |
void |
read(Bundle bundle) |
void |
setValue(String value)
Set value to this component.
|
String |
toString() |
javafx.beans.property.StringProperty |
valueProperty() |
void |
write(Bundle bundle) |
public final javafx.beans.property.StringProperty valueProperty
getValue()
,
setValue(String)
public StringComponent()
public StringComponent(String initialValue)
initialValue
- the initial valuepublic final javafx.beans.property.StringProperty valueProperty()
getValue()
,
setValue(String)
public final String getValue()
public final void setValue(String value)
value
- new valuepublic void write(@NotNull Bundle bundle)
public void read(@NotNull Bundle bundle)
Copyright © 2017. All rights reserved.