Commit 7ca9d1b4 authored by Darth Vernon's avatar Darth Vernon

GUI improvements

parent a1df916a
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
<?import javafx.scene.control.ChoiceBox?> <?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="BSMain"> <Pane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="749.0" prefWidth="1054.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="BSMain">
<children> <children>
...@@ -12,16 +15,272 @@ ...@@ -12,16 +15,272 @@
<children> <children>
<AnchorPane layoutY="6.0" prefHeight="749.0" prefWidth="1054.0"> <AnchorPane layoutY="6.0" prefHeight="749.0" prefWidth="1054.0">
<children> <children>
<ChoiceBox fx:id="DPx" layoutY="575.0" prefHeight="28.0" prefWidth="184.0" /> <ChoiceBox fx:id="DPx" layoutX="164.0" layoutY="617.0" prefHeight="28.0" prefWidth="184.0" />
<ChoiceBox fx:id="shipSelection" layoutY="603.0" prefHeight="28.0" prefWidth="184.0" /> <ChoiceBox fx:id="shipSelection" layoutX="164.0" layoutY="645.0" prefHeight="28.0" prefWidth="184.0" />
<Label fx:id="admiral" layoutX="8.0" layoutY="558.0" prefHeight="17.0" prefWidth="734.0" text="Admiral Nutsey : &quot;Place your ships Captain!!!&quot;" /> <Label fx:id="admiral" layoutX="165.0" layoutY="600.0" prefHeight="17.0" prefWidth="734.0" text="Admiral Nutsey : &quot;Place your ships Captain!!!&quot;" />
<ChoiceBox fx:id="DPy" layoutX="184.0" layoutY="575.0" prefHeight="28.0" prefWidth="184.0" /> <ChoiceBox fx:id="DPy" layoutX="348.0" layoutY="617.0" prefHeight="28.0" prefWidth="184.0" />
<Label fx:id="error" alignment="CENTER" contentDisplay="CENTER" layoutX="552.0" layoutY="604.0" prefHeight="28.0" prefWidth="184.0" text="Stage : Preperation" textAlignment="JUSTIFY" wrapText="true" /> <Label fx:id="error" alignment="CENTER" contentDisplay="CENTER" layoutX="348.0" layoutY="645.0" prefHeight="28.0" prefWidth="184.0" text="Stage : Preperation" textAlignment="JUSTIFY" wrapText="true" />
<Button fx:id="place" layoutX="368.0" layoutY="575.0" mnemonicParsing="false" onAction="#placeAction" prefHeight="28.0" prefWidth="184.0" text="*PLACE A SHIP*" textAlignment="CENTER" /> <Button fx:id="place" layoutX="716.0" layoutY="617.0" mnemonicParsing="false" onAction="#placeAction" prefHeight="28.0" prefWidth="184.0" text="*PLACE A SHIP*" textAlignment="CENTER" />
<Button fx:id="fire" layoutX="552.0" layoutY="575.0" mnemonicParsing="false" onAction="#fireAction" prefHeight="28.0" prefWidth="184.0" text="*FIRE*" /> <Button fx:id="fire" layoutX="532.0" layoutY="617.0" mnemonicParsing="false" onAction="#fireAction" prefHeight="28.0" prefWidth="184.0" text="*FIRE*" />
<Button fx:id="quit" layoutX="184.0" layoutY="605.0" mnemonicParsing="false" onAction="#quitAction" prefHeight="25.0" prefWidth="184.0" text="*QUIT*" /> <Button fx:id="quit" layoutX="532.0" layoutY="646.0" mnemonicParsing="false" onAction="#quitAction" prefHeight="25.0" prefWidth="184.0" text="*QUIT*" />
<Button fx:id="battleStage" layoutX="368.0" layoutY="605.0" mnemonicParsing="false" onAction="#stageAction" prefHeight="25.0" prefWidth="184.0" text="*BATTLE STAGE*" /> <Button fx:id="battleStage" layoutX="716.0" layoutY="646.0" mnemonicParsing="false" onAction="#stageAction" prefHeight="25.0" prefWidth="184.0" text="*BATTLE STAGE*" />
<Label fx:id="status" layoutX="8.0" layoutY="631.0" prefHeight="25.0" prefWidth="455.0" text="Status : NO HITS" /> <Label fx:id="status" layoutX="165.0" layoutY="673.0" prefHeight="25.0" prefWidth="455.0" text="Status : NO HITS" />
<GridPane gridLinesVisible="true" layoutX="8.0" layoutY="20.0" prefHeight="552.0" prefWidth="501.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label fx:id="p9B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="1" />
<Label fx:id="p5G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="6" />
<Label fx:id="p2A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" />
<Label fx:id="p3A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" />
<Label fx:id="p4A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" />
<Label fx:id="p5A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" />
<Label fx:id="p6A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" />
<Label fx:id="p7A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" />
<Label fx:id="p8A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" />
<Label fx:id="p9A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" />
<Label fx:id="p0B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="1" />
<Label fx:id="p1B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="p2B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label fx:id="p3B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Label fx:id="p4B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label fx:id="p5B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<Label fx:id="p6B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="1" />
<Label fx:id="p7B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<Label fx:id="p8B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="1" />
<Label fx:id="p9C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="2" />
<Label fx:id="p8C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="2" />
<Label fx:id="p7C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="2" />
<Label fx:id="p6C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="2" />
<Label fx:id="p5C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<Label fx:id="p4C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label fx:id="p3C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label fx:id="p2C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label fx:id="p1C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="p0C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="2" />
<Label fx:id="p8J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="9" />
<Label fx:id="p1F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label fx:id="p9D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="3" />
<Label fx:id="p8D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="3" />
<Label fx:id="p7D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="3" />
<Label fx:id="p6D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="3" />
<Label fx:id="p5D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="3" />
<Label fx:id="p4D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="3" />
<Label fx:id="p3D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label fx:id="p2D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label fx:id="p1D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="p0D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="3" />
<Label fx:id="p0E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="4" />
<Label fx:id="p1E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label fx:id="p2E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<Label fx:id="p3E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="4" />
<Label fx:id="p4E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="4" />
<Label fx:id="p5E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="4" />
<Label fx:id="p6E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="4" />
<Label fx:id="p7E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="4" />
<Label fx:id="p8E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="4" />
<Label fx:id="p9E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="4" />
<Label fx:id="p0F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="5" />
<Label fx:id="p2F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<Label fx:id="p3F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="5" />
<Label fx:id="p4F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="5" />
<Label fx:id="p5F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="5" />
<Label fx:id="p6F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="5" />
<Label fx:id="p7F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="5" />
<Label fx:id="p8F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="5" />
<Label fx:id="p9F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="5" />
<Label fx:id="p0G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="6" />
<Label fx:id="p1G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Label fx:id="p2G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label fx:id="p3G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="6" />
<Label fx:id="p4G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="6" />
<Label fx:id="p6G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="6" />
<Label fx:id="p7G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="6" />
<Label fx:id="p8G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="6" />
<Label fx:id="p9G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="6" />
<Label fx:id="p0H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="7" />
<Label fx:id="p1H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<Label fx:id="p2H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="7" />
<Label fx:id="p3H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="7" />
<Label fx:id="p4H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="7" />
<Label fx:id="p5H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="7" />
<Label fx:id="p6H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="7" />
<Label fx:id="p7H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="7" />
<Label fx:id="p8H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="7" />
<Label fx:id="p9H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="7" />
<Label fx:id="p0I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="8" />
<Label fx:id="p1A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" />
<Label fx:id="p1I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<Label fx:id="p2I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="8" />
<Label fx:id="p3I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="8" />
<Label fx:id="p4I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="8" />
<Label fx:id="p5I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="8" />
<Label fx:id="p6I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="8" />
<Label fx:id="p7I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="8" />
<Label fx:id="p8I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="8" />
<Label fx:id="p7J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="9" />
<Label fx:id="p6J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="9" />
<Label fx:id="p5J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="9" />
<Label fx:id="p4J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="9" />
<Label fx:id="p3J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="9" />
<Label fx:id="p2J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="9" />
<Label fx:id="p1J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<Label fx:id="p0J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="9" />
<Label fx:id="p9I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="8" />
<Label fx:id="p9J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="9" />
<Label fx:id="p0A" layoutX="460.0" layoutY="342.0" prefHeight="74.0" prefWidth="66.0" text="Label" />
</children>
</GridPane>
<GridPane gridLinesVisible="true" layoutX="532.0" layoutY="20.0" prefHeight="552.0" prefWidth="501.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label fx:id="c9B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="1" />
<Label fx:id="c5G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="6" />
<Label fx:id="c2A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" />
<Label fx:id="c3A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" />
<Label fx:id="c4A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" />
<Label fx:id="c5A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" />
<Label fx:id="c6A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" />
<Label fx:id="c7A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" />
<Label fx:id="c8A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" />
<Label fx:id="c9A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" />
<Label fx:id="c0B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="1" />
<Label fx:id="c1B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="c2B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label fx:id="c3B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<Label fx:id="c4B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label fx:id="c5B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<Label fx:id="c6B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="1" />
<Label fx:id="c7B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="1" />
<Label fx:id="c8B" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="1" />
<Label fx:id="c9C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="2" />
<Label fx:id="c8C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="2" />
<Label fx:id="c7C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="2" />
<Label fx:id="c6C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="2" />
<Label fx:id="c5C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="2" />
<Label fx:id="c4C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label fx:id="c3C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<Label fx:id="c2C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label fx:id="c1C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="c0C" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="2" />
<Label fx:id="c8J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="9" />
<Label fx:id="c1F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label fx:id="c9D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="3" />
<Label fx:id="c8D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="3" />
<Label fx:id="c7D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="3" />
<Label fx:id="c6D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="3" />
<Label fx:id="c5D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="3" />
<Label fx:id="c4D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="3" />
<Label fx:id="c3D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label fx:id="c2D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label fx:id="c1D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="c0D" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="3" />
<Label fx:id="c0E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="4" />
<Label fx:id="c1E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label fx:id="c2E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<Label fx:id="c3E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="4" />
<Label fx:id="c4E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="4" />
<Label fx:id="c5E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="4" />
<Label fx:id="c6E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="4" />
<Label fx:id="c7E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="4" />
<Label fx:id="c8E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="4" />
<Label fx:id="c9E" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="4" />
<Label fx:id="c0F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="5" />
<Label fx:id="c2F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="5" />
<Label fx:id="c3F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="5" />
<Label fx:id="c4F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="5" />
<Label fx:id="c5F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="5" />
<Label fx:id="c6F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="5" />
<Label fx:id="c7F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="5" />
<Label fx:id="c8F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="5" />
<Label fx:id="c9F" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="5" />
<Label fx:id="c0G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="6" />
<Label fx:id="c1G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Label fx:id="c2G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label fx:id="c3G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="6" />
<Label fx:id="c4G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="6" />
<Label fx:id="c6G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="6" />
<Label fx:id="c7G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="6" />
<Label fx:id="c8G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="6" />
<Label fx:id="c9G" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="6" />
<Label fx:id="c0H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="7" />
<Label fx:id="c1H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="7" />
<Label fx:id="c2H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="7" />
<Label fx:id="c3H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="7" />
<Label fx:id="c4H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="7" />
<Label fx:id="c5H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="7" />
<Label fx:id="c6H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="7" />
<Label fx:id="c7H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="7" />
<Label fx:id="c8H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="7" />
<Label fx:id="c9H" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="7" />
<Label fx:id="c0I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="8" />
<Label fx:id="c1A" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" />
<Label fx:id="c1I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<Label fx:id="c2I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="8" />
<Label fx:id="c3I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="8" />
<Label fx:id="c4I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="8" />
<Label fx:id="c5I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="8" />
<Label fx:id="c6I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="8" />
<Label fx:id="c7I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="8" />
<Label fx:id="c8I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="8" GridPane.rowIndex="8" />
<Label fx:id="c7J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="7" GridPane.rowIndex="9" />
<Label fx:id="c6J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="6" GridPane.rowIndex="9" />
<Label fx:id="c5J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="5" GridPane.rowIndex="9" />
<Label fx:id="c4J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="9" />
<Label fx:id="c3J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="3" GridPane.rowIndex="9" />
<Label fx:id="c2J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="2" GridPane.rowIndex="9" />
<Label fx:id="c1J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<Label fx:id="c0J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.rowIndex="9" />
<Label fx:id="c9I" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="8" />
<Label fx:id="c9J" prefHeight="57.0" prefWidth="55.0" text="Label" GridPane.columnIndex="9" GridPane.rowIndex="9" />
<Label fx:id="c0A" layoutX="460.0" layoutY="342.0" prefHeight="67.0" prefWidth="53.0" text="Label" />
</children>
</GridPane>
</children> </children>
</AnchorPane> </AnchorPane>
</children> </children>
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElementDecl.GLOBAL;
import javafx.application.Application; import javafx.application.Application;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
...@@ -10,6 +14,7 @@ import javafx.fxml.FXML; ...@@ -10,6 +14,7 @@ import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox; import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label; import javafx.scene.control.Label;
...@@ -20,6 +25,7 @@ import javafx.stage.Stage; ...@@ -20,6 +25,7 @@ import javafx.stage.Stage;
public class BSMain extends Application{ public class BSMain extends Application{
@FXML public ChoiceBox<String> DPx; @FXML public ChoiceBox<String> DPx;
@FXML public ChoiceBox<String> DPy; @FXML public ChoiceBox<String> DPy;
@FXML public ChoiceBox<String> shipSelection; @FXML public ChoiceBox<String> shipSelection;
...@@ -34,6 +40,237 @@ public class BSMain extends Application{ ...@@ -34,6 +40,237 @@ public class BSMain extends Application{
@FXML public Label admiral; @FXML public Label admiral;
@FXML public Label status; @FXML public Label status;
@FXML public Label p0A;
@FXML public Label p1A;
@FXML public Label p2A;
@FXML public Label p3A;
@FXML public Label p4A;
@FXML public Label p5A;
@FXML public Label p6A;
@FXML public Label p7A;
@FXML public Label p8A;
@FXML public Label p9A;
@FXML public Label c0A;
@FXML public Label c1A;
@FXML public Label c2A;
@FXML public Label c3A;
@FXML public Label c4A;
@FXML public Label c5A;
@FXML public Label c6A;
@FXML public Label c7A;
@FXML public Label c8A;
@FXML public Label c9A;
@FXML public Label p0B;
@FXML public Label p1B;
@FXML public Label p2B;
@FXML public Label p3B;
@FXML public Label p4B;
@FXML public Label p5B;
@FXML public Label p6B;
@FXML public Label p7B;
@FXML public Label p8B;
@FXML public Label p9B;
@FXML public Label c0B;
@FXML public Label c1B;
@FXML public Label c2B;
@FXML public Label c3B;
@FXML public Label c4B;
@FXML public Label c5B;
@FXML public Label c6B;
@FXML public Label c7B;
@FXML public Label c8B;
@FXML public Label c9B;
@FXML public Label p0C;
@FXML public Label p1C;
@FXML public Label p2C;
@FXML public Label p3C;
@FXML public Label p4C;
@FXML public Label p5C;
@FXML public Label p6C;
@FXML public Label p7C;
@FXML public Label p8C;
@FXML public Label p9C;
@FXML public Label c0C;
@FXML public Label c1C;
@FXML public Label c2C;
@FXML public Label c3C;
@FXML public Label c4C;
@FXML public Label c5C;
@FXML public Label c6C;
@FXML public Label c7C;
@FXML public Label c8C;
@FXML public Label c9C;
@FXML public Label p0D;
@FXML public Label p1D;
@FXML public Label p2D;
@FXML public Label p3D;
@FXML public Label p4D;
@FXML public Label p5D;
@FXML public Label p6D;
@FXML public Label p7D;
@FXML public Label p8D;
@FXML public Label p9D;
@FXML public Label c0D;
@FXML public Label c1D;
@FXML public Label c2D;
@FXML public Label c3D;
@FXML public Label c4D;
@FXML public Label c5D;
@FXML public Label c6D;
@FXML public Label c7D;
@FXML public Label c8D;
@FXML public Label c9D;
@FXML public Label p0F;
@FXML public Label p1F;
@FXML public Label p2F;
@FXML public Label p3F;
@FXML public Label p4F;
@FXML public Label p5F;
@FXML public Label p6F;
@FXML public Label p7F;
@FXML public Label p8F;
@FXML public Label p9F;
@FXML public Label c0F;
@FXML public Label c1F;
@FXML public Label c2F;
@FXML public Label c3F;
@FXML public Label c4F;
@FXML public Label c5F;
@FXML public Label c6F;
@FXML public Label c7F;
@FXML public Label c8F;
@FXML public Label c9F;
@FXML public Label p0E;
@FXML public Label p1E;
@FXML public Label p2E;
@FXML public Label p3E;
@FXML public Label p4E;
@FXML public Label p5E;
@FXML public Label p6E;
@FXML public Label p7E;
@FXML public Label p8E;
@FXML public Label p9E;
@FXML public Label c0E;
@FXML public Label c1E;
@FXML public Label c2E;
@FXML public Label c3E;
@FXML public Label c4E;
@FXML public Label c5E;
@FXML public Label c6E;
@FXML public Label c7E;
@FXML public Label c8E;
@FXML public Label c9E;
@FXML public Label p0G;
@FXML public Label p1G;
@FXML public Label p2G;
@FXML public Label p3G;
@FXML public Label p4G;
@FXML public Label p5G;
@FXML public Label p6G;
@FXML public Label p7G;
@FXML public Label p8G;
@FXML public Label p9G;
@FXML public Label c0G;
@FXML public Label c1G;
@FXML public Label c2G;
@FXML public Label c3G;
@FXML public Label c4G;
@FXML public Label c5G;
@FXML public Label c6G;
@FXML public Label c7G;
@FXML public Label c8G;
@FXML public Label c9G;
@FXML public Label p0H;
@FXML public Label p1H;
@FXML public Label p2H;
@FXML public Label p3H;
@FXML public Label p4H;
@FXML public Label p5H;
@FXML public Label p6H;
@FXML public Label p7H;
@FXML public Label p8H;
@FXML public Label p9H;
@FXML public Label c0H;
@FXML public Label c1H;
@FXML public Label c2H;
@FXML public Label c3H;
@FXML public Label c4H;
@FXML public Label c5H;
@FXML public Label c6H;
@FXML public Label c7H;
@FXML public Label c8H;
@FXML public Label c9H;
@FXML public Label p0I;
@FXML public Label p1I;
@FXML public Label p2I;
@FXML public Label p3I;
@FXML public Label p4I;
@FXML public Label p5I;
@FXML public Label p6I;
@FXML public Label p7I;
@FXML public Label p8I;
@FXML public Label p9I;
@FXML public Label c0I;
@FXML public Label c1I;
@FXML public Label c2I;
@FXML public Label c3I;
@FXML public Label c4I;
@FXML public Label c5I;
@FXML public Label c6I;
@FXML public Label c7I;
@FXML public Label c8I;
@FXML public Label c9I;
@FXML public Label p0J;
@FXML public Label p1J;
@FXML public Label p2J;
@FXML public Label p3J;
@FXML public Label p4J;
@FXML public Label p5J;
@FXML public Label p6J;
@FXML public Label p7J;
@FXML public Label p8J;
@FXML public Label p9J;
@FXML public Label c0J;
@FXML public Label c1J;
@FXML public Label c2J;
@FXML public Label c3J;
@FXML public Label c4J;
@FXML public Label c5J;
@FXML public Label c6J;
@FXML public Label c7J;
@FXML public Label c8J;
@FXML public Label c9J;
@FXML Label computerLabels[] = {c0A,c0B,c0C,c0D,c0E,c0F,c0G,c0H,c0I,c0J,c1A,c1B,c1C,c1D,c1E,c1F,c1G,c1H,c1I,c1J,c2A,c2B,c2C,c2D,c2E,c2F,c2G,c2H,c2I,c2J,
c3A,c3B,c3C,c3D,c3E,c3F,c3G,c3H,c3I,c3J,c4A,c4B,c4C,c4D,c4E,c4F,c4G,c4H,c4I,c4J
,c5A,c5B,c5C,c5D,c5E,c5F,c5G,c5H,c5I,c5J,c6A,c6B,c6C,c6D,c6E,c6F,c6G,c6H,c6I,c6J,c7A,c7B,c7C,c7D,c7E,c7F,c7G,c7H,c7I,c7J,c8A,c8B,c8C,c8D,c8E,c8F,c8G,c8H,c8I,c8J,
c9A,c9B,c9C,c9D,c9E,c9F,c9G,c9H,c9I,c9J};
@FXML Label playerLabels[] = {p0A,p0B,p0C,p0D,p0E,p0F,p0G,p0H,p0I,p0J,p1A,p1B,p1C,p1D,p1E,p1F,p1G,p1H,p1I,p1J,p2A,p2B,p2C,p2D,p2E,p2F,p2G,p2H,p2I,p2J,
p3A,p3B,p3C,p3D,p3E,p3F,p3G,p3H,p3I,p3J,p4A,p4B,p4C,p4D,p4E,p4F,p4G,p4H,p4I,p4J
,p5A,p5B,p5C,p5D,p5E,p5F,p5G,p5H,p5I,p5J,p6A,p6B,p6C,p6D,p6E,p6F,p6G,p6H,p6I,p6J,p7A,p7B,p7C,p7D,p7E,p7F,p7G,p7H,p7I,p7J,p8A,p8B,p8C,p8D,p8E,p8F,p8G,p8H,p8I,p8J,
p9A,p9B,p9C,p9D,p9E,p9F,p9G,p9H,p9I,p9J};
ObservableList<String> numbrz = FXCollections.observableArrayList("0","1","2","3","4","5","6","7","8","9"); ObservableList<String> numbrz = FXCollections.observableArrayList("0","1","2","3","4","5","6","7","8","9");
ObservableList<String> ltrz = FXCollections.observableArrayList("A","B","C","D","E","F","G","H","I","J"); ObservableList<String> ltrz = FXCollections.observableArrayList("A","B","C","D","E","F","G","H","I","J");
static ObservableList<String> ships= FXCollections.observableArrayList("Aircraft", "BattleShip","BattleShip Two", "Destroyer One" , "Destroyer Two", "Patrol Boat One" , static ObservableList<String> ships= FXCollections.observableArrayList("Aircraft", "BattleShip","BattleShip Two", "Destroyer One" , "Destroyer Two", "Patrol Boat One" ,
...@@ -63,6 +300,7 @@ public class BSMain extends Application{ ...@@ -63,6 +300,7 @@ public class BSMain extends Application{
Scene scene = new Scene(root, 300, 275); Scene scene = new Scene(root, 300, 275);
scene.setRoot(root); scene.setRoot(root);
arg0.setTitle("Battleships"); arg0.setTitle("Battleships");
arg0.setScene(scene); arg0.setScene(scene);
...@@ -80,7 +318,7 @@ public class BSMain extends Application{ ...@@ -80,7 +318,7 @@ public class BSMain extends Application{
DPy.getItems().addAll(ltrz); DPy.getItems().addAll(ltrz);
shipSelection.getItems().addAll(ships); shipSelection.getItems().addAll(ships);
DPx.getSelectionModel().selectedItemProperty().addListener((ObservableValue, oldValue, newValue) -> { DPx.getSelectionModel().selectedItemProperty().addListener((ObservableValue, oldValue, newValue) -> {
x=(newValue.toString()); x=(newValue.toString());
...@@ -103,8 +341,11 @@ public class BSMain extends Application{ ...@@ -103,8 +341,11 @@ public class BSMain extends Application{
if (stage0) { if (stage0) {
playerS.ShipPlacer(playerS,ship, x, y);
admiral.setText("Admiral Nutsey: Ship placed at " + x + y); admiral.setText("Admiral Nutsey: Ship placed at " + (playerS.ShipPlacer(playerS,ship, x, y).toString()) );
if (!playerG.MoveValidCheck(playerG, playerS.moves, playerS, ship)){ if (!playerG.MoveValidCheck(playerG, playerS.moves, playerS, ship)){
admiral.setText("Admiral Nutsey: Space occupied"); admiral.setText("Admiral Nutsey: Space occupied");
...@@ -138,8 +379,13 @@ public class BSMain extends Application{ ...@@ -138,8 +379,13 @@ public class BSMain extends Application{
String CmptrMove = (String) ComputerInput.CoOrdRandomiser().get(0) String CmptrMove = (String) ComputerInput.CoOrdRandomiser().get(0)
+ (String) ComputerInput.CoOrdRandomiser().get(1); + (String) ComputerInput.CoOrdRandomiser().get(1);
playerB.fire(computerS, HmnMove); if (playerB.fire(computerS, HmnMove)) {
computerB.fire(playerS, CmptrMove); admiral.setText(BattleClass.ShipCheck(HmnMove, computerS));
}
if (computerB.fire(playerS, CmptrMove)) {
admiral.setText(BattleClass.ShipCheck(CmptrMove, playerS));
}
status.setText("Computer status: " + computerS.allMoves.size() + " Player Status: " + playerS.allMoves.size()); status.setText("Computer status: " + computerS.allMoves.size() + " Player Status: " + playerS.allMoves.size());
} }
...@@ -175,6 +421,7 @@ public class BSMain extends Application{ ...@@ -175,6 +421,7 @@ public class BSMain extends Application{
ComputerInput.cmptrMoveGen(); ComputerInput.cmptrMoveGen();
launch(args); launch(args);
......
...@@ -5,37 +5,34 @@ public class BattleClass { ...@@ -5,37 +5,34 @@ public class BattleClass {
public void fire ( ShipClass opponent, String Coordinates) { public Boolean fire ( ShipClass opponent, String Coordinates) {
Boolean hit = false;
if(opponent.allMoves.contains(Coordinates)) { if(opponent.allMoves.contains(Coordinates)) {
System.out.println("Hit on " + Coordinates); System.out.println("Hit on " + Coordinates);
opponent.allMoves.remove(Coordinates); opponent.allMoves.remove(Coordinates);
ShipCheck(Coordinates, opponent); hit = true;
}
else {
System.out.println("Miss at " + Coordinates );
} }
return hit;
} }
public void ShipCheck(String coordinates, ShipClass opponent) { public static String ShipCheck(String coordinates, ShipClass opponent) {
String response = "Hit on " + coordinates;
if (opponent.aC.contains(coordinates)) { if (opponent.aC.contains(coordinates)) {
opponent.aC.remove(coordinates); opponent.aC.remove(coordinates);
if (opponent.aC.isEmpty()) { if (opponent.aC.isEmpty()) {
System.out.println("Aircarft one is sunk!"); response = ("Aircarft one is sunk!");
} }
} }
...@@ -44,7 +41,7 @@ public class BattleClass { ...@@ -44,7 +41,7 @@ public class BattleClass {
opponent.bS.remove(coordinates); opponent.bS.remove(coordinates);
if (opponent.bS.isEmpty()) { if (opponent.bS.isEmpty()) {
System.out.println("BattleShip one is sunk!"); response = ("BattleShip one is sunk!");
} }
} }
...@@ -53,7 +50,7 @@ public class BattleClass { ...@@ -53,7 +50,7 @@ public class BattleClass {
opponent.bS2.remove(coordinates); opponent.bS2.remove(coordinates);
if (opponent.bS2.isEmpty()) { if (opponent.bS2.isEmpty()) {
System.out.println("Battleship two is sunk!"); response = ("Battleship two is sunk!");
} }
} }
...@@ -62,7 +59,7 @@ public class BattleClass { ...@@ -62,7 +59,7 @@ public class BattleClass {
opponent.dS.remove(coordinates); opponent.dS.remove(coordinates);
if (opponent.dS.isEmpty()) { if (opponent.dS.isEmpty()) {
System.out.println("Destroyer one is sunk!"); response = ("Destroyer one is sunk!");
} }
} }
...@@ -71,7 +68,7 @@ public class BattleClass { ...@@ -71,7 +68,7 @@ public class BattleClass {
opponent.dS2.remove(coordinates); opponent.dS2.remove(coordinates);
if (opponent.dS2.isEmpty()) { if (opponent.dS2.isEmpty()) {
System.out.println("Destroyer two is sunk!"); response = ("Destroyer two is sunk!");
} }
} }
...@@ -80,7 +77,7 @@ public class BattleClass { ...@@ -80,7 +77,7 @@ public class BattleClass {
opponent.pB.remove(coordinates); opponent.pB.remove(coordinates);
if (opponent.pB.isEmpty()) { if (opponent.pB.isEmpty()) {
System.out.println("Patrol boat one is sunk!"); response = ("Patrol boat one is sunk!");
} }
} }
...@@ -89,7 +86,7 @@ public class BattleClass { ...@@ -89,7 +86,7 @@ public class BattleClass {
opponent.pB2.remove(coordinates); opponent.pB2.remove(coordinates);
if (opponent.pB2.isEmpty()) { if (opponent.pB2.isEmpty()) {
System.out.println("Patrol boat two is sunk!"); response = ("Patrol boat two is sunk!");
} }
} }
...@@ -98,9 +95,10 @@ public class BattleClass { ...@@ -98,9 +95,10 @@ public class BattleClass {
opponent.pB3.remove(coordinates); opponent.pB3.remove(coordinates);
if (opponent.pB3.isEmpty()) { if (opponent.pB3.isEmpty()) {
System.out.println("Patrol boat three is sunk!"); response = ("Patrol boat three is sunk!");
} }
} }
return response;
} }
......
...@@ -27,6 +27,8 @@ public class ComputerInput { ...@@ -27,6 +27,8 @@ public class ComputerInput {
String x = (String) CoOrdRandomiser().get(0); String x = (String) CoOrdRandomiser().get(0);
String y = (String) CoOrdRandomiser().get(1); String y = (String) CoOrdRandomiser().get(1);
BSMain.computerS.ShipPlacer(BSMain.computerS,BSMain.ships.get(i),x,y); BSMain.computerS.ShipPlacer(BSMain.computerS,BSMain.ships.get(i),x,y);
......
...@@ -32,7 +32,7 @@ public class ShipClass { ...@@ -32,7 +32,7 @@ public class ShipClass {
String name; String name;
public void ShipPlacer (ShipClass plyr ,String shipType, String x, String y) { public ArrayList ShipPlacer (ShipClass plyr ,String shipType, String x, String y) {
...@@ -175,7 +175,8 @@ public class ShipClass { ...@@ -175,7 +175,8 @@ public class ShipClass {
System.out.println("Type of ship not valid or already placed for that type"); System.out.println("Type of ship not valid or already placed for that type");
} }
return moves;
} }
} }
......
Markdown is supported
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