Missed one statement that I needed to encapsulate
This commit is contained in:
213
.idea/workspace.xml
generated
213
.idea/workspace.xml
generated
@@ -1,9 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="Fixed the commenting on a lot of the code. Also added some stuff to Travel, fixed some bugs.">
|
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="">
|
||||||
<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/Player.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Player.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/ShipWarfare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfare.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/ShipWarfareGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfareGUI.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/ShipWarfareGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfareGUI.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<ignored path="$PROJECT_DIR$/out/" />
|
<ignored path="$PROJECT_DIR$/out/" />
|
||||||
@@ -19,19 +21,56 @@
|
|||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<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="495">
|
<state relative-caret-position="177">
|
||||||
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
|
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="true">
|
||||||
<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="6801">
|
<state relative-caret-position="-348">
|
||||||
<caret line="457" column="22" selection-start-line="457" selection-start-column="22" selection-end-line="457" selection-end-column="22" />
|
<caret line="264" column="40" selection-start-line="264" selection-start-column="40" selection-end-line="264" selection-end-column="40" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
|
<element signature="e#2604#2605#0" expanded="true" />
|
||||||
|
<element signature="e#2644#2645#0" expanded="true" />
|
||||||
|
<element signature="e#2683#2684#0" expanded="true" />
|
||||||
|
<element signature="e#2721#2722#0" expanded="true" />
|
||||||
|
<element signature="e#2759#2760#0" expanded="true" />
|
||||||
|
<element signature="e#2793#2794#0" expanded="true" />
|
||||||
|
<element signature="e#2837#2838#0" expanded="true" />
|
||||||
|
<element signature="e#2880#2881#0" expanded="true" />
|
||||||
|
<element signature="e#2922#2923#0" expanded="true" />
|
||||||
|
<element signature="e#2963#2964#0" expanded="true" />
|
||||||
|
<element signature="e#2997#2998#0" expanded="true" />
|
||||||
|
<element signature="e#3030#3031#0" expanded="true" />
|
||||||
|
<element signature="e#3067#3068#0" expanded="true" />
|
||||||
|
<element signature="e#3100#3101#0" expanded="true" />
|
||||||
|
<element signature="e#3155#3156#0" expanded="true" />
|
||||||
|
<element signature="e#3201#3202#0" expanded="true" />
|
||||||
|
<element signature="e#7408#7409#0" expanded="true" />
|
||||||
|
<element signature="e#7452#7453#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="2672">
|
||||||
|
<caret line="241" column="31" selection-start-line="241" selection-start-column="31" selection-end-line="241" selection-end-column="31" />
|
||||||
|
<folding>
|
||||||
|
<element signature="imports" expanded="true" />
|
||||||
|
<element signature="e#1178#1179#0" expanded="true" />
|
||||||
|
<element signature="e#5971#5972#0" expanded="true" />
|
||||||
|
<element signature="e#6019#6020#0" expanded="true" />
|
||||||
|
<element signature="e#6052#6053#0" expanded="true" />
|
||||||
|
<element signature="e#6093#6094#0" expanded="true" />
|
||||||
|
<element signature="e#6137#6138#0" expanded="true" />
|
||||||
|
<element signature="e#6175#6176#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
@@ -39,23 +78,14 @@
|
|||||||
</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/ShopGUI">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
<state relative-caret-position="-2" />
|
|
||||||
</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/ShipWarfareGUI.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="107">
|
<state relative-caret-position="90">
|
||||||
<caret line="43" column="2" selection-start-line="43" selection-start-column="2" selection-end-line="43" selection-end-column="2" />
|
<caret line="6" column="29" lean-forward="true" selection-start-line="6" selection-start-column="29" selection-end-line="6" selection-end-column="29" />
|
||||||
<folding>
|
|
||||||
<element signature="imports" expanded="true" />
|
|
||||||
<element signature="e#1087#1088#0" expanded="true" />
|
|
||||||
<element signature="e#2205#2206#0" expanded="true" />
|
|
||||||
<element signature="e#2279#2280#0" expanded="true" />
|
|
||||||
<element signature="e#2361#2362#0" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -71,25 +101,48 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FindInProjectRecents">
|
<component name="FindInProjectRecents">
|
||||||
<findStrings>
|
<findStrings>
|
||||||
<find>Hp</find>
|
|
||||||
<find>travel</find>
|
<find>travel</find>
|
||||||
<find>notDone</find>
|
<find>notDone</find>
|
||||||
<find>GetGuns</find>
|
<find>GetGuns</find>
|
||||||
<find>get</find>
|
|
||||||
<find>set</find>
|
<find>set</find>
|
||||||
<find>TaipanShop</find>
|
<find>TaipanShop</find>
|
||||||
<find>shop()</find>
|
<find>shop()</find>
|
||||||
<find>shop</find>
|
<find>shop</find>
|
||||||
|
<find>being</find>
|
||||||
|
<find>label0</find>
|
||||||
|
<find>hBox</find>
|
||||||
|
<find><</find>
|
||||||
|
<find>winO</find>
|
||||||
|
<find>destroy</find>
|
||||||
|
<find>get</find>
|
||||||
|
<find>user</find>
|
||||||
|
<find>setNumOfP</find>
|
||||||
|
<find>setUs</find>
|
||||||
|
<find>starting</find>
|
||||||
|
<find>destro</find>
|
||||||
|
<find>numOfpeasantShips</find>
|
||||||
|
<find>startingPeasantShips</find>
|
||||||
|
<find>startingLittyShips</find>
|
||||||
|
<find>howMuchRun</find>
|
||||||
|
<find>pirateName</find>
|
||||||
|
<find>player</find>
|
||||||
|
<find>numOfPeasantShips</find>
|
||||||
|
<find>peasant</find>
|
||||||
|
<find>litty</find>
|
||||||
|
<find>userAttacks</find>
|
||||||
|
<find>numOfLittyShips</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>shipWarfare.isUserAttacks()</replace>
|
||||||
|
<replace>shipWarfare.getNumOfPeasantShips()</replace>
|
||||||
</replaceStrings>
|
</replaceStrings>
|
||||||
</component>
|
</component>
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="UPDATE_CHANGES_POLICY" value="SHELVE" />
|
<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">
|
||||||
@@ -97,17 +150,18 @@
|
|||||||
<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/ShipWarfare.java" />
|
|
||||||
<option value="$PROJECT_DIR$/src/Player.java" />
|
|
||||||
<option value="$PROJECT_DIR$/src/Start.java" />
|
<option value="$PROJECT_DIR$/src/Start.java" />
|
||||||
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
|
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
|
||||||
<option value="$PROJECT_DIR$/src/main.java" />
|
<option value="$PROJECT_DIR$/src/main.java" />
|
||||||
<option value="$PROJECT_DIR$/src/Travel.java" />
|
<option value="$PROJECT_DIR$/src/Travel.java" />
|
||||||
|
<option value="$PROJECT_DIR$/src/Player.java" />
|
||||||
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
|
<option value="$PROJECT_DIR$/src/ShipWarfareGUI.java" />
|
||||||
|
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectFrameBounds">
|
<component name="ProjectFrameBounds">
|
||||||
|
<option name="x" value="48" />
|
||||||
<option name="y" value="23" />
|
<option name="y" value="23" />
|
||||||
<option name="width" value="1189" />
|
<option name="width" value="1189" />
|
||||||
<option name="height" value="652" />
|
<option name="height" value="652" />
|
||||||
@@ -142,7 +196,7 @@
|
|||||||
<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="1552173181638" />
|
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1552181286375" />
|
||||||
<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="$PROJECT_DIR$/../GitHub/Cpsc233" />
|
||||||
<property name="project.structure.last.edited" value="Project" />
|
<property name="project.structure.last.edited" value="Project" />
|
||||||
@@ -329,17 +383,31 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1552172956109</updated>
|
<updated>1552172956109</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="14" />
|
<task id="LOCAL-00014" summary="Added fight stuff">
|
||||||
|
<created>1552173216531</created>
|
||||||
|
<option name="number" value="00014" />
|
||||||
|
<option name="presentableId" value="LOCAL-00014" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552173216532</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00015" summary="Made ShipWarfare easier to access by ShipWarfareGUI">
|
||||||
|
<created>1552181324520</created>
|
||||||
|
<option name="number" value="00015" />
|
||||||
|
<option name="presentableId" value="LOCAL-00015" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1552181324520</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="16" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="47207000" />
|
<option name="totallyTimeSpent" value="55571000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="0" y="23" width="687" height="639" extended-state="0" />
|
<frame x="48" y="23" width="1189" height="652" extended-state="0" />
|
||||||
<editor active="true" />
|
<editor active="true" />
|
||||||
<layout>
|
<layout>
|
||||||
<window_info content_ui="combo" id="Project" order="0" weight="0.9268293" />
|
<window_info content_ui="combo" id="Project" order="0" weight="0.9267655" />
|
||||||
<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" />
|
||||||
@@ -348,7 +416,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.44871795" />
|
<window_info anchor="bottom" id="Run" order="2" weight="0.4482143" />
|
||||||
<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" />
|
||||||
@@ -358,7 +426,7 @@
|
|||||||
<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.50061125" side_tool="true" weight="0.32922733" />
|
||||||
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32901135" />
|
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.49938875" weight="0.32857144" />
|
||||||
<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" />
|
||||||
@@ -450,7 +518,9 @@
|
|||||||
<MESSAGE value="Added time stuff to Shipwarfare GUI" />
|
<MESSAGE value="Added time stuff to Shipwarfare GUI" />
|
||||||
<MESSAGE value="Nitified of getting attacked" />
|
<MESSAGE value="Nitified of getting attacked" />
|
||||||
<MESSAGE value="Notified of getting attacked" />
|
<MESSAGE value="Notified of getting attacked" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="Notified of getting attacked" />
|
<MESSAGE value="Added fight stuff" />
|
||||||
|
<MESSAGE value="Made ShipWarfare easier to access by ShipWarfareGUI" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Made ShipWarfare easier to access by ShipWarfareGUI" />
|
||||||
</component>
|
</component>
|
||||||
<component name="editorHistoryManager">
|
<component name="editorHistoryManager">
|
||||||
<entry file="uml://JAVA/ShipWarfare">
|
<entry file="uml://JAVA/ShipWarfare">
|
||||||
@@ -513,13 +583,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="-2606">
|
|
||||||
<caret line="24" column="5" lean-forward="true" selection-start-line="24" selection-start-column="5" selection-end-line="24" selection-end-column="5" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
|
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="168">
|
<state relative-caret-position="168">
|
||||||
@@ -530,13 +593,6 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="495">
|
|
||||||
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/src/Travel.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="27">
|
<state relative-caret-position="27">
|
||||||
@@ -547,31 +603,64 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShopGUI">
|
<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="-2" />
|
<state relative-caret-position="90">
|
||||||
|
<caret line="6" column="29" lean-forward="true" selection-start-line="6" selection-start-column="29" selection-end-line="6" selection-end-column="29" />
|
||||||
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
<entry file="file://$PROJECT_DIR$/src/ShopGUI">
|
||||||
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
|
</entry>
|
||||||
|
<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="6801">
|
<state relative-caret-position="177">
|
||||||
<caret line="457" column="22" selection-start-line="457" selection-start-column="22" selection-end-line="457" selection-end-column="22" />
|
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
|
||||||
<folding>
|
|
||||||
<element signature="imports" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.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="107">
|
<state relative-caret-position="2672">
|
||||||
<caret line="43" column="2" selection-start-line="43" selection-start-column="2" selection-end-line="43" selection-end-column="2" />
|
<caret line="241" column="31" selection-start-line="241" selection-start-column="31" selection-end-line="241" selection-end-column="31" />
|
||||||
<folding>
|
<folding>
|
||||||
<element signature="imports" expanded="true" />
|
<element signature="imports" expanded="true" />
|
||||||
<element signature="e#1087#1088#0" expanded="true" />
|
<element signature="e#1178#1179#0" expanded="true" />
|
||||||
<element signature="e#2205#2206#0" expanded="true" />
|
<element signature="e#5971#5972#0" expanded="true" />
|
||||||
<element signature="e#2279#2280#0" expanded="true" />
|
<element signature="e#6019#6020#0" expanded="true" />
|
||||||
<element signature="e#2361#2362#0" expanded="true" />
|
<element signature="e#6052#6053#0" expanded="true" />
|
||||||
|
<element signature="e#6093#6094#0" expanded="true" />
|
||||||
|
<element signature="e#6137#6138#0" expanded="true" />
|
||||||
|
<element signature="e#6175#6176#0" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="-348">
|
||||||
|
<caret line="264" column="40" selection-start-line="264" selection-start-column="40" selection-end-line="264" selection-end-column="40" />
|
||||||
|
<folding>
|
||||||
|
<element signature="imports" expanded="true" />
|
||||||
|
<element signature="e#2604#2605#0" expanded="true" />
|
||||||
|
<element signature="e#2644#2645#0" expanded="true" />
|
||||||
|
<element signature="e#2683#2684#0" expanded="true" />
|
||||||
|
<element signature="e#2721#2722#0" expanded="true" />
|
||||||
|
<element signature="e#2759#2760#0" expanded="true" />
|
||||||
|
<element signature="e#2793#2794#0" expanded="true" />
|
||||||
|
<element signature="e#2837#2838#0" expanded="true" />
|
||||||
|
<element signature="e#2880#2881#0" expanded="true" />
|
||||||
|
<element signature="e#2922#2923#0" expanded="true" />
|
||||||
|
<element signature="e#2963#2964#0" expanded="true" />
|
||||||
|
<element signature="e#2997#2998#0" expanded="true" />
|
||||||
|
<element signature="e#3030#3031#0" expanded="true" />
|
||||||
|
<element signature="e#3067#3068#0" expanded="true" />
|
||||||
|
<element signature="e#3100#3101#0" expanded="true" />
|
||||||
|
<element signature="e#3155#3156#0" expanded="true" />
|
||||||
|
<element signature="e#3201#3202#0" expanded="true" />
|
||||||
|
<element signature="e#7408#7409#0" expanded="true" />
|
||||||
|
<element signature="e#7452#7453#0" expanded="true" />
|
||||||
</folding>
|
</folding>
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ public class Player {
|
|||||||
|
|
||||||
private String name = "Taipan";
|
private String name = "Taipan";
|
||||||
private int bank = 0;
|
private int bank = 0;
|
||||||
private int money = 0;
|
private int money = 1000;
|
||||||
private int opiumHeld = 0;
|
private int opiumHeld = 0;
|
||||||
private int silkHeld = 0;
|
private int silkHeld = 0;
|
||||||
private int generalHeld = 0;
|
private int generalHeld = 0;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class ShipWarfare {
|
|||||||
while (true) {
|
while (true) {
|
||||||
String response = userResponse.nextLine();
|
String response = userResponse.nextLine();
|
||||||
if (response.equalsIgnoreCase("f")) {
|
if (response.equalsIgnoreCase("f")) {
|
||||||
userAttacks = true;
|
setUserAttacks(true);
|
||||||
System.out.println("Ohh, fight ehh?");
|
System.out.println("Ohh, fight ehh?");
|
||||||
delayForSeconds(1);
|
delayForSeconds(1);
|
||||||
boolean winOrLose = destroyPeasantShipsOrEscape();
|
boolean winOrLose = destroyPeasantShipsOrEscape();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import javafx.util.Duration;
|
|||||||
import javafx.animation.AnimationTimer;
|
import javafx.animation.AnimationTimer;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
|
|
||||||
private Player player = new Player();
|
private Player player = new Player();
|
||||||
|
private ShipWarfare shipWarfare = new ShipWarfare(player);
|
||||||
private HBox hBox;
|
private HBox hBox;
|
||||||
private Button button1;
|
private Button button1;
|
||||||
private Button button2;
|
private Button button2;
|
||||||
@@ -44,6 +46,133 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
private int counter = 0;
|
private int counter = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
public boolean destroyPeasantShipsOrEscape(){
|
||||||
|
int calculateLoot = 0;
|
||||||
|
String userStrikes="";
|
||||||
|
|
||||||
|
|
||||||
|
int exitValue = 0;
|
||||||
|
int chanceOfEnemyRun = 0;
|
||||||
|
Random randomValue = new Random();
|
||||||
|
|
||||||
|
//Player volley
|
||||||
|
while (exitValue == 0) {
|
||||||
|
if (player.getGuns() > 0) {
|
||||||
|
|
||||||
|
for (int j = 0; j < player.getGuns(); j++) {
|
||||||
|
if (shipWarfare.isUserAttacks() == true) {
|
||||||
|
int hitOrMiss = randomValue.nextInt(2) + 1;
|
||||||
|
if (hitOrMiss == 2) {
|
||||||
|
shipWarfare.setNumOfPeasantShips(shipWarfare.getNumOfPeasantShips()-1);
|
||||||
|
|
||||||
|
if (shipWarfare.getNumOfPeasantShips() <= 0) {
|
||||||
|
exitValue = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
userStrikes+= "Got eem\n";
|
||||||
|
System.out.println("Got eem");
|
||||||
|
delayForSeconds(1);
|
||||||
|
} else {
|
||||||
|
System.out.printf("ARRG! We missed %s\n", player.getName());
|
||||||
|
delayForSeconds(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label0.setText(userStrikes);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
System.out.printf("%s! We don't have any GUNS!!!!\n", player.getName());
|
||||||
|
delayForSeconds(1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (shipWarfare.getNumOfPeasantShips() <= 0) {
|
||||||
|
exitValue = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (player.getGuns() > 0) {
|
||||||
|
chanceOfEnemyRun = randomValue.nextInt(2) + 1;
|
||||||
|
if (chanceOfEnemyRun == 2) {
|
||||||
|
shipWarfare.setHowMuchRun(randomValue.nextInt(15) + 1);
|
||||||
|
if (shipWarfare.getHowMuchRun() != 0 && shipWarfare.getHowMuchRun() < shipWarfare.getHowMuchRun()) {
|
||||||
|
|
||||||
|
|
||||||
|
shipWarfare.setNumOfPeasantShips(shipWarfare.getNumOfPeasantShips() - shipWarfare.getHowMuchRun());
|
||||||
|
if (shipWarfare.isUserAttacks() == true) {
|
||||||
|
System.out.printf("Ahhh, %d ships ran away %s!\n", shipWarfare.getHowMuchRun(), player.getName());
|
||||||
|
} else {
|
||||||
|
System.out.printf("Escaped %d of them!\n", shipWarfare.getHowMuchRun());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.printf("%d ships remaining\n", shipWarfare.getNumOfPeasantShips());
|
||||||
|
delayForSeconds(1);
|
||||||
|
System.out.println("Oh no, they are taking the offensive!");
|
||||||
|
delayForSeconds(1);
|
||||||
|
//Computer volley
|
||||||
|
int takeGunChance = randomValue.nextInt(4) + 1;
|
||||||
|
if (takeGunChance == 1 && player.getGuns() > 0) {
|
||||||
|
player.setGuns(player.getGuns() - 1);
|
||||||
|
System.out.println("Dang it! They destroyed one of our guns");
|
||||||
|
} else {
|
||||||
|
player.setHP(player.getHP() - (1 + randomValue.nextInt(10)));
|
||||||
|
}
|
||||||
|
if (player.getHP() <= 0) {
|
||||||
|
exitValue = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
System.out.printf("EEK, our current ship status is %d%% \n", player.getHP());
|
||||||
|
delayForSeconds(1);
|
||||||
|
if (shipWarfare.isUserAttacks() == false) {
|
||||||
|
shipWarfare.setUserAttacks() = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.printf("Shall we continue to fight? Enter \"f\" to fight, and \"r\" to run (We have %d gun(s) left)\n", player.getGuns());
|
||||||
|
|
||||||
|
if (response.equalsIgnoreCase("r")) {
|
||||||
|
if (shipWarfare.runFromShips() == false) {
|
||||||
|
System.out.println("Couldn't run away");
|
||||||
|
} else {
|
||||||
|
exitValue = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (exitValue == 1) {
|
||||||
|
System.out.printf("\nGot eem\nVictory!\nIt appears we have defeated the enemy fleet and made it out at %d%% ship status\n", player.getHP());
|
||||||
|
delayForSeconds(1);
|
||||||
|
calculateLoot = (randomValue.nextInt(shipWarfare.getStartingPeasantShips()) + shipWarfare.getStartingPeasantShips()) * 100;
|
||||||
|
player.setMoney(player.getMoney() + calculateLoot);
|
||||||
|
System.out.printf("We got $%,d!", calculateLoot);
|
||||||
|
delayForSeconds(2);
|
||||||
|
return true;
|
||||||
|
} else if (exitValue == 2) {
|
||||||
|
player.gameOver();
|
||||||
|
return true;
|
||||||
|
} else if (exitValue == 3) {
|
||||||
|
System.out.printf("We made it out at %d%% ship status!\n", player.getHP());
|
||||||
|
delayForSeconds(2);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void delayForSeconds(int num) {
|
public void delayForSeconds(int num) {
|
||||||
@@ -54,27 +183,6 @@ public class ShipWarfareGUI extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int numOfShips() {
|
|
||||||
|
|
||||||
int numOfShipsAttacking = 0;
|
|
||||||
Random randomValue = new Random();
|
|
||||||
if (player.getMoney() <= 100000) {
|
|
||||||
//Minimum one ship will attack, maximum 20
|
|
||||||
numOfShipsAttacking = randomValue.nextInt(20) + 1;
|
|
||||||
} else if (player.getMoney() <= 200000) {
|
|
||||||
//Minimum 30 Ships will attack, maximum 70
|
|
||||||
numOfShipsAttacking = randomValue.nextInt(40) + 30;
|
|
||||||
} else if (player.getMoney() <= 500000) {
|
|
||||||
//Minimum 50 ships will attack, maximum 140
|
|
||||||
numOfShipsAttacking = randomValue.nextInt(90) + 50;
|
|
||||||
} else if (player.getMoney() > 1000000) {
|
|
||||||
//Minimum 100 ships will attack, maximum 300 ships
|
|
||||||
numOfShipsAttacking = randomValue.nextInt(3) + 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
return numOfShipsAttacking;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlayer(Player player) {
|
public void setPlayer(Player player) {
|
||||||
this.player = new Player(player);
|
this.player = new Player(player);
|
||||||
@@ -97,6 +205,7 @@ public class ShipWarfareGUI extends Application {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public void start(Stage stage) throws Exception {
|
public void start(Stage stage) throws Exception {
|
||||||
|
shipWarfare.setNumOfPeasantShips(shipWarfare.numOfShips());
|
||||||
|
|
||||||
|
|
||||||
BorderPane BorderPane = new BorderPane();
|
BorderPane BorderPane = new BorderPane();
|
||||||
@@ -142,21 +251,15 @@ public class ShipWarfareGUI extends Application {
|
|||||||
label1.setAlignment(javafx.geometry.Pos.TOP_CENTER);
|
label1.setAlignment(javafx.geometry.Pos.TOP_CENTER);
|
||||||
label1.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
|
label1.setContentDisplay(javafx.scene.control.ContentDisplay.CENTER);
|
||||||
label1.setId("Label1");
|
label1.setId("Label1");
|
||||||
label1.setText("Would you like to Fight or Run?");
|
|
||||||
label1.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
label1.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
||||||
|
vBox.setPadding(new Insets(0.0, 0.0, 10.0, 0.0));
|
||||||
label.setText("Ohh, Fight ehh?");
|
BorderPane.setTop(vBox);
|
||||||
|
BorderPane.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
||||||
vBox0.setAlignment(javafx.geometry.Pos.TOP_CENTER);
|
vBox0.setAlignment(javafx.geometry.Pos.TOP_CENTER);
|
||||||
vBox0.setPrefHeight(200.0);
|
vBox0.setPrefHeight(200.0);
|
||||||
vBox0.setPrefWidth(100.0);
|
vBox0.setPrefWidth(100.0);
|
||||||
vBox0.setSpacing(5.0);
|
vBox0.setSpacing(5.0);
|
||||||
|
|
||||||
label0.setText("Got eem");
|
|
||||||
vBox.setPadding(new Insets(0.0, 0.0, 10.0, 0.0));
|
|
||||||
BorderPane.setTop(vBox);
|
|
||||||
BorderPane.setPadding(new Insets(6.0, 0.0, 0.0, 0.0));
|
|
||||||
|
|
||||||
hBox.getChildren().add(button1);
|
hBox.getChildren().add(button1);
|
||||||
hBox.getChildren().add(button2);
|
hBox.getChildren().add(button2);
|
||||||
vBox.getChildren().add(label1);
|
vBox.getChildren().add(label1);
|
||||||
@@ -166,7 +269,10 @@ public class ShipWarfareGUI extends Application {
|
|||||||
|
|
||||||
|
|
||||||
ShipWarfareGUI ship = new ShipWarfareGUI();
|
ShipWarfareGUI ship = new ShipWarfareGUI();
|
||||||
label1.setText(ship.numOfShips() + " Merchant Ships are attacking you.");
|
|
||||||
|
label1.setText(String.format("By Golly! We have $%,d and are being attacked by %d Merchant ships\nCurrently our ship status is %d%%\n", player.getMoney(), shipWarfare.getNumOfPeasantShips(), player.getHP()));
|
||||||
|
label.setText("What would you like to do?");
|
||||||
|
|
||||||
|
|
||||||
//Fight
|
//Fight
|
||||||
button1.setOnAction(new EventHandler<ActionEvent>() {
|
button1.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
@@ -174,8 +280,15 @@ public class ShipWarfareGUI extends Application {
|
|||||||
public void handle(ActionEvent event) {
|
public void handle(ActionEvent event) {
|
||||||
counter++;
|
counter++;
|
||||||
if (counter == 1) {
|
if (counter == 1) {
|
||||||
label1.setText("Ohh, fight ehh?");
|
int calculateLoot = 0;
|
||||||
label1.setText("Tis been 5 seconds");
|
int chanceOfEnemyRun = 0;
|
||||||
|
label.setText("Ohh, Fight ehh?");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
label0.setText("Got eem");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (counter == 2) {
|
if (counter == 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user