Skip to content
Snippets Groups Projects
Commit 3636ac62 authored by Kjetil Karstensen Indrehus's avatar Kjetil Karstensen Indrehus
Browse files

fix: general linting

parent b2e8393a
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,9 @@ public class Hand {
*/
public PlayingCard findCard(char suit, int face){
return this.hand.stream().filter(card -> card.getSuit()==suit && card.getFace()==face).findAny().orElse(null);
return this.hand.stream().filter(card -> card.getSuit()==suit && card.getFace()==face)
.findAny()
.orElse(null);
}
/**
......
......@@ -3,10 +3,14 @@ package no.ntnu.cardgame;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import no.ntnu.cardgame.Backend.*;
import java.net.URL;
......@@ -21,6 +25,7 @@ public class Controller implements Initializable {
private static final String CARD_TYPE_ROOT_URL = "no\\ntnu\\cardgame\\img\\cards\\";
/* FXML fields */
@FXML
private TextField txtHand;
......@@ -51,12 +56,17 @@ public class Controller implements Initializable {
@FXML
private ImageView cardfive;
/* Stats Tab*/
@FXML
private Tab statsTab;
/* Constructor for the controller*/
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
deck = new DeckOfCards();
buttonCheckHand.setDisable(true);
statsTab.setDisable(true);
}
/* Methods */
......@@ -117,6 +127,7 @@ public class Controller implements Initializable {
cardfour.setImage(backCard);
cardfive.setImage(backCard);
buttonCheckHand.setDisable(true);
statsTab.setDisable(true);
}
......@@ -140,6 +151,7 @@ public class Controller implements Initializable {
txtHearts.setText(result.toString());
}
buttonCheckHand.setDisable(true);
statsTab.setDisable(false);
}
......
......@@ -32,23 +32,37 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<BorderPane minHeight="500.0" minWidth="500.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.cardgame.Controller">
<center>
<AnchorPane maxHeight="727.0" maxWidth="1055.0" minHeight="727.0" minWidth="1055.0" prefHeight="727.0" prefWidth="1055.0">
<TabPane tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab text="CARDS">
<content>
<BorderPane>
<center>
<AnchorPane maxHeight="727.0" maxWidth="1055.0" minHeight="651.0" minWidth="1055.0" prefHeight="651.0" prefWidth="1055.0">
<children>
<Button fx:id="buttonDealHand" layoutX="806.0" layoutY="451.0" mnemonicParsing="false" onAction="#onDealHand" prefHeight="25.0" prefWidth="101.0" text="Deal Hand" AnchorPane.bottomAnchor="251.0" AnchorPane.rightAnchor="148.0" />
<Button fx:id="buttonDealHand" layoutX="810.0" layoutY="448.0" mnemonicParsing="false" onAction="#onDealHand" prefHeight="25.0" prefWidth="101.0" text="Deal Hand" AnchorPane.bottomAnchor="178.66666666666669" AnchorPane.rightAnchor="143.9999999999999" />
<ImageView fitHeight="150.0" fitWidth="309.0" layoutX="388.0" layoutY="31.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="546.0" AnchorPane.leftAnchor="388.0" AnchorPane.rightAnchor="441.8592834472656" AnchorPane.topAnchor="31.0">
<image>
<Image url="@img/fixedImg/card-set.jpg" />
......@@ -89,6 +103,48 @@
</children>
</AnchorPane>
</center>
</BorderPane>
</content>
</Tab>
<Tab fx:id="statsTab" text="STATS">
<content>
<BorderPane>
<center>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<LineChart fx:id="stats" layoutX="59.0" layoutY="52.0" prefHeight="515.0" prefWidth="528.0">
<xAxis>
<CategoryAxis side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis side="LEFT" />
</yAxis>
</LineChart>
<CheckBox layoutX="671.0" layoutY="160.0" mnemonicParsing="false" prefHeight="71.0" prefWidth="151.0" text="Has hearts">
<font>
<Font size="21.0" />
</font>
</CheckBox>
<CheckBox layoutX="668.0" layoutY="214.0" mnemonicParsing="false" prefHeight="71.0" prefWidth="151.0" text="CheckBox">
<font>
<Font size="21.0" />
</font>
</CheckBox>
<ProgressIndicator fx:id="flushIndicator" layoutX="675.0" layoutY="127.0" progress="0.0" />
<Label layoutX="722.0" layoutY="128.0" text="Flush x/5">
<font>
<Font name="System Bold" size="21.0" />
</font>
</Label>
</children>
</AnchorPane>
</center>
</BorderPane>
</content>
</Tab>
</tabs>
</TabPane>
</center>
<top>
<MenuBar prefHeight="25.0" prefWidth="1055.0" BorderPane.alignment="CENTER">
<menus>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment