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