Begin der Implementierung der Texturen Packet Klasse + Testklassen
This commit is contained in:
23
src/de/jaujau/daten/TEST_Texturenpaket.java
Executable file
23
src/de/jaujau/daten/TEST_Texturenpaket.java
Executable file
@@ -0,0 +1,23 @@
|
||||
package de.jaujau.daten;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class TEST_Texturenpaket {
|
||||
|
||||
private Texturenpaket paket;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() throws Exception {
|
||||
paket = new Texturenpaket("/home/sebastian/testpacket.zip");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void PacketLaden() {
|
||||
assertTrue(paket.ladePacket());
|
||||
}
|
||||
|
||||
}
|
22
src/de/jaujau/daten/TEST_Texturenpakete.java
Executable file
22
src/de/jaujau/daten/TEST_Texturenpakete.java
Executable file
@@ -0,0 +1,22 @@
|
||||
package de.jaujau.daten;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class TEST_Texturenpakete {
|
||||
|
||||
private Texturenpakete pakete;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() throws Exception {
|
||||
pakete = new Texturenpakete();
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
63
src/de/jaujau/daten/Texturenpaket.java
Executable file
63
src/de/jaujau/daten/Texturenpaket.java
Executable file
@@ -0,0 +1,63 @@
|
||||
package de.jaujau.daten;
|
||||
|
||||
import java.awt.Image;
|
||||
|
||||
/**
|
||||
* Verwaltet ein Texturenpackt
|
||||
* @author Sebastian Kacza
|
||||
*
|
||||
*/
|
||||
public class Texturenpaket {
|
||||
|
||||
private final String name;
|
||||
private final int level;
|
||||
private final String pfad;
|
||||
|
||||
|
||||
/**
|
||||
* Erstellt ein neues Texturenpackt
|
||||
* @param Pfad zu der Zip-Datei des Texturenpacketes
|
||||
*/
|
||||
public Texturenpaket(String Pfad) {
|
||||
name = "Nicht geladen";
|
||||
level = 0;
|
||||
pfad = Pfad;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Läd die Packetinformationen und Testet das Packet auf Vollständigkeit
|
||||
* @return Paket vollständig laden, true/false
|
||||
*/
|
||||
public boolean ladePacket() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt ein Bild das dem Texturenpacket zurück
|
||||
* @param KartenID der Textur
|
||||
* @return Image der Textur
|
||||
*/
|
||||
public Image getTextur(int KartenID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt den Namen des Texturenpacket zurück
|
||||
* @return Name des Texturenpacketes
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt den Level Wert zurück der mindestens Benötigt wird um das Packet zu benutzten
|
||||
* @return Mindest Level
|
||||
*/
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
}
|
@@ -2,11 +2,15 @@ package de.jaujau.daten;
|
||||
|
||||
|
||||
/**
|
||||
* Diese Klasse Verwaltet die Texturen des Spiel
|
||||
* Diese Klasse Verwaltet die Texturenpackete des Spiels
|
||||
* @author Sebastian Kacza
|
||||
*/
|
||||
public class Texturenpakete {
|
||||
|
||||
public Texturenpakete(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user