Commit 8af57797 authored by Brigitt Gyamfi Bright's avatar Brigitt Gyamfi Bright
Browse files

Added more cards to the viewer

parent 61ce8d3c
......@@ -28,7 +28,7 @@ public class Controller{
@FXML public Label doYouHavereqCardDisplay ;
@FXML public Button submitReq;
@FXML public TextField cardValue;
@FXML public ImageView card1, card2, card3, card4, card5;
@FXML public ImageView card1, card2, card3, card4, card5,card6, card7, card8, card9, card10 ;
@FXML public Label info;
@FXML public Label info1;
@FXML public Label info2;
......@@ -52,6 +52,11 @@ public class Controller{
cardImages.add(card3);
cardImages.add(card4);
cardImages.add(card5);
cardImages.add(card6);
cardImages.add(card7);
cardImages.add(card8);
cardImages.add(card9);
cardImages.add(card10);
for(int i = 0; i < cardsAtHand.getCardsAtHandAsCards().size(); i++){
card = cardsAtHand.getCardsAtHandAsCards().get(i);
......
......@@ -12,7 +12,7 @@ public class Hand {
char c;
public Hand() {
cardsAtHand = new ArrayList<>(5);
cardsAtHand = new ArrayList<>(10);
}
/**
......@@ -39,6 +39,8 @@ public class Hand {
cardsAtHand.addAll(deck.dealHand(2));
} else if (cardsAtHand.size() == 4) {
cardsAtHand.addAll(deck.dealHand(1));
}else if(cardsAtHand.size() < 10){
cardsAtHand.addAll(deck.dealHand(1));
}else {
clearHand();
}
......@@ -114,7 +116,7 @@ public class Hand {
* @return true if they are, false if they are not
*/
public boolean flush() {
Map<Character, Long> characterLongMap = new HashMap<>();
Map<Character, Long> characterLongMap;
characterLongMap = cardsAtHand.stream().collect(Collectors.groupingBy(PlayingCard::getSuit, Collectors.counting()));
for (Map.Entry<Character, Long> pair : characterLongMap.entrySet()) {
......
......@@ -14,11 +14,11 @@
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="440.0" prefWidth="522.0" style="-fx-background-color: #052a40#052a40;">
<children>
<ImageView fx:id="card3" fitHeight="121.0" fitWidth="95.0" layoutX="197.0" layoutY="147.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card1" fitHeight="81.0" fitWidth="56.0" layoutX="34.0" layoutY="168.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card5" fitHeight="84.0" fitWidth="56.0" layoutX="387.0" layoutY="169.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card2" fitHeight="106.0" fitWidth="70.0" layoutX="110.0" layoutY="159.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card4" fitHeight="95.0" fitWidth="70.0" layoutX="300.0" layoutY="160.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card3" fitHeight="76.0" fitWidth="50.0" layoutX="207.0" layoutY="133.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card1" fitHeight="76.0" fitWidth="50.0" layoutX="74.0" layoutY="133.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card5" fitHeight="76.0" fitWidth="50.0" layoutX="337.0" layoutY="133.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card2" fitHeight="76.0" fitWidth="50.0" layoutX="141.0" layoutY="133.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card4" fitHeight="76.0" fitWidth="50.0" layoutX="272.0" layoutY="133.0" pickOnBounds="true" preserveRatio="true" />
<Label fx:id="flushDisplay" layoutX="170.0" layoutY="78.0" prefHeight="42.0" prefWidth="165.0" text="Flush!" textFill="#cb79b9">
<font>
<Font name="Hiragino Sans W9" size="37.0" />
......@@ -67,6 +67,11 @@
<Label fx:id="info" layoutX="145.0" layoutY="155.0" prefHeight="17.0" prefWidth="193.0" text="Press 'Deal hand' to start the game" textFill="WHITE" />
<Label fx:id="info1" layoutX="99.0" layoutY="182.0" prefHeight="17.0" prefWidth="288.0" text="Follow up by pressing 'Check hand' to update scores" textFill="WHITE" />
<Label fx:id="info2" layoutX="106.0" layoutY="207.0" prefHeight="17.0" prefWidth="275.0" text="alternate between the two, for continuous updates" textFill="WHITE" />
<ImageView fx:id="card6" fitHeight="76.0" fitWidth="50.0" layoutX="74.0" layoutY="226.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card10" fitHeight="76.0" fitWidth="50.0" layoutX="337.0" layoutY="226.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card9" fitHeight="76.0" fitWidth="50.0" layoutX="272.0" layoutY="226.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card8" fitHeight="76.0" fitWidth="50.0" layoutX="207.0" layoutY="226.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="card7" fitHeight="76.0" fitWidth="50.0" layoutX="141.0" layoutY="226.0" pickOnBounds="true" preserveRatio="true" />
</children>
</AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="391.0" prefWidth="120.0" style="-fx-background-color: #cb79b9#cb79b9;">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment