Kartenstapel constructor fertig.
parent
206ae7ce76
commit
d217fc84e8
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -1,4 +1,14 @@
|
||||||
package de.hs_mannheim.informatik.blackjack;
|
package de.hs_mannheim.informatik.blackjack;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Hand {
|
public class Hand {
|
||||||
|
|
||||||
|
ArrayList<Karte> hand = new ArrayList<>();
|
||||||
|
|
||||||
|
Hand(Kartenstapel ks){
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package de.hs_mannheim.informatik.blackjack;
|
||||||
public class Kartenstapel {
|
public class Kartenstapel {
|
||||||
Karte[] kartenstapel = new Karte[52];
|
Karte[] kartenstapel = new Karte[52];
|
||||||
|
|
||||||
private Kartenstapel(){
|
Kartenstapel(){
|
||||||
int t= 2;
|
int t= 2;
|
||||||
|
|
||||||
for(int i = 0; i< 9; i++){
|
for(int i = 0; i< 9; i++){
|
||||||
|
@ -28,31 +28,26 @@ public class Kartenstapel {
|
||||||
kartenstapel[i] = new Karte("Karo", "" + t);
|
kartenstapel[i] = new Karte("Karo", "" + t);
|
||||||
t++;
|
t++;
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
kartenstapel[36] = new Karte("Kreuz", "Bube");
|
||||||
|
kartenstapel[37] = new Karte("Kreuz", "Dame");
|
||||||
|
kartenstapel[38] = new Karte("Kreuz", "König");
|
||||||
|
kartenstapel[39] = new Karte("Kreuz", "Ass");
|
||||||
|
|
||||||
for(int i = 36; i< 40; i++){
|
kartenstapel[40] = new Karte("Pik", "Bube");
|
||||||
kartenstapel[i] = new Karte("Kreuz", "" + t);
|
kartenstapel[41] = new Karte("Pik", "Dame");
|
||||||
t++;
|
kartenstapel[42] = new Karte("Pik", "König");
|
||||||
}
|
kartenstapel[43] = new Karte("Pik", "Ass");
|
||||||
t=1;
|
|
||||||
|
|
||||||
for (int i = 40; i < 44; i++) {
|
kartenstapel[44] = new Karte("Herz", "Bube");
|
||||||
kartenstapel[i] = new Karte("Pik", "" + t);
|
kartenstapel[45] = new Karte("Herz", "Dame");
|
||||||
t++;
|
kartenstapel[46] = new Karte("Herz", "König");
|
||||||
}
|
kartenstapel[47] = new Karte("Herz", "Ass");
|
||||||
t=1;
|
|
||||||
|
|
||||||
for (int i = 44; i < 48; i++) {
|
kartenstapel[48] = new Karte("Karo", "Bube");
|
||||||
kartenstapel[i] = new Karte("Herz", "" + t);
|
kartenstapel[49] = new Karte("Karo", "Dame");
|
||||||
t++;
|
kartenstapel[50] = new Karte("Karo", "König");
|
||||||
}
|
kartenstapel[51] = new Karte("Karo", "Ass");
|
||||||
t=1;
|
|
||||||
|
|
||||||
for (int i = 48; i < 52; i++) {
|
|
||||||
kartenstapel[i] = new Karte("Karo", "" + t);
|
|
||||||
t++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue