Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Mohammad Hawrami | 5b81b633c9 | |
Mohammad Hawrami | d56b8a1710 |
|
@ -4,7 +4,7 @@ This is the "BlockTest" file from Author: Philipp Kotte
|
||||||
written on: 10 / 10 / 2023 at: 21:17
|
written on: 10 / 10 / 2023 at: 21:17
|
||||||
============================================================
|
============================================================
|
||||||
*/
|
*/
|
||||||
package Test.Domain.Block;
|
package Domain.Block;
|
||||||
|
|
||||||
import Domain.Block.Block;
|
import Domain.Block.Block;
|
||||||
import Domain.Block.Blockeintrag;
|
import Domain.Block.Blockeintrag;
|
|
@ -10,7 +10,7 @@ import Domain.Spieler;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class Blockeintrag {
|
class Blockeintrag {
|
||||||
private int punkte;
|
private int punkte;
|
||||||
private int stiche;
|
private int stiche;
|
||||||
private Spieler id;
|
private Spieler id;
|
||||||
|
|
|
@ -4,9 +4,8 @@ This is the "BlockeintragTest" file from Author: Philipp Kotte
|
||||||
written on: 10 / 10 / 2023 at: 21:17
|
written on: 10 / 10 / 2023 at: 21:17
|
||||||
============================================================
|
============================================================
|
||||||
*/
|
*/
|
||||||
package Test.Domain.Block;
|
package Domain.Block;
|
||||||
|
|
||||||
import Domain.Block.Blockeintrag;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
import static junit.framework.TestCase.assertEquals;
|
|
@ -8,7 +8,7 @@ package Domain.Block;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Blockzeile {
|
class Blockzeile {
|
||||||
|
|
||||||
/*------------------------------------------*/
|
/*------------------------------------------*/
|
||||||
// statische Konstanten
|
// statische Konstanten
|
||||||
|
|
|
@ -4,7 +4,7 @@ This is the "BlockzeileTest" file from Author: Philipp Kotte
|
||||||
written on: 10 / 10 / 2023 at: 21:17
|
written on: 10 / 10 / 2023 at: 21:17
|
||||||
============================================================
|
============================================================
|
||||||
*/
|
*/
|
||||||
package Test.Domain.Block;
|
package Domain.Block;
|
||||||
|
|
||||||
import Domain.Block.Block;
|
import Domain.Block.Block;
|
||||||
import Domain.Block.Blockeintrag;
|
import Domain.Block.Blockeintrag;
|
|
@ -47,14 +47,22 @@ public class Stich {
|
||||||
this.spielerID = new int[spielerAnzahl];
|
this.spielerID = new int[spielerAnzahl];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSpielerAnzahl(){
|
||||||
|
return spielerID.length;
|
||||||
|
}
|
||||||
|
|
||||||
public Karte[] getKarten() {
|
public Karte[] getKarten() {
|
||||||
return this.karten;
|
return this.karten;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addKarte(int spielerID, Karte karte) {
|
public void addKarte(int spielerID, Karte karte) {
|
||||||
this.karten[kartenCount] = karte;
|
if (kartenCount > getSpielerAnzahl()){
|
||||||
this.spielerID[kartenCount] = spielerID;
|
throw new IndexOutOfBoundsException("Karten-Index überschreitet die Anzahl der Spieler");
|
||||||
kartenCount++;
|
}else {
|
||||||
|
this.karten[kartenCount] = karte;
|
||||||
|
this.spielerID[kartenCount] = spielerID;
|
||||||
|
kartenCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------*/
|
/*------------------------------------------*/
|
||||||
|
@ -67,7 +75,6 @@ public class Stich {
|
||||||
for (int i = 0; i < this.karten.length; i++) {
|
for (int i = 0; i < this.karten.length; i++) {
|
||||||
text += this.karten[i].toString();
|
text += this.karten[i].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue