use of com.ilargia.games.logicbrick.gen.input.InputEntity in project Entitas-Java by Rubentxu.
the class ProcessInputSystem method execute.
@Override
protected void execute(List<InputEntity> entities) {
InputEntity inputEntity = entities.get(0);
Input input = inputEntity.getInput();
Set<GameEntity> interactives = EntityIndexExtension.getEntitiesWithPosition(entitas.game, input.x, input.y).stream().filter(e -> e.isInteractive()).collect(Collectors.toSet());
for (GameEntity e : interactives) {
e.setDestroy(true);
}
}
Also used :
Collector(com.ilargia.games.entitas.collector.Collector)
List(java.util.List)
GameEntity(com.ilargia.games.logicbrick.gen.game.GameEntity)
Input(com.ilargia.games.logicbrick.component.input.Input)
IContext(com.ilargia.games.entitas.api.IContext)
InputEntity(com.ilargia.games.logicbrick.gen.input.InputEntity)
InputMatcher(com.ilargia.games.logicbrick.gen.input.InputMatcher)
Set(java.util.Set)
EntityIndexExtension(com.ilargia.games.entitas.EntityIndexExtension)
Entitas(com.ilargia.games.entitas.core.Entitas)
InputContext(com.ilargia.games.logicbrick.gen.input.InputContext)
Collectors(java.util.stream.Collectors)
GameEntity(com.ilargia.games.logicbrick.gen.game.GameEntity)
Input(com.ilargia.games.logicbrick.component.input.Input)
InputEntity(com.ilargia.games.logicbrick.gen.input.InputEntity)