diff --git a/StandartTexturenBeta.zip b/StandartTexturenBeta.zip deleted file mode 100755 index 5cb8166..0000000 Binary files a/StandartTexturenBeta.zip and /dev/null differ diff --git a/StandartTexturenBeta2.zip b/StandartTexturenBeta2.zip deleted file mode 100755 index bfd2aa5..0000000 Binary files a/StandartTexturenBeta2.zip and /dev/null differ diff --git a/src/de/jaujau/UnitTests/TEST_TexturenpaketIntern.java b/src/de/jaujau/UnitTests/TEST_TexturenpaketIntern.java new file mode 100755 index 0000000..9630ef5 --- /dev/null +++ b/src/de/jaujau/UnitTests/TEST_TexturenpaketIntern.java @@ -0,0 +1,33 @@ +package de.jaujau.UnitTests; + +import static org.junit.jupiter.api.Assertions.*; + +import java.awt.Image; + +import org.junit.jupiter.api.Test; +import de.jaujau.daten.TexturenpaketIntern; + +class TEST_TexturenpaketIntern { + + private TexturenpaketIntern paket; + + @Test + void FehlerFreiesPaketLaden() { + paket = new TexturenpaketIntern("/img/texturen/standart", "TestPaket", 0); + assertTrue(paket.ladePacket()); + System.out.println("Name des Texturen Paketes: " + paket.getName()); + System.out.println("Level des Texturen Paketes: " + paket.getLevel()); + } + + + @Test + void TexturenAusgeben() { + paket = new TexturenpaketIntern("/img/texturen/standart", "TestPaket", 0); + assertTrue(paket.ladePacket()); + Image Bilder[] = paket.getTexturen(); + for(int i = 0; i < 33; i++) { + assertTrue(Bilder[i] != null); + } + } + +} diff --git a/src/de/jaujau/UnitTests/TEST_Texturenpakete.java b/src/de/jaujau/UnitTests/TEST_Texturenpakete.java index a156059..9226772 100755 --- a/src/de/jaujau/UnitTests/TEST_Texturenpakete.java +++ b/src/de/jaujau/UnitTests/TEST_Texturenpakete.java @@ -16,18 +16,36 @@ class TEST_Texturenpakete { pakete = new Texturenpakete(); } + @Test - void test() { - assertTrue(pakete.getAnzahlPakete()==0); - assertTrue(pakete.addPaket("StandartTexturenBeta3.zip")); + void InternesPaket() { assertTrue(pakete.getAnzahlPakete()==1); + //assertTrue(pakete.addPaket("StandartTexturenBeta3.zip")); + //assertTrue(pakete.getAnzahlPakete()==2); assertTrue(pakete.setAktivesPaket(0)); assertTrue(pakete.getAktivesPaket()==0); + System.out.println("Test Intern"); System.out.println("Paket Name: " + pakete.getName(0)); System.out.println("Paket Level: " + pakete.getLevel(0)); for(int i = 0; i < 32; i++) { assertTrue(pakete.getTextur(i)!=null); } + } + + + @Test + void ExternesPaket() { + assertTrue(pakete.getAnzahlPakete()==1); + assertTrue(pakete.addPaket("StandartTexturenBeta3.zip")); + assertTrue(pakete.getAnzahlPakete()==2); + assertTrue(pakete.setAktivesPaket(1)); + assertTrue(pakete.getAktivesPaket()==1); + System.out.println("Test Extern"); + System.out.println("Paket Name: " + pakete.getName(1)); + System.out.println("Paket Level: " + pakete.getLevel(1)); + for(int i = 0; i < 32; i++) { + assertTrue(pakete.getTextur(i)!=null); + } } } diff --git a/src/de/jaujau/daten/Texturenpaket.java b/src/de/jaujau/daten/Texturenpaket.java index c641c76..1946087 100755 --- a/src/de/jaujau/daten/Texturenpaket.java +++ b/src/de/jaujau/daten/Texturenpaket.java @@ -38,8 +38,8 @@ import javax.imageio.ImageIO; */ public class Texturenpaket { - private String name; - private int level; + protected String name; //Protektet weil die abgeleitet Klasse TexturenpaketIntern auf die Werte zugreifen können muss + protected int level; private final String pfad; diff --git a/src/de/jaujau/daten/TexturenpaketIntern.java b/src/de/jaujau/daten/TexturenpaketIntern.java new file mode 100755 index 0000000..a445af9 --- /dev/null +++ b/src/de/jaujau/daten/TexturenpaketIntern.java @@ -0,0 +1,61 @@ +package de.jaujau.daten; + +import java.awt.Image; +import java.io.IOException; +import javax.imageio.ImageIO; + + +/** + * Klasse für Interne Texturen Pakete deren Bilddaten sich die direkt im jar Archiv befinden + * ein Internes Paket muss NICHT geladen werden befor es genutz werden kann! + * Interne Pakete werden NICHT auf vollständigkeit geprüft! + * @author Sebastian Kacza + * + */ +public class TexturenpaketIntern extends Texturenpaket{ + + public String pfad; + + + /** + * Erstelt ein Neues Internes Texturenpaket + * @param Pfad Interner Pfad du den Bilddateien z.b. /img/texturen/standart + * @param Name Name des Paketes + * @param Level Minideslevel des Paketes + */ + public TexturenpaketIntern(String Pfad ,String Name, int Level) { + super(Pfad); + name = Name; + level = Level; + pfad = Pfad; + } + + + /** + * Das laden der Daten eines Internet Paket ist nicht notwendig! + */ + @Override + public boolean ladePacket() { + return true; + } + + + /** + * Gibt alle Bilddatein von dem Texturenpaket als Image Array zurück + * @return Image Array der Texturen des Paketes + */ + @Override + public Image[] getTexturen() { + Image Bilder[] = new Image[33]; + for(int i = 0; i < 33; i++) { + try { + Bilder[i] = ImageIO.read(getClass().getResource(pfad +"/" + i + ".png")); + } catch (IOException e) { + Bilder[i] = null; + e.printStackTrace(); + } + } + return Bilder; + } + +} diff --git a/src/de/jaujau/daten/Texturenpakete.java b/src/de/jaujau/daten/Texturenpakete.java index 5ecad56..4580fd2 100644 --- a/src/de/jaujau/daten/Texturenpakete.java +++ b/src/de/jaujau/daten/Texturenpakete.java @@ -16,6 +16,11 @@ public class Texturenpakete { public Texturenpakete(){ TexturenpaketListe = new ArrayList(); + + //Hinzufügen eines Internen Texturenpaketes + TexturenpaketListe.add(new TexturenpaketIntern("/img/texturen/standart", "JauJau Standart Texturen Französisch", 0)); + + //Internes Texturenpaket als Aktiv festlegen AktivesPaket = 0; } diff --git a/src/img/texturen/standart/0.png b/src/img/texturen/standart/0.png new file mode 100755 index 0000000..266a545 Binary files /dev/null and b/src/img/texturen/standart/0.png differ diff --git a/src/img/texturen/standart/1.png b/src/img/texturen/standart/1.png new file mode 100755 index 0000000..103de3f Binary files /dev/null and b/src/img/texturen/standart/1.png differ diff --git a/src/img/texturen/standart/10.png b/src/img/texturen/standart/10.png new file mode 100755 index 0000000..ac9a762 Binary files /dev/null and b/src/img/texturen/standart/10.png differ diff --git a/src/img/texturen/standart/11.png b/src/img/texturen/standart/11.png new file mode 100755 index 0000000..987c6d3 Binary files /dev/null and b/src/img/texturen/standart/11.png differ diff --git a/src/img/texturen/standart/12.png b/src/img/texturen/standart/12.png new file mode 100755 index 0000000..adc2a27 Binary files /dev/null and b/src/img/texturen/standart/12.png differ diff --git a/src/img/texturen/standart/13.png b/src/img/texturen/standart/13.png new file mode 100755 index 0000000..c952223 Binary files /dev/null and b/src/img/texturen/standart/13.png differ diff --git a/src/img/texturen/standart/14.png b/src/img/texturen/standart/14.png new file mode 100755 index 0000000..9bf22b0 Binary files /dev/null and b/src/img/texturen/standart/14.png differ diff --git a/src/img/texturen/standart/15.png b/src/img/texturen/standart/15.png new file mode 100755 index 0000000..84c9475 Binary files /dev/null and b/src/img/texturen/standart/15.png differ diff --git a/src/img/texturen/standart/16.png b/src/img/texturen/standart/16.png new file mode 100755 index 0000000..6d15332 Binary files /dev/null and b/src/img/texturen/standart/16.png differ diff --git a/src/img/texturen/standart/17.png b/src/img/texturen/standart/17.png new file mode 100755 index 0000000..cbddba8 Binary files /dev/null and b/src/img/texturen/standart/17.png differ diff --git a/src/img/texturen/standart/18.png b/src/img/texturen/standart/18.png new file mode 100755 index 0000000..7b93eff Binary files /dev/null and b/src/img/texturen/standart/18.png differ diff --git a/src/img/texturen/standart/19.png b/src/img/texturen/standart/19.png new file mode 100755 index 0000000..43d1bba Binary files /dev/null and b/src/img/texturen/standart/19.png differ diff --git a/src/img/texturen/standart/2.png b/src/img/texturen/standart/2.png new file mode 100755 index 0000000..13c5d11 Binary files /dev/null and b/src/img/texturen/standart/2.png differ diff --git a/src/img/texturen/standart/20.png b/src/img/texturen/standart/20.png new file mode 100755 index 0000000..a2bb12d Binary files /dev/null and b/src/img/texturen/standart/20.png differ diff --git a/src/img/texturen/standart/21.png b/src/img/texturen/standart/21.png new file mode 100755 index 0000000..3793b23 Binary files /dev/null and b/src/img/texturen/standart/21.png differ diff --git a/src/img/texturen/standart/22.png b/src/img/texturen/standart/22.png new file mode 100755 index 0000000..3863fcb Binary files /dev/null and b/src/img/texturen/standart/22.png differ diff --git a/src/img/texturen/standart/23.png b/src/img/texturen/standart/23.png new file mode 100755 index 0000000..9803663 Binary files /dev/null and b/src/img/texturen/standart/23.png differ diff --git a/src/img/texturen/standart/24.png b/src/img/texturen/standart/24.png new file mode 100755 index 0000000..98e46dd Binary files /dev/null and b/src/img/texturen/standart/24.png differ diff --git a/src/img/texturen/standart/25.png b/src/img/texturen/standart/25.png new file mode 100755 index 0000000..efda077 Binary files /dev/null and b/src/img/texturen/standart/25.png differ diff --git a/src/img/texturen/standart/26.png b/src/img/texturen/standart/26.png new file mode 100755 index 0000000..c73bd19 Binary files /dev/null and b/src/img/texturen/standart/26.png differ diff --git a/src/img/texturen/standart/27.png b/src/img/texturen/standart/27.png new file mode 100755 index 0000000..0862be5 Binary files /dev/null and b/src/img/texturen/standart/27.png differ diff --git a/src/img/texturen/standart/28.png b/src/img/texturen/standart/28.png new file mode 100755 index 0000000..b10c1b1 Binary files /dev/null and b/src/img/texturen/standart/28.png differ diff --git a/src/img/texturen/standart/29.png b/src/img/texturen/standart/29.png new file mode 100755 index 0000000..55a6973 Binary files /dev/null and b/src/img/texturen/standart/29.png differ diff --git a/src/img/texturen/standart/3.png b/src/img/texturen/standart/3.png new file mode 100755 index 0000000..2eb5cb4 Binary files /dev/null and b/src/img/texturen/standart/3.png differ diff --git a/src/img/texturen/standart/30.png b/src/img/texturen/standart/30.png new file mode 100755 index 0000000..cbc585e Binary files /dev/null and b/src/img/texturen/standart/30.png differ diff --git a/src/img/texturen/standart/31.png b/src/img/texturen/standart/31.png new file mode 100755 index 0000000..887b152 Binary files /dev/null and b/src/img/texturen/standart/31.png differ diff --git a/src/img/texturen/standart/32.png b/src/img/texturen/standart/32.png new file mode 100755 index 0000000..5125077 Binary files /dev/null and b/src/img/texturen/standart/32.png differ diff --git a/src/img/texturen/standart/4.png b/src/img/texturen/standart/4.png new file mode 100755 index 0000000..63fa650 Binary files /dev/null and b/src/img/texturen/standart/4.png differ diff --git a/src/img/texturen/standart/5.png b/src/img/texturen/standart/5.png new file mode 100755 index 0000000..3cc6c95 Binary files /dev/null and b/src/img/texturen/standart/5.png differ diff --git a/src/img/texturen/standart/6.png b/src/img/texturen/standart/6.png new file mode 100755 index 0000000..0c85319 Binary files /dev/null and b/src/img/texturen/standart/6.png differ diff --git a/src/img/texturen/standart/7.png b/src/img/texturen/standart/7.png new file mode 100755 index 0000000..3f9cf96 Binary files /dev/null and b/src/img/texturen/standart/7.png differ diff --git a/src/img/texturen/standart/8.png b/src/img/texturen/standart/8.png new file mode 100755 index 0000000..75aa27c Binary files /dev/null and b/src/img/texturen/standart/8.png differ diff --git a/src/img/texturen/standart/9.png b/src/img/texturen/standart/9.png new file mode 100755 index 0000000..ff3332d Binary files /dev/null and b/src/img/texturen/standart/9.png differ