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