public class Main {
public static void main(String[] args) {
byte OnOfEngine = -57;
int NumberEngines;
for (NumberEngines = 0; NumberEngines < 8; NumberEngines++) {
if ((OnOfEngine & (1 << NumberEngines)) != 0)
System.out.println("Dvigatel N " + NumberEngines + " vkluchen");
}
}
}
Dvigatel N 0 vkluchen
Dvigatel N 1 vkluchen
Dvigatel N 2 vkluchen
Dvigatel N 6 vkluchen
Dvigatel N 7 vkluchen
Dvigatel N 8 vkluchen
Process finished with exit code 0
@Bean
public ClassLoaderTemplateResolver emailTemplateResolver() {
ClassLoaderTemplateResolver resolver = new ClassLoaderTemplateResolver();
resolver.setPrefix("mail/");
resolver.setSuffix(".html");
resolver.setTemplateMode("HTML5");
resolver.setCacheable(false);
resolver.setCharacterEncoding("UTF-8");
resolver.setOrder(1);
return resolver;
}
public class GameScreen implements Screen, InputProcessor{
//вызывается при создании нового экрана (Screen)
public void show(){
//говорим что будем отбрабатывать нажатия тут
Gdx.input.setInputProcessor(this);
}
//работаем с клавиатурой
public boolean keyDown(int key){
if(key==Keys.LEFT)) bucket.x -= 200 * Gdx.graphics.getDeltaTime();
if(key==Keys.RIGHT)) bucket.x += 200 * Gdx.graphics.getDeltaTime();
}
//работаем с мышей/тачскрином
public boolean touchDown(int screenX, int screenY, int pointer, int button){
Vector3 touchPos = new Vector3(screenX, screenY);
camera.unproject(touchPos);
bucket.x = touchPos.x - 64 / 2;
}
public void render(float delta)
{
Gdx.gl.glClearColor(1.0F, 0.0F, 0.0F, 1.0F);
Gdx.gl.glClear(16384);
//рисуем что-то
}
}