use of io.github.voidzombie.nhglib.runtime.ecs.components.common.MessageComponent in project nhglib by VoidZombie.
the class TestNodeSystem method process.
@Override
protected void process(int entityId) {
NodeComponent nodeComponent = nodeMapper.get(entityId);
MessageComponent messageComponent = messageMapper.get(entityId);
Array<Message> messages = messageComponent.getMessages();
for (Message message : messages) {
if (message.is("printNode")) {
Logger.log(this, "id: %d, x: %f, y: %f, z: %f", nodeComponent.id, nodeComponent.getX(), nodeComponent.getY(), nodeComponent.getZ());
messageComponent.consume(message);
}
}
}
use of io.github.voidzombie.nhglib.runtime.ecs.components.common.MessageComponent in project nhglib by VoidZombie.
the class MessageComponentJson method parse.
@Override
public void parse(JsonValue jsonValue) {
MessageComponent messageComponent = entities.createComponent(entity, MessageComponent.class);
JsonValue filters = jsonValue.get("filters");
messageComponent.subscribe(filters.asStringArray());
output = messageComponent;
}
Aggregations