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