Finished TravelGUI and StartGUI

This commit is contained in:
2019-03-09 23:26:25 -07:00
parent 80102eabee
commit 75673d40e1
6 changed files with 1084 additions and 189 deletions

2
.idea/misc.xml generated
View File

@@ -9,7 +9,7 @@
<component name="ProjectKey"> <component name="ProjectKey">
<option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" /> <option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_201" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_141" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="SvnBranchConfigurationManager"> <component name="SvnBranchConfigurationManager">

643
.idea/workspace.xml generated
View File

@@ -1,12 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="BookmarkManager">
<bookmark url="file://$PROJECT_DIR$/src/ShipWarfareGUI.java" line="590" />
</component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment=""> <list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="Added some logic to ShipWarfareGUI">
<change afterPath="$PROJECT_DIR$/src/StartGUI.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/TravelGUI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ShopGUI" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShopGUI.java" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/out/" /> <ignored path="$PROJECT_DIR$/out/" />
<ignored path="C:\Users\Harkamal Randhawa\IdeaProjects\TaipanClone\.idea\shelf/" /> <ignored path="C:\Users\Harkamal Randhawa\IdeaProjects\TaipanClone\.idea\shelf/" />
<ignored path="$PROJECT_DIR$/.idea/shelf/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -16,36 +23,92 @@
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java"> <entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5025"> <state relative-caret-position="279">
<caret line="353" column="100" selection-end-line="503" /> <caret line="682" selection-start-line="682" selection-end-line="682" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="e#763#794#0" expanded="true" />
<element signature="e#1208#1209#0" expanded="true" />
<element signature="e#1236#1237#0" expanded="true" />
<element signature="e#17682#17683#0" expanded="true" />
<element signature="e#17720#17721#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java"> <entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2580"> <state relative-caret-position="117">
<caret line="172" column="5" selection-start-line="172" selection-start-column="5" selection-end-line="172" selection-end-column="5" /> <caret line="458" selection-start-line="458" selection-end-line="466" selection-end-column="11" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1150#1151#0" expanded="true" /> <element signature="e#1879#2020#0" />
<element signature="e#1178#1179#0" expanded="true" /> <element signature="e#2026#2140#0" />
<element signature="e#2026#2268#0" />
<element signature="e#2274#2524#0" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#2887#0" />
<element signature="e#2663#3001#0" />
<element signature="e#3007#3133#0" />
<element signature="e#3205#3412#0" />
<element signature="e#3205#3546#0" />
<element signature="e#3552#3676#0" />
<element signature="e#3746#3950#0" />
<element signature="e#3746#4079#0" />
<element signature="e#4022#4073#1" />
<element signature="e#4085#4209#0" />
<element signature="e#4279#4483#0" />
<element signature="e#4279#4612#0" />
<element signature="e#4618#4757#0" />
<element signature="e#4833#5046#0" />
<element signature="e#4833#5190#0" />
<element signature="e#5196#5297#0" />
<element signature="e#5196#7354#0" />
<element signature="e#10976#16179#0" />
<element signature="e#11276#11422#1" />
<element signature="e#11480#11600#1" />
<element signature="e#11645#11797#1" />
<element signature="e#12094#12214#1" />
<element signature="e#12258#12409#1" />
<element signature="e#12704#12824#1" />
<element signature="e#12867#13018#1" />
<element signature="e#13325#13445#1" />
<element signature="e#13704#16173#1" />
<element signature="e#13801#13949#1" />
<element signature="e#14007#14138#1" />
<element signature="e#14183#14336#1" />
<element signature="e#14624#14755#1" />
<element signature="e#14799#14951#1" />
<element signature="e#15237#15368#1" />
<element signature="class#20468:20804" />
<element signature="class#20968:21155" />
<element signature="class#21497:21689" />
<element signature="class#21854:22047" />
<element signature="class#22296:22485" />
<element signature="class#22689:22842" />
<element signature="class#23135:23794" />
<element signature="class#24032:24686" />
<element signature="class#24848:25502" />
<element signature="class#25837:26512" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main.java"> <entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135"> <state relative-caret-position="1564">
<caret line="9" column="4" selection-end-line="55" /> <caret line="95" column="19" selection-start-line="95" selection-start-column="19" selection-end-line="95" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@@ -53,22 +116,64 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Start.java"> <entry file="file://$PROJECT_DIR$/src/Start.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="51">
<caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" /> <caret line="3" selection-start-line="3" selection-end-line="35" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ShopGUI"> <entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2567">
<caret line="174" column="38" selection-start-line="174" selection-start-column="23" selection-end-line="174" selection-end-column="38" />
<folding>
<element signature="e#1244#1245#0" expanded="true" />
<element signature="e#1272#1273#0" expanded="true" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#3001#0" />
<element signature="e#6546#8362#1" />
<element signature="docComment;method#seaAtlas#0;class#TravelGUI#0" />
<element signature="method#seaAtlas#0;class#TravelGUI#0" />
<element signature="docComment;method#randomEventSea#0;class#TravelGUI#0" />
<element signature="method#randomEventSea#0;class#TravelGUI#0" />
<element signature="docComment;method#disaster#0;class#TravelGUI#0" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="230">
<caret line="147" column="20" selection-start-line="147" selection-start-column="20" selection-end-line="147" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#639#640#0" expanded="true" />
<element signature="e#667#668#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Player.java"> <entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135"> <state relative-caret-position="-1934">
<caret line="9" column="32" selection-start-line="9" selection-start-column="32" selection-end-line="9" selection-end-column="32" /> <caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="5" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-421">
<caret line="2" column="41" selection-start-line="2" selection-start-column="41" selection-end-line="2" selection-end-column="41" />
</state> </state>
</provider> </provider>
</entry> </entry>
@@ -78,54 +183,55 @@
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="JavaFXApplication" />
<option value="Class" /> <option value="Class" />
</list> </list>
</option> </option>
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>GetGuns</find> <find>setVisible</find>
<find>set</find> <find>button</find>
<find>TaipanShop</find> <find>textField</find>
<find>shop()</find> <find>quitButton</find>
<find>shop</find> <find>initial</find>
<find>being</find> <find>Text</find>
<find>label0</find> <find>TextField</find>
<find>hBox</find> <find>setTe</find>
<find>&lt;</find> <find>number</find>
<find>winO</find> <find>textOut</find>
<find>destroy</find> <find>text</find>
<find>get</find> <find>//</find>
<find>user</find> <find>defaultTextOut</find>
<find>setNumOfP</find> <find>getText</find>
<find>setUs</find> <find>numberInput</find>
<find>starting</find> <find>handle</find>
<find>destro</find> <find>event</find>
<find>numOfpeasantShips</find> <find>System.out.println(</find>
<find>startingPeasantShips</find> <find>Where</find>
<find>startingLittyShips</find> <find>sea</find>
<find>howMuchRun</find> <find>hon</find>
<find>pirateName</find> <find>setVis</find>
<find>player</find> <find>Tex</find>
<find>numOfPeasantShips</find> <find>VBox</find>
<find>peasant</find> <find>ToggleGroup</find>
<find>litty</find> <find>field</find>
<find>userAttacks</find> <find>startButton</find>
<find>numOfLittyShips</find> <find>visib</find>
<find>delay</find> <find>random</find>
<find>Hp</find> <find>quit</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>HP</replace> <replace>HP</replace>
<replace>p1.get</replace> <replace>p1.get</replace>
<replace>p1.set</replace> <replace>p1.set</replace>
<replace>shipWarfare.getHowMuchRun()</replace> <replace>//delayForSeconds</replace>
<replace>shipWarfare.isUserAttacks()</replace> <replace>textOut.setText(&quot; &quot; +</replace>
<replace>shipWarfare.getNumOfPeasantShips()</replace> <replace>textOut.setText(&quot; &quot; +</replace>
</replaceStrings> </replaceStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="UPDATE_TYPE" value="REBASE" /> <option name="UPDATE_TYPE" value="MERGE" />
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
@@ -133,29 +239,36 @@
<list> <list>
<option value="$PROJECT_DIR$/src/Core.java" /> <option value="$PROJECT_DIR$/src/Core.java" />
<option value="$PROJECT_DIR$/src/Game.java" /> <option value="$PROJECT_DIR$/src/Game.java" />
<option value="$PROJECT_DIR$/src/Start.java" />
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/Travel.java" />
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
<option value="$PROJECT_DIR$/src/Player.java" /> <option value="$PROJECT_DIR$/src/Player.java" />
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
<option value="$PROJECT_DIR$/src/Travel.java" />
<option value="$PROJECT_DIR$/src/GUI.java" />
<option value="$PROJECT_DIR$/src/fxmlControllers/shipFXML.java" />
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.fxml" />
<option value="$PROJECT_DIR$/src/ShipWarfare.java" /> <option value="$PROJECT_DIR$/src/ShipWarfare.java" />
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
<option value="$PROJECT_DIR$/src/main.java" />
<option value="$PROJECT_DIR$/src/Start.java" />
<option value="$PROJECT_DIR$/src/ShopGUI.java" />
<option value="$PROJECT_DIR$/src/TravelGUI.java" />
<option value="$PROJECT_DIR$/src/StartGUI.java" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="48" /> <option name="x" value="2279" />
<option name="y" value="23" /> <option name="y" value="264" />
<option name="width" value="1189" /> <option name="width" value="854" />
<option name="height" value="652" /> <option name="height" value="505" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView"> <component name="ProjectView">
<navigator proportions="" version="1"> <navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@@ -172,6 +285,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
</panes> </panes>
</component> </component>
@@ -179,9 +293,10 @@
<property name="ChangesTree.GroupingKeys" value="" /> <property name="ChangesTree.GroupingKeys" value="" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1552182988336" /> <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1552199149371" />
<property name="extract.method.default.visibility" value="private" /> <property name="extract.method.default.visibility" value="private" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../GitHub/Cpsc233" /> <property name="last_opened_file_path" value="$USER_HOME$/Documents/GitHub/Cpsc233" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Project" /> <property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
@@ -199,16 +314,9 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Application.main"> <component name="RunManager" selected="Application.StartGUI">
<configuration name="Game" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="GUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Game" /> <option name="MAIN_CLASS_NAME" value="GUI" />
<module name="TaipanClone" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ShipWarfare" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ShipWarfare" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
@@ -221,34 +329,41 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="TaipanShop" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="ShopGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TaipanShop" /> <option name="MAIN_CLASS_NAME" value="ShopGUI" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="StartGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="main" /> <option name="MAIN_CLASS_NAME" value="StartGUI" />
<module name="TaipanClone" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TravelGUI" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="TravelGUI" />
<module name="TaipanClone" /> <module name="TaipanClone" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<list> <list>
<item itemvalue="Application.ShipWarfare" /> <item itemvalue="Application.ShopGUI" />
<item itemvalue="Application.TaipanShop" />
<item itemvalue="Application.Game" />
<item itemvalue="Application.main" />
<item itemvalue="Application.ShipWarfareGUI" /> <item itemvalue="Application.ShipWarfareGUI" />
<item itemvalue="Application.GUI" />
<item itemvalue="Application.TravelGUI" />
<item itemvalue="Application.StartGUI" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.main" /> <item itemvalue="Application.StartGUI" />
<item itemvalue="Application.TravelGUI" />
<item itemvalue="Application.ShopGUI" />
<item itemvalue="Application.ShipWarfareGUI" /> <item itemvalue="Application.ShipWarfareGUI" />
<item itemvalue="Application.TaipanShop" /> <item itemvalue="Application.GUI" />
<item itemvalue="Application.Game" />
<item itemvalue="Application.ShipWarfare" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@@ -273,12 +388,11 @@
<workItem from="1550810552736" duration="1982000" /> <workItem from="1550810552736" duration="1982000" />
<workItem from="1550878072546" duration="2009000" /> <workItem from="1550878072546" duration="2009000" />
<workItem from="1551065104002" duration="1313000" /> <workItem from="1551065104002" duration="1313000" />
<workItem from="1551158469442" duration="4822000" /> <workItem from="1551158469442" duration="5961000" />
<workItem from="1552183127375" duration="5000" /> <workItem from="1551516759745" duration="56000" />
<workItem from="1552183173819" duration="43000" /> <workItem from="1552008296567" duration="595000" />
<workItem from="1552183247090" duration="42000" /> <workItem from="1552080169924" duration="15810000" />
<workItem from="1552183350012" duration="132000" /> <workItem from="1552165217689" duration="26528000" />
<workItem from="1552183501892" duration="5000" />
</task> </task>
<task id="LOCAL-00001" summary="This should fix the ShipWarfare file and bring it up to date with the rest of the file."> <task id="LOCAL-00001" summary="This should fix the ShipWarfare file and bring it up to date with the rest of the file.">
<created>1550458470138</created> <created>1550458470138</created>
@@ -357,59 +471,52 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1551162699319</updated> <updated>1551162699319</updated>
</task> </task>
<task id="LOCAL-00012" summary="Added time stuff to Shipwarfare GUI"> <task id="LOCAL-00012" summary="Fixed some little problems with documenting.">
<created>1552168801248</created> <created>1551163347576</created>
<option name="number" value="00012" /> <option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" /> <option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552168801248</updated> <updated>1551163347576</updated>
</task> </task>
<task id="LOCAL-00013" summary="Notified of getting attacked"> <task id="LOCAL-00013" summary="Fixed some little problems with documenting.">
<created>1552172956109</created> <created>1551163654726</created>
<option name="number" value="00013" /> <option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" /> <option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552172956109</updated> <updated>1551163654726</updated>
</task> </task>
<task id="LOCAL-00014" summary="Added fight stuff"> <task id="LOCAL-00014" summary="Basic layout for ShipwarefareGUI.">
<created>1552173216531</created> <created>1552166044309</created>
<option name="number" value="00014" /> <option name="number" value="00014" />
<option name="presentableId" value="LOCAL-00014" /> <option name="presentableId" value="LOCAL-00014" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552173216532</updated> <updated>1552166044309</updated>
</task> </task>
<task id="LOCAL-00015" summary="Made ShipWarfare easier to access by ShipWarfareGUI"> <task id="LOCAL-00015" summary="Added basic functionality with KahootChampion">
<created>1552181324520</created> <created>1552166883461</created>
<option name="number" value="00015" /> <option name="number" value="00015" />
<option name="presentableId" value="LOCAL-00015" /> <option name="presentableId" value="LOCAL-00015" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552181324520</updated> <updated>1552166883461</updated>
</task> </task>
<task id="LOCAL-00016" summary="Missed one statement that I needed to encapsulate"> <task id="LOCAL-00016" summary="Added some logic to ShipWarfareGUI">
<created>1552181613507</created> <created>1552167207982</created>
<option name="number" value="00016" /> <option name="number" value="00016" />
<option name="presentableId" value="LOCAL-00016" /> <option name="presentableId" value="LOCAL-00016" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1552181613507</updated> <updated>1552167207982</updated>
</task> </task>
<task id="LOCAL-00017" summary="Messed up player by setting money to 1000"> <option name="localTasksCounter" value="17" />
<created>1552181667375</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1552181667376</updated>
</task>
<option name="localTasksCounter" value="18" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="57306000" /> <option name="totallyTimeSpent" value="86614000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="48" y="23" width="1189" height="652" extended-state="0" /> <frame x="1672" y="264" width="1376" height="744" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.21621622" /> <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16945289" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" /> <window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" /> <window_info id="Designer" order="3" />
@@ -418,7 +525,7 @@
<window_info id="Favorites" order="6" side_tool="true" /> <window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32922733" /> <window_info anchor="bottom" id="Find" order="1" weight="0.32922733" />
<window_info anchor="bottom" id="Run" order="2" weight="0.4482143" /> <window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49924013" visible="true" weight="0.049099836" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -427,8 +534,8 @@
<window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49938875" weight="0.32922733" /> <window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49938875" weight="0.32922733" />
<window_info anchor="bottom" id="Database Changes" order="9" /> <window_info anchor="bottom" id="Database Changes" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" weight="0.32922733" /> <window_info anchor="bottom" id="Terminal" order="10" weight="0.32922733" />
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50061125" side_tool="true" weight="0.32922733" /> <window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.5007599" side_tool="true" weight="0.54664487" />
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32857144" /> <window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32922733" />
<window_info anchor="bottom" id="Duplicate detector" order="13" weight="0.32922733" /> <window_info anchor="bottom" id="Duplicate detector" order="13" weight="0.32922733" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" /> <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@@ -486,22 +593,6 @@
</list> </list>
</option> </option>
</component> </component>
<component name="Vcs.Log.Tabs.Properties">
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list />
</value>
</entry>
<entry key="User">
<value>
<list />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<ignored-roots> <ignored-roots>
<path value="$PROJECT_DIR$" /> <path value="$PROJECT_DIR$" />
@@ -517,14 +608,11 @@
<MESSAGE value="Fixed stupid problem where you can't access methods above yours" /> <MESSAGE value="Fixed stupid problem where you can't access methods above yours" />
<MESSAGE value="Brought back Vikram's changes" /> <MESSAGE value="Brought back Vikram's changes" />
<MESSAGE value="Fixed the commenting on a lot of the code. Also added some stuff to Travel, fixed some bugs." /> <MESSAGE value="Fixed the commenting on a lot of the code. Also added some stuff to Travel, fixed some bugs." />
<MESSAGE value="Added time stuff to Shipwarfare GUI" /> <MESSAGE value="Fixed some little problems with documenting." />
<MESSAGE value="Nitified of getting attacked" /> <MESSAGE value="Basic layout for ShipwarefareGUI." />
<MESSAGE value="Notified of getting attacked" /> <MESSAGE value="Added basic functionality with KahootChampion" />
<MESSAGE value="Added fight stuff" /> <MESSAGE value="Added some logic to ShipWarfareGUI" />
<MESSAGE value="Made ShipWarfare easier to access by ShipWarfareGUI" /> <option name="LAST_COMMIT_MESSAGE" value="Added some logic to ShipWarfareGUI" />
<MESSAGE value="Missed one statement that I needed to encapsulate" />
<MESSAGE value="Messed up player by setting money to 1000" />
<option name="LAST_COMMIT_MESSAGE" value="Messed up player by setting money to 1000" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="uml://JAVA/ShipWarfare"> <entry file="uml://JAVA/ShipWarfare">
@@ -566,62 +654,247 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/Game.java" /> <entry file="file://$PROJECT_DIR$/src/Game.java" />
<entry file="file://$PROJECT_DIR$/src/Warehouse.java" /> <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<entry file="file://$PROJECT_DIR$/src/Bank.java" /> <provider selected="true" editor-type-id="text-editor" />
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java" /> </entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java"> <entry file="file://$PROJECT_DIR$/src/Bank.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="27"> <state relative-caret-position="17">
<caret line="125" column="63" selection-start-line="125" selection-start-column="63" selection-end-line="125" selection-end-column="63" /> <caret line="7" column="6" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="3" selection-start-line="2" selection-start-column="3" selection-end-line="2" selection-end-column="3" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUIBase.java" />
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="715" column="22" selection-start-line="715" selection-start-column="12" selection-end-line="715" selection-end-column="22" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/javafx/application/Application.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="253" selection-start-line="253" selection-end-line="253" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/Battle.fxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="54" selection-start-line="13" selection-end-line="14" />
</state>
</provider>
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueJHare.fxml">
<provider selected="true" editor-type-id="text-editor" />
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueLRam.fxml">
<provider selected="true" editor-type-id="text-editor" />
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/fxmlController/Dialogue0Controller.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="method#handleButtonNext#0;class#Dialogue0Controller#0" />
<element signature="method#dialogue#0;class#Dialogue0Controller#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/Desktop/Shiv, Alex, Jovan and, Harkamal Final Project/Pandit/src/pandit/DialogueLJi.fxml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="15" lean-forward="true" selection-start-line="17" selection-start-column="15" selection-end-line="17" selection-end-column="15" />
</state>
</provider>
<provider editor-type-id="JavaFX-Scene-Builder" />
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.fxml" />
<entry file="file://$PROJECT_DIR$/src/GUI.java" />
<entry file="file://$PROJECT_DIR$/src/fxmlControllers/shopFXML.java" />
<entry file="file://$PROJECT_DIR$/src/fxmlControllers/shipFXML.java" />
<entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5508">
<caret line="324" column="43" selection-start-line="324" selection-start-column="43" selection-end-line="324" selection-end-column="43" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java"> <entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5025"> <state relative-caret-position="-986">
<caret line="353" column="100" selection-end-line="503" /> <caret line="22" column="34" lean-forward="true" selection-start-line="22" selection-start-column="34" selection-end-line="22" selection-end-column="34" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java"> <entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/javafx/event/EventHandler.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2580"> <state relative-caret-position="357">
<caret line="172" column="5" selection-start-line="172" selection-start-column="5" selection-end-line="172" selection-end-column="5" /> <caret line="44" column="9" selection-start-line="44" selection-start-column="9" selection-end-line="44" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1150#1151#0" expanded="true" />
<element signature="e#1178#1179#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShopGUI">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="32" selection-start-line="9" selection-start-column="32" selection-end-line="9" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Start.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="13" selection-start-line="1" selection-start-column="13" selection-end-line="1" selection-end-column="13" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/main.java"> <entry file="file://$PROJECT_DIR$/src/main.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135"> <state relative-caret-position="-421">
<caret line="9" column="4" selection-end-line="55" /> <caret line="2" column="41" selection-start-line="2" selection-start-column="41" selection-end-line="2" selection-end-column="41" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1934">
<caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="279">
<caret line="682" selection-start-line="682" selection-end-line="682" />
<folding>
<element signature="e#763#794#0" expanded="true" />
<element signature="e#1208#1209#0" expanded="true" />
<element signature="e#1236#1237#0" expanded="true" />
<element signature="e#17682#17683#0" expanded="true" />
<element signature="e#17720#17721#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="117">
<caret line="458" selection-start-line="458" selection-end-line="466" selection-end-column="11" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1879#2020#0" />
<element signature="e#2026#2140#0" />
<element signature="e#2026#2268#0" />
<element signature="e#2274#2524#0" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#2887#0" />
<element signature="e#2663#3001#0" />
<element signature="e#3007#3133#0" />
<element signature="e#3205#3412#0" />
<element signature="e#3205#3546#0" />
<element signature="e#3552#3676#0" />
<element signature="e#3746#3950#0" />
<element signature="e#3746#4079#0" />
<element signature="e#4022#4073#1" />
<element signature="e#4085#4209#0" />
<element signature="e#4279#4483#0" />
<element signature="e#4279#4612#0" />
<element signature="e#4618#4757#0" />
<element signature="e#4833#5046#0" />
<element signature="e#4833#5190#0" />
<element signature="e#5196#5297#0" />
<element signature="e#5196#7354#0" />
<element signature="e#10976#16179#0" />
<element signature="e#11276#11422#1" />
<element signature="e#11480#11600#1" />
<element signature="e#11645#11797#1" />
<element signature="e#12094#12214#1" />
<element signature="e#12258#12409#1" />
<element signature="e#12704#12824#1" />
<element signature="e#12867#13018#1" />
<element signature="e#13325#13445#1" />
<element signature="e#13704#16173#1" />
<element signature="e#13801#13949#1" />
<element signature="e#14007#14138#1" />
<element signature="e#14183#14336#1" />
<element signature="e#14624#14755#1" />
<element signature="e#14799#14951#1" />
<element signature="e#15237#15368#1" />
<element signature="class#20468:20804" />
<element signature="class#20968:21155" />
<element signature="class#21497:21689" />
<element signature="class#21854:22047" />
<element signature="class#22296:22485" />
<element signature="class#22689:22842" />
<element signature="class#23135:23794" />
<element signature="class#24032:24686" />
<element signature="class#24848:25502" />
<element signature="class#25837:26512" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1564">
<caret line="95" column="19" selection-start-line="95" selection-start-column="19" selection-end-line="95" selection-end-column="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Start.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" selection-start-line="3" selection-end-line="35" />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_141/javafx-src.zip!/com/sun/glass/ui/View.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4262">
<caret line="554" selection-start-line="554" selection-end-line="554" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2567">
<caret line="174" column="38" selection-start-line="174" selection-start-column="23" selection-end-line="174" selection-end-column="38" />
<folding>
<element signature="e#1244#1245#0" expanded="true" />
<element signature="e#1272#1273#0" expanded="true" />
<element signature="e#2274#2657#0" />
<element signature="e#2663#3001#0" />
<element signature="e#6546#8362#1" />
<element signature="docComment;method#seaAtlas#0;class#TravelGUI#0" />
<element signature="method#seaAtlas#0;class#TravelGUI#0" />
<element signature="docComment;method#randomEventSea#0;class#TravelGUI#0" />
<element signature="method#randomEventSea#0;class#TravelGUI#0" />
<element signature="docComment;method#disaster#0;class#TravelGUI#0" />
<element signature="e#31300#31833#0" />
<element signature="e#31843#32457#0" />
<element signature="e#32467#34046#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="230">
<caret line="147" column="20" selection-start-line="147" selection-start-column="20" selection-end-line="147" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#639#640#0" expanded="true" />
<element signature="e#667#668#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

View File

@@ -13,7 +13,6 @@ import javafx.geometry.Insets;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.shape.Rectangle; import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font; import javafx.scene.text.Font;
import java.util.Random; import java.util.Random;
public class ShopGUI extends Application { public class ShopGUI extends Application {
@@ -50,7 +49,7 @@ public class ShopGUI extends Application {
launch(args); launch(args);
} }
public void start(Stage stage){ public void start(Stage stage){
stage = initialize(stage); stage = initializeShop(stage);
updateStage(); updateStage();
updatePrices(); updatePrices();
stage.show(); stage.show();
@@ -363,7 +362,7 @@ public class ShopGUI extends Application {
} }
} }
public Stage initialize(Stage stage){ public Stage initializeShop(Stage stage){
Font size14 = new Font(14.0); Font size14 = new Font(14.0);
Rectangle dialogueRectangle = new Rectangle(); Rectangle dialogueRectangle = new Rectangle();
dialogueRectangle.setFill(javafx.scene.paint.Color.WHITE); dialogueRectangle.setFill(javafx.scene.paint.Color.WHITE);

177
src/StartGUI.java Normal file
View File

@@ -0,0 +1,177 @@
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class StartGUI extends Application {
private Player player = new Player();
private BorderPane borderPane = new BorderPane();
private HBox hBox = new HBox();
private TextField nameField = new TextField();
private Button startButton = new Button();
private VBox vBox = new VBox();
private Label choiceLabel = new Label();
private RadioButton gunChoice = new RadioButton();
private ToggleGroup Start = new ToggleGroup();
private RadioButton cashChoice = new RadioButton();
private VBox vBox0 = new VBox();
private Label title = new Label();
private Label authors = new Label();
/**
* gets the player instance variable. The method returns a copy of the instance variable for encapsulation purposes.
*
* @return playerDummy -- playerDummy is a copy of the player instance variable.
*/
public Player getPlayer() {
Player playerTemp = new Player(player);
return playerTemp;
}
/**
* sets the player instance variable equal to a copy of the parameter -- a copy is used for encapsulation purposes.
*
* @param player is a Player object that will replace the current instance of the player instance variable.
*/
public void setPlayer(Player player) {
Player playerTemp = new Player(player);
this.player = playerTemp;
}
/**
* Asks the user to input the name that they would like to be called in the game
*
* @param name the name that you would like to be called in the game
*/
public void setFirm (String name) {
if (name.length() <= 22) {
player.setName(name);
}
else{
player.setName("Taipan");
}
}
public static void main(String args[]){
launch(args);
}
public void start(Stage stage){
stage = initializeStart(stage);
stage.show();
}
/*
**
* Copy constructor.
* @param player object of the class Player
*
public StartGUI(Player player)
{
Player playerTemp = new Player(player);
this.player = playerTemp;
}
*/
public Stage initializeStart(Stage stage){
borderPane.setAlignment(hBox, javafx.geometry.Pos.CENTER);
hBox.setAlignment(javafx.geometry.Pos.CENTER);
hBox.setPrefHeight(100.0);
hBox.setPrefWidth(200.0);
hBox.setSpacing(10.0);
nameField.setPromptText("Enter your name.");
nameField.setText("Taipan");
startButton.setMnemonicParsing(false);
startButton.setText("Start");
vBox.setAlignment(javafx.geometry.Pos.CENTER_LEFT);
choiceLabel.setText("Do you want to start with...");
gunChoice.setMnemonicParsing(false);
gunChoice.setSelected(true);
gunChoice.setText("Five guns and no cash (But no debt!)?");
gunChoice.setToggleGroup(Start);
cashChoice.setAlignment(javafx.geometry.Pos.TOP_LEFT);
cashChoice.setMnemonicParsing(false);
cashChoice.setText("Cash (and a debt)");
cashChoice.setToggleGroup(Start);
borderPane.setBottom(hBox);
BorderPane.setAlignment(vBox0, javafx.geometry.Pos.CENTER);
vBox0.setAlignment(javafx.geometry.Pos.CENTER);
vBox0.setPrefHeight(200.0);
vBox0.setPrefWidth(100.0);
title.setText("Taipan");
title.setFont(new Font(66.0));
authors.setPrefHeight(80.0);
authors.setPrefWidth(499.0);
authors.setText("By Vikram Bawa, Haris Muhammad, Siddhant Dewani, Nathan Lum and Harkamal Randhawa");
authors.setTextAlignment(javafx.scene.text.TextAlignment.CENTER);
borderPane.setCenter(vBox0);
hBox.getChildren().add(nameField);
hBox.getChildren().add(startButton);
vBox.getChildren().add(choiceLabel);
vBox.getChildren().add(gunChoice);
vBox.getChildren().add(cashChoice);
hBox.getChildren().add(vBox);
vBox0.getChildren().add(title);
vBox0.getChildren().add(authors);
System.out.println("0");
startButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("a");
if (Start.getSelectedToggle() == cashChoice) {
player.setMoney(400);
player.setDebt(5000);
}
if (Start.getSelectedToggle() == gunChoice) {
player.setGuns(5);
}
System.out.println("b");
String response = nameField.getText();
// purely for testing purposes.
if (player.getName().equalsIgnoreCase("Vikram")) {
player.setMoney(999999999);
player.setBank(999999999);
player.setGuns(999);
player.setHP(99999999);
player.setCargoSpace(99999999);
}
else{
setFirm(response);
}
System.out.println("x");
title.setText("SHOP PLACEHOLDER");
}
});
Scene root = new Scene(borderPane, 600, 480);
stage.setTitle("Start");
stage.setResizable(false);
stage.setScene(root);
return stage;
}
}

446
src/TravelGUI.java Normal file
View File

@@ -0,0 +1,446 @@
import com.sun.org.apache.xpath.internal.operations.Bool;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.*;
import javafx.stage.Stage;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import java.util.Random;
public class TravelGUI extends Application {
private Player player = new Player();
private Label firm = new Label();
private Label wItemsText = new Label();
private Label wItemSpaceText = new Label();
private Label locationText = new Label();
private Label inventoryText = new Label();
private Label inventoryHeldText = new Label();
private Label gunsText = new Label();
private Label shipStatusText = new Label();
private Label cashText = new Label();
private Label bankText = new Label();
private Label textOut = new Label();
private Button quitButton = new Button();
private Button continueButton = new Button();
private TextField numberInput = new TextField();
private int nextScene = 0;
public static void main(String args[]){
launch(args);
}
public void start(Stage stage){
stage = initializeTravel(stage);
updateStage();
stage.show();
}
public void setPlayer(Player player) {
Player playerDummy = new Player(player);
this.player = playerDummy;
}
public Player getPlayer(){
Player playerDummy = new Player(player);
return playerDummy;
}
public int getUserResponse(){
try {
return 0;
}
catch (Exception e){
textOut.setText(" Sorry could you say that again?");
}
return 0;
}
public Stage initializeTravel(Stage stage){
Font size14 = new Font(14.0);
Rectangle dialogueRectangle = new Rectangle();
dialogueRectangle.setFill(javafx.scene.paint.Color.WHITE);
dialogueRectangle.setHeight(180.0);
dialogueRectangle.setLayoutX(8.0);
dialogueRectangle.setLayoutY(294.0);
dialogueRectangle.setStroke(javafx.scene.paint.Color.BLACK);
dialogueRectangle.setStrokeType(javafx.scene.shape.StrokeType.INSIDE);
dialogueRectangle.setWidth(582.0);
Rectangle inventoryRectangle = new Rectangle();
inventoryRectangle.setFill(javafx.scene.paint.Color.WHITE);
inventoryRectangle.setHeight(108.0);
inventoryRectangle.setLayoutX(8.0);
inventoryRectangle.setLayoutY(147.0);
inventoryRectangle.setStroke(javafx.scene.paint.Color.BLACK);
inventoryRectangle.setStrokeType(javafx.scene.shape.StrokeType.INSIDE);
inventoryRectangle.setWidth(405.0);
Rectangle warehouseRectangle = new Rectangle();
warehouseRectangle.setFill(javafx.scene.paint.Color.WHITE);
warehouseRectangle.setHeight(108.0);
warehouseRectangle.setLayoutY(33.0);
warehouseRectangle.setLayoutX(8.0);
warehouseRectangle.setStroke(javafx.scene.paint.Color.BLACK);
warehouseRectangle.setStrokeType(javafx.scene.shape.StrokeType.INSIDE);
warehouseRectangle.setWidth(405.0);
AnchorPane anchorPane = new AnchorPane();
anchorPane.setPrefHeight(480.0);
anchorPane.setPrefWidth(600.0);
GridPane gridPane = new GridPane();
gridPane.setPrefHeight(480.0);
gridPane.setPrefWidth(600.0);
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setMaxWidth(590.0);
columnConstraints.setMinWidth(0.0);
columnConstraints.setPrefWidth(590.0);
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setMinHeight(20.0);
rowConstraints.setPrefHeight(20.0);
RowConstraints rowConstraints0 = new RowConstraints();
rowConstraints0.setMaxHeight(122.0);
rowConstraints0.setMinHeight(10.0);
rowConstraints0.setPrefHeight(117.0);
RowConstraints rowConstraints1 = new RowConstraints();
rowConstraints1.setMaxHeight(163.0);
rowConstraints1.setMinHeight(10.0);
rowConstraints1.setPrefHeight(112.0);
RowConstraints rowConstraints2 = new RowConstraints();
rowConstraints2.setMaxHeight(126.0);
rowConstraints2.setMinHeight(0.0);
rowConstraints2.setPrefHeight(42.0);
RowConstraints rowConstraints3 = new RowConstraints();
rowConstraints3.setMaxHeight(269.0);
rowConstraints3.setMinHeight(10.0);
rowConstraints3.setPrefHeight(118.0);
RowConstraints rowConstraints4 = new RowConstraints();
rowConstraints4.setMaxHeight(179.0);
rowConstraints4.setMinHeight(10.0);
rowConstraints4.setPrefHeight(52.0);
gridPane.setPadding(new Insets(10.0, 10.0, 10.0, 0.0));
HBox hBox = new HBox();
GridPane.setRowIndex(hBox, 1);
hBox.setPrefHeight(100.0);
hBox.setPrefWidth(200.0);
HBox hBox0 = new HBox();
GridPane.setRowIndex(hBox0, 2);
hBox0.setPrefHeight(100.0);
hBox0.setPrefWidth(200.0);
FlowPane flowPane = new FlowPane();
GridPane.setRowIndex(flowPane, 5);
flowPane.setAlignment(javafx.geometry.Pos.CENTER);
flowPane.setHgap(5.0);
flowPane.setPrefHeight(200.0);
flowPane.setPrefWidth(200.0);
quitButton.setPrefHeight(25.0);
quitButton.setMnemonicParsing(false);
quitButton.setPrefWidth(90.0);
quitButton.setText("Go back");
continueButton.setPrefHeight(25.0);
continueButton.setMnemonicParsing(false);
continueButton.setPrefWidth(90.0);
continueButton.setText("Continue");
continueButton.setVisible(false);
//Goes back to shop
quitButton.setOnAction(event -> {
textOut.setText(" " + "PLACEHOLDER FOR SHOP");
});
//Continues on to either shop or shipwarefare
continueButton.setOnKeyPressed(event -> {
});
//Text input for where the player needs to go.
numberInput.setAlignment(javafx.geometry.Pos.CENTER_RIGHT);
numberInput.setText("Enter preferred location.");
numberInput.setOnKeyPressed(event -> {
if(event.getCode().equals(KeyCode.ENTER)||event.getCode().equals(KeyCode.Z)) {
int response;
response = Integer.parseInt(numberInput.getText().replace(" ", ""));
boolean hasTraveled = false;
//Only lets the player leave the port if their inventory is greater than or equal to the sum of the items in the inventory.
if(player.getCargoSpace() >= (player.getOpiumHeld()+ (player.getGuns()*10)+player.getSilkHeld() + player.getArmsHeld() + player.getGeneralHeld())){
//Just in case the player types something that was not intended. It will refresh the question and ask it again
try {
//Makes sure you can't travel to your own location.
if (response != player.getLocation() && response != 0 && event.getCode().equals(KeyCode.ENTER)||event.getCode().equals(KeyCode.Z)){
randomEventSea(response);
hasTraveled = seaAtlas(response);
player.setBank((int) (player.getBank() * 1.01));
player.setDebt((int) (player.getDebt() * 1.01));
} else{
textOut.setText(" " + "You're already here " + player.getName());
textOut.setText(textOut.getText() + ", do you wish to go to:\n\n 1) Hong Kong, 2) Shanghai, 3) Nagasaki, 4)Saigon,\n 5) Manila, 6) Singapore, or 7) Batavia?");
}
} catch (Exception e) {
textOut.setText(" " + "Sorry, " + player.getName() + " could you say that again?");
}
if (hasTraveled) {
textOut.setText(textOut.getText() + "\n " + "PLACEHOLDER FOR SHOP");
numberInput.setVisible(false);
quitButton.setVisible(false);
continueButton.setVisible(true);
}
}
}
else if (player.getCargoSpace() < (player.getOpiumHeld()+ (player.getGuns()*10)+player.getSilkHeld() + player.getArmsHeld() + player.getGeneralHeld())){
textOut.setText(" "+player.getName() + " the cargo is too heavy! We can't set sail!");
}
});
firm.setAlignment(Pos.CENTER);
firm.setPrefHeight(27.0);
firm.setPrefWidth(632.0);
firm.setFont(new Font(18.0));
Label warehouseText = new Label();
warehouseText.setAlignment(Pos.CENTER);
warehouseText.setPrefHeight(108.0);
warehouseText.setPrefWidth(100.0);
warehouseText.setText("Warehouse\n\tOpium\n\tSilk\n\tArms\n\tGeneral");
warehouseText.setFont(size14);
wItemsText.setAlignment(Pos.CENTER);
wItemsText.setPrefWidth(100.0);
wItemsText.setPrefHeight(108.0);
wItemsText.setFont(size14);
wItemSpaceText.setPrefHeight(108.0);
wItemSpaceText.setPrefWidth(215.0);
wItemSpaceText.setFont(size14);
locationText.setAlignment(Pos.BOTTOM_CENTER);
locationText.setPrefHeight(106.0);
locationText.setPrefWidth(175.0);
locationText.setTextAlignment(javafx.scene.text.TextAlignment.CENTER);
locationText.setFont(size14);
inventoryText.setAlignment(Pos.CENTER);
inventoryText.setFont(size14);
inventoryHeldText.setAlignment(Pos.CENTER);
inventoryHeldText.setPrefHeight(108.0);
inventoryHeldText.setPrefWidth(100.0);
inventoryHeldText.setFont(size14);
gunsText.setPrefHeight(108.0);
gunsText.setPrefWidth(212.0);
gunsText.setAlignment(Pos.CENTER_LEFT);
gunsText.setFont(size14);
shipStatusText.setAlignment(Pos.TOP_CENTER);
shipStatusText.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
shipStatusText.setPrefHeight(110.0);
shipStatusText.setPrefWidth(180.0);
shipStatusText.setTextAlignment(javafx.scene.text.TextAlignment.CENTER);
shipStatusText.setFont(size14);
GridPane.setRowIndex(cashText, 3);
cashText.setPrefHeight(17.0);
cashText.setPrefWidth(209.0);
cashText.setFont(size14);
GridPane.setHalignment(bankText, javafx.geometry.HPos.CENTER);
GridPane.setRowIndex(bankText, 3);
bankText.setAlignment(Pos.CENTER);
bankText.setPrefHeight(20.0);
bankText.setPrefWidth(264.0);
bankText.setFont(size14);
GridPane.setRowIndex(textOut, 4);
textOut.setAlignment(Pos.TOP_LEFT);
textOut.setContentDisplay(javafx.scene.control.ContentDisplay.TOP);
textOut.setPrefHeight(163.0);
textOut.setPrefWidth(583.0);
textOut.setText(" Taipan, do you wish to go to:\n\n 1) Hong Kong, 2) Shanghai, 3) Nagasaki, 4)Saigon,\n 5) Manila, 6) Singapore, or 7) Batavia?");
textOut.setFont(size14);
anchorPane.getChildren().addAll(dialogueRectangle, inventoryRectangle, warehouseRectangle);
hBox.getChildren().addAll(warehouseText, wItemsText, wItemSpaceText, locationText);
hBox0.getChildren().addAll(inventoryText, inventoryHeldText, gunsText, shipStatusText);
flowPane.getChildren().addAll(numberInput, quitButton, continueButton);
gridPane.getColumnConstraints().add(columnConstraints);
gridPane.getRowConstraints().addAll(rowConstraints, rowConstraints0, rowConstraints1, rowConstraints2, rowConstraints3, rowConstraints4);
gridPane.getChildren().addAll(firm, hBox, hBox0, cashText, bankText, textOut, flowPane);
anchorPane.getChildren().add(gridPane);
Scene root = new Scene(anchorPane, 600, 480);
stage.setTitle("Travel");
stage.setResizable(false);
stage.setScene(root);
return stage;
}
/**
* When provided a location number: the method returns a print statement stating the location's name and call another
* method to change the location of the Player object.
*
* @param locationOfTravel is a Player object that will be copied and the player instance variable is set to the copy.
*/
private Boolean seaAtlas(int locationOfTravel) {
switch (locationOfTravel) {
case 1:
textOut.setText( textOut.getText() + "\n " + "Arriving at Hong Kong");
player.setLocation(1);
return true;
case 2:
textOut.setText( textOut.getText() + "\n " + "Arriving at Shanghai");
player.setLocation(2);
return true;
case 3:
textOut.setText( textOut.getText() + "\n " + "Arriving at Nagasaki");
player.setLocation(3);
return true;
case 4:
textOut.setText( textOut.getText() + "\n " + "Arriving at Saigon");
player.setLocation(4);
return true;
case 5:
textOut.setText( textOut.getText() + "\n " + "Arriving at Manila");
player.setLocation(5);
return true;
case 6:
textOut.setText( textOut.getText() + "\n " + "Arriving at Singapore");
player.setLocation(6);
return true;
case 7:
textOut.setText( textOut.getText() + "\n " + "Arriving at Batavia");
player.setLocation(7);
return true;
default:
textOut.setText(" " + "Sorry but could you say that again " + player.getName() + "?");
return false;
}
}
/**
* Based on random chance either attacks the player with enemy ships, throws them to a different location or does nothing.
*
* @param locationOfTravel is used to see where the player is going to travel, just in case their location is changed
* by a typhoon.
**/
private void randomEventSea(int locationOfTravel) throws Exception {
Random rand = new Random();
int randGenNum = rand.nextInt(3) + 1;
if (randGenNum == 1) {
textOut.setText(textOut.getText() + "\n " + "PLACEHOLDER FOR SHIPWARFARE");
}else if (randGenNum == 2) {
disaster(locationOfTravel);
textOut.setText(textOut.getText() + "\n " + "We made it!");
}
}
/**
* Based on random chance either throws the player character off course, or continues them on their way to their
* destination.
*
* @param locationOfTravel is used to see where the player is going to travel, just in case their location is changed
* by a typhoon.
**/
private void disaster(int locationOfTravel) {
//Tells player that there is a storm approaching.
textOut.setText(textOut.getText() + "\n " + "Storm " + player.getName() + "! ");
Random rand = new Random();
int randGenNum = rand.nextInt(5) + 1;
//If the player lands within this range, nothing happens to them
//Else they randomly get thrown into a location they weren't planning on going to(Anything but location of Travel).
if (randGenNum <= 2) {
textOut.setText(textOut.getText() + "\n " + "We made it through!");
}else {
while (randGenNum == locationOfTravel) {
randGenNum = rand.nextInt(7) + 1;
if (randGenNum != locationOfTravel) {
textOut.setText(textOut.getText() + "\n " + "We've been blown off course!");
seaAtlas(randGenNum);
}
}
}
}
public String getStringLocation(){
String location;
switch(player.getLocation()){
case 1: location = "Hong Kong"; break;
case 2: location = "Shanghai"; break;
case 3: location = "Nagasaki"; break;
case 4: location = "Saigon"; break;
case 5: location = "Manila"; break;
case 6: location = "Singapore"; break;
case 7: location = "Batavia"; break;
default: location = "Error"; break;
}
return location;
}
public String shipStatusString(){
String shipStatus;
switch(player.getHP()){
case 100: shipStatus = "Mint Condition"; break;
case 80: shipStatus = "Great"; break;
case 70: shipStatus = "Good"; break;
case 60: shipStatus = "Acceptable"; break;
case 50: shipStatus = "Tolerable"; break;
case 30: shipStatus = "Damaged"; break;
case 10: shipStatus = "Poor"; break;
case 1: shipStatus = "Extremely Poor"; break;
default: shipStatus = "Sinking"; break;
}
return shipStatus;
}
public void updateStage(){
firm.setText(String.format("Firm: %s, %s", player.getName(), getStringLocation()));
wItemsText.setText(String.format("\n %d\n %d\n %d\n %d", player.getwOpium(), player.getwSilk(), player.getwArms(), player.getwGeneral()));
int itemsInWarehouse = player.getwOpium()+player.getwGeneral()+player.getwArms()+player.getwSilk();
wItemSpaceText.setText(String.format("\n\t\tIn use:\n\t\t %d \n\t\tVacant:\n\t\t %d", itemsInWarehouse, (10000-itemsInWarehouse)));
locationText.setText(String.format("Location\n%s", getStringLocation()));
int itemsInInventory = player.getCargoSpace()-player.getSilkHeld()-player.getOpiumHeld()-player.getGeneralHeld()-player.getArmsHeld()-10*player.getGuns();
if(itemsInInventory < 0){
inventoryText.setText(" Overloaded\n\t Opium\n\t Silk\n\t Arms\n\t General");
}else{
inventoryText.setText(String.format(" Hold %d\n\t Opium\n\t Silk\n\t Arms\n\t General", itemsInInventory));
}
gunsText.setText(String.format("Guns %d\n\n\n\n ", player.getGuns()));
inventoryHeldText.setText(String.format("\n %d\n %d\n %d\n %d", player.getOpiumHeld(), player.getSilkHeld(), player.getArmsHeld(), player.getGeneralHeld()));
shipStatusText.setText(String.format("\tDebt\n\t%d\n\n\tShip status\n\t%s: %d", player.getDebt(), shipStatusString(), player.getHP()));
cashText.setText(String.format(" Cash: %d", player.getMoney()));
bankText.setText(String.format("Bank: %d", player.getBank()));
}
}