Skip to content
Snippets Groups Projects
Commit 37744340 authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Datei formatiert

parent ccb507e1
No related branches found
No related tags found
No related merge requests found
package projekt.enigma.model; package projekt.enigma.model;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* Klasse Walze * Klasse Walze
...@@ -138,16 +135,14 @@ public class Walze { ...@@ -138,16 +135,14 @@ public class Walze {
public boolean dreheWalze(int richtung) { public boolean dreheWalze(int richtung) {
boolean checkRing = false; boolean checkRing = false;
if (richtung == 1) { if (richtung == 1) {
Collections.rotate(Arrays.asList(this.walzeAlpha), richtung); Collections.rotate(Arrays.asList(this.walzeAlpha), richtung);
} else { } else {
richtung = -1; richtung = -1;
Collections.rotate(Arrays.asList(this.walzeAlpha), richtung); Collections.rotate(Arrays.asList(this.walzeAlpha), richtung);
} }
System.out.printf("W: %s R: %s\n", this.getPosition(), this.ringstellung);
// gleicht die Ringstellung mit der aktuellen Position ab // gleicht die Ringstellung mit der aktuellen Position ab
if (this.getPosition() + 1 == this.ringstellung) { if (this.getPosition() + 1 == this.ringstellung) {
checkRing = true; checkRing = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment