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