Texturen Paket um Bild 32 erweitert (Rückseite), Test und Pfad in Gui
angepast
This commit is contained in:
BIN
StandartTexturenBeta3.zip
Executable file
BIN
StandartTexturenBeta3.zip
Executable file
Binary file not shown.
@@ -21,16 +21,7 @@ class TEST_Texturenpaket {
|
||||
|
||||
@Test
|
||||
void FehlerFreiesPaketLaden() {
|
||||
paket = new Texturenpaket("StandartTexturenBeta.zip");
|
||||
assertTrue(paket.ladePacket());
|
||||
System.out.println("Name des Texturen Paketes: " + paket.getName());
|
||||
System.out.println("Level des Texturen Paketes: " + paket.getLevel());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void FehlerFreiesPaketLaden2() {
|
||||
paket = new Texturenpaket("StandartTexturenBeta2.zip");
|
||||
paket = new Texturenpaket("StandartTexturenBeta3.zip");
|
||||
assertTrue(paket.ladePacket());
|
||||
System.out.println("Name des Texturen Paketes: " + paket.getName());
|
||||
System.out.println("Level des Texturen Paketes: " + paket.getLevel());
|
||||
@@ -47,10 +38,10 @@ class TEST_Texturenpaket {
|
||||
|
||||
@Test
|
||||
void TexturenAusgeben() {
|
||||
paket = new Texturenpaket("StandartTexturenBeta.zip");
|
||||
paket = new Texturenpaket("StandartTexturenBeta3.zip");
|
||||
assertTrue(paket.ladePacket());
|
||||
Image Bilder[] = paket.getTexturen();
|
||||
for(int i = 0; i < 32; i++) {
|
||||
for(int i = 0; i < 33; i++) {
|
||||
assertTrue(Bilder[i] != null);
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ class TEST_Texturenpakete {
|
||||
@Test
|
||||
void test() {
|
||||
assertTrue(pakete.getAnzahlPakete()==0);
|
||||
assertTrue(pakete.addPaket("StandartTexturenBeta2.zip"));
|
||||
assertTrue(pakete.addPaket("StandartTexturenBeta3.zip"));
|
||||
assertTrue(pakete.getAnzahlPakete()==1);
|
||||
assertTrue(pakete.setAktivesPaket(0));
|
||||
assertTrue(pakete.getAktivesPaket()==0);
|
||||
|
@@ -31,6 +31,7 @@ import javax.imageio.ImageIO;
|
||||
* - 0.png
|
||||
* - ...
|
||||
* - 31.png
|
||||
* - 32.png (Rückseite)
|
||||
*
|
||||
* @author Sebastian Kacza
|
||||
*
|
||||
@@ -118,9 +119,9 @@ public class Texturenpaket {
|
||||
try {
|
||||
File zipDatei = new File(pfad);
|
||||
ZipFile paketDatei = new ZipFile(zipDatei);
|
||||
Image Bilder[] = new Image[32];
|
||||
Image Bilder[] = new Image[33];
|
||||
|
||||
for(int i = 0; i < 32; i++) {
|
||||
for(int i = 0; i < 33; i++) {
|
||||
ZipEntry zipInhaltTextur = paketDatei.getEntry(i+".png");
|
||||
InputStream eingabeStromTextur = paketDatei.getInputStream(zipInhaltTextur);
|
||||
Bilder[i] = ImageIO.read(eingabeStromTextur);
|
||||
@@ -197,7 +198,7 @@ public class Texturenpaket {
|
||||
}
|
||||
|
||||
//Texturen Prüfen
|
||||
for(int i = 0; i < 32; i++) {
|
||||
for(int i = 0; i < 33; i++) {
|
||||
ZipEntry zipInhaltTextur = paketDatei.getEntry(i+".png");
|
||||
InputStream eingabeStromTextur = paketDatei.getInputStream(zipInhaltTextur);
|
||||
Image bild = ImageIO.read(eingabeStromTextur);
|
||||
|
@@ -106,7 +106,7 @@ public class Texturenpakete {
|
||||
* @return Textur als Image
|
||||
*/
|
||||
public Image getTextur(int KartenNr) {
|
||||
if((KartenNr >= 0) && (KartenNr < 32)) {
|
||||
if((KartenNr >= 0) && (KartenNr < 33)) {
|
||||
return Texturen[KartenNr];
|
||||
}
|
||||
return null;
|
||||
|
@@ -45,7 +45,7 @@ public class Spiel_GUI extends JPanel implements ActionListener {
|
||||
panel_main.setLayout(new BoxLayout(panel_main, BoxLayout.X_AXIS));
|
||||
|
||||
|
||||
texturen.addPaket("StandartTexturenBeta2.zip");
|
||||
texturen.addPaket("StandartTexturenBeta3.zip");
|
||||
texturen.setAktivesPaket(0);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user