minor changes. Still in progress.
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,7 +3,7 @@
|
||||
<component name="ProjectKey">
|
||||
<option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" />
|
||||
</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_191" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="SvnBranchConfigurationManager">
|
||||
|
||||
189
.idea/workspace.xml
generated
189
.idea/workspace.xml
generated
@@ -1,7 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<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="the comment somehow made it so that I couldn't compile (using the command line i couldn't compile, i could compile file using intellij) Also, you the file extended player, which is not necessary. You also were calling gameOver() and getName() directly, you needed "player." before all those methods.">
|
||||
<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$/out/production/TaipanClone/ShipWarfare.class" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Player.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Player.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TaipanShop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TaipanShop.java" afterDir="false" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/out/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@@ -28,8 +34,8 @@
|
||||
<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="342">
|
||||
<caret line="18" column="34" selection-start-line="18" selection-start-column="34" selection-end-line="18" selection-end-column="34" />
|
||||
<state relative-caret-position="95">
|
||||
<caret line="5" column="41" lean-forward="true" selection-start-line="5" selection-start-column="41" selection-end-line="5" selection-end-column="41" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -37,8 +43,8 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/loanShark.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="779">
|
||||
<caret line="41" column="5" selection-start-line="41" selection-start-column="5" selection-end-line="41" selection-end-column="5" />
|
||||
<state relative-caret-position="535">
|
||||
<caret line="47" column="5" selection-start-line="47" selection-start-column="5" selection-end-line="47" selection-end-column="5" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -46,11 +52,11 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="190">
|
||||
<caret line="10" column="24" selection-start-line="10" selection-start-column="24" selection-end-line="10" selection-end-column="24" />
|
||||
<state relative-caret-position="1102">
|
||||
<caret line="58" column="5" selection-start-line="58" selection-start-column="5" selection-end-line="58" selection-end-column="5" />
|
||||
<folding>
|
||||
<element signature="e#857#858#0" expanded="true" />
|
||||
<element signature="e#886#887#0" expanded="true" />
|
||||
<element signature="e#1253#1254#0" expanded="true" />
|
||||
<element signature="e#1286#1287#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
@@ -59,8 +65,8 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="855">
|
||||
<caret line="45" column="75" selection-start-line="45" selection-start-column="75" selection-end-line="45" selection-end-column="75" />
|
||||
<state relative-caret-position="475">
|
||||
<caret line="25" selection-start-line="25" selection-end-line="25" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -68,8 +74,18 @@
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="269">
|
||||
<caret line="162" column="105" selection-start-line="162" selection-start-column="105" selection-end-line="162" selection-end-column="105" />
|
||||
<state relative-caret-position="1542">
|
||||
<caret line="213" column="65" selection-start-line="213" selection-start-column="65" selection-end-line="213" selection-end-column="65" />
|
||||
<folding>
|
||||
<element signature="e#1266#1267#0" expanded="true" />
|
||||
<element signature="e#1299#1300#0" expanded="true" />
|
||||
<element signature="e#1594#1595#0" expanded="true" />
|
||||
<element signature="e#1626#1627#0" expanded="true" />
|
||||
<element signature="e#1868#1869#0" expanded="true" />
|
||||
<element signature="e#1900#1901#0" expanded="true" />
|
||||
<element signature="e#2066#2067#0" expanded="true" />
|
||||
<element signature="e#2101#2102#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@@ -77,17 +93,29 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Travel.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="2033">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="108" column="65" selection-start-line="108" selection-start-column="65" selection-end-line="108" selection-end-column="65" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="114">
|
||||
<caret line="6" column="38" selection-start-line="6" selection-start-column="38" selection-end-line="6" selection-end-column="38" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Bank.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1235">
|
||||
<caret line="66" column="6" selection-start-line="66" selection-start-column="6" selection-end-line="66" selection-end-column="6" />
|
||||
<state relative-caret-position="535">
|
||||
<caret line="69" column="6" selection-start-line="69" selection-start-column="6" selection-end-line="69" selection-end-column="6" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -98,7 +126,7 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="817">
|
||||
<state relative-caret-position="421">
|
||||
<caret line="43" column="35" selection-start-line="43" selection-start-column="35" selection-end-line="43" selection-end-column="35" />
|
||||
</state>
|
||||
</provider>
|
||||
@@ -115,7 +143,6 @@
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>eek</find>
|
||||
<find>setg</find>
|
||||
<find>guns</find>
|
||||
<find>duplic</find>
|
||||
@@ -145,6 +172,7 @@
|
||||
<find>set</find>
|
||||
<find>player.</find>
|
||||
<find>System.out.println("\n*** PLACEHOLDER FOR LOAN SHARK ***\n");</find>
|
||||
<find>cargoSpace</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace>player.getName()</replace>
|
||||
@@ -169,14 +197,14 @@
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/src/Test.java" />
|
||||
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||
<option value="$PROJECT_DIR$/src/Player.java" />
|
||||
<option value="$PROJECT_DIR$/src/Warehouse.java" />
|
||||
<option value="$PROJECT_DIR$/src/Start.java" />
|
||||
<option value="$PROJECT_DIR$/src/Bank.java" />
|
||||
<option value="$PROJECT_DIR$/src/Travel.java" />
|
||||
<option value="$PROJECT_DIR$/src/loanShark.java" />
|
||||
<option value="$PROJECT_DIR$/src/main.java" />
|
||||
<option value="$PROJECT_DIR$/src/ShipWarfare.java" />
|
||||
<option value="$PROJECT_DIR$/src/Start.java" />
|
||||
<option value="$PROJECT_DIR$/src/Player.java" />
|
||||
<option value="$PROJECT_DIR$/src/TaipanShop.java" />
|
||||
</list>
|
||||
</option>
|
||||
@@ -192,8 +220,6 @@
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
@@ -210,6 +236,8 @@
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
<pane id="PackagesPane" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
@@ -438,7 +466,14 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1551060234136</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="19" />
|
||||
<task id="LOCAL-00019" summary="the comment somehow made it so that I couldn't compile (using the command line i couldn't compile, i could compile file using intellij) Also, you the file extended player, which is not necessary. You also were calling gameOver() and getName() directly, you needed "player." before all those methods.">
|
||||
<created>1551105597993</created>
|
||||
<option name="number" value="00019" />
|
||||
<option name="presentableId" value="LOCAL-00019" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1551105597993</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="20" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
@@ -448,7 +483,7 @@
|
||||
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26066098" />
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26865673" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Image Layers" order="2" />
|
||||
<window_info id="Designer" order="3" />
|
||||
@@ -501,7 +536,8 @@
|
||||
<MESSAGE value="Added a few comments to ShipWarfare" />
|
||||
<MESSAGE value="bunch of revisions, still in progress" />
|
||||
<MESSAGE value="linked all the classes together. The project is functional." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="linked all the classes together. The project is functional." />
|
||||
<MESSAGE value="the comment somehow made it so that I couldn't compile (using the command line i couldn't compile, i could compile file using intellij) Also, you the file extended player, which is not necessary. You also were calling gameOver() and getName() directly, you needed "player." before all those methods." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="the comment somehow made it so that I couldn't compile (using the command line i couldn't compile, i could compile file using intellij) Also, you the file extended player, which is not necessary. You also were calling gameOver() and getName() directly, you needed "player." before all those methods." />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/TaipanClone.iml">
|
||||
@@ -511,52 +547,20 @@
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Test.java" />
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-5040">
|
||||
<caret line="18" column="5" lean-forward="true" selection-start-line="18" selection-start-column="5" selection-end-line="18" selection-end-column="5" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/loanShark.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="779">
|
||||
<caret line="41" column="5" selection-start-line="41" selection-start-column="5" selection-end-line="41" selection-end-column="5" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="190">
|
||||
<caret line="10" column="24" selection-start-line="10" selection-start-column="24" selection-end-line="10" selection-end-column="24" />
|
||||
<folding>
|
||||
<element signature="e#860#861#0" expanded="true" />
|
||||
<element signature="e#886#887#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Warehouse.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="855">
|
||||
<caret line="45" column="75" selection-start-line="45" selection-start-column="75" selection-end-line="45" selection-end-column="75" />
|
||||
<state relative-caret-position="475">
|
||||
<caret line="25" selection-start-line="25" selection-end-line="25" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Travel.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="2033">
|
||||
<caret line="108" column="65" selection-start-line="108" selection-start-column="65" selection-end-line="108" selection-end-column="65" />
|
||||
</state>
|
||||
</provider>
|
||||
<entry file="file://$USER_HOME$/Desktop/src/main.java">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Bank.java">
|
||||
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1235">
|
||||
<caret line="66" column="6" selection-start-line="66" selection-start-column="6" selection-end-line="66" selection-end-column="6" />
|
||||
<state relative-caret-position="114">
|
||||
<caret line="6" column="38" selection-start-line="6" selection-start-column="38" selection-end-line="6" selection-end-column="38" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
@@ -565,22 +569,67 @@
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Start.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="817">
|
||||
<state relative-caret-position="421">
|
||||
<caret line="43" column="35" selection-start-line="43" selection-start-column="35" selection-end-line="43" selection-end-column="35" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Bank.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="69" column="6" selection-start-line="69" selection-start-column="6" selection-end-line="69" selection-end-column="6" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Travel.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="108" column="65" selection-start-line="108" selection-start-column="65" selection-end-line="108" selection-end-column="65" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="342">
|
||||
<caret line="18" column="34" selection-start-line="18" selection-start-column="34" selection-end-line="18" selection-end-column="34" />
|
||||
<state relative-caret-position="95">
|
||||
<caret line="5" column="41" lean-forward="true" selection-start-line="5" selection-start-column="41" selection-end-line="5" selection-end-column="41" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/loanShark.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="535">
|
||||
<caret line="47" column="5" selection-start-line="47" selection-start-column="5" selection-end-line="47" selection-end-column="5" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/Player.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1102">
|
||||
<caret line="58" column="5" selection-start-line="58" selection-start-column="5" selection-end-line="58" selection-end-column="5" />
|
||||
<folding>
|
||||
<element signature="e#1253#1254#0" expanded="true" />
|
||||
<element signature="e#1286#1287#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="269">
|
||||
<caret line="162" column="105" selection-start-line="162" selection-start-column="105" selection-end-line="162" selection-end-column="105" />
|
||||
<state relative-caret-position="1542">
|
||||
<caret line="213" column="65" selection-start-line="213" selection-start-column="65" selection-end-line="213" selection-end-column="65" />
|
||||
<folding>
|
||||
<element signature="e#1266#1267#0" expanded="true" />
|
||||
<element signature="e#1299#1300#0" expanded="true" />
|
||||
<element signature="e#1594#1595#0" expanded="true" />
|
||||
<element signature="e#1626#1627#0" expanded="true" />
|
||||
<element signature="e#1868#1869#0" expanded="true" />
|
||||
<element signature="e#1900#1901#0" expanded="true" />
|
||||
<element signature="e#2066#2067#0" expanded="true" />
|
||||
<element signature="e#2101#2102#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
|
||||
Binary file not shown.
@@ -16,6 +16,7 @@ public class Player {
|
||||
private int wGeneral = 0;
|
||||
private int wArms = 0;
|
||||
private boolean retire = false;
|
||||
private int cargoSpace = 60;
|
||||
|
||||
public Player(){
|
||||
|
||||
@@ -39,6 +40,24 @@ public class Player {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* getter method for the instance variable cargoSpace.
|
||||
* @return cargoSpace
|
||||
*/
|
||||
public int getCargoSpace() {
|
||||
return cargoSpace;
|
||||
}
|
||||
|
||||
/**
|
||||
* setter method for cargoSpace.
|
||||
* @param cargoSpace
|
||||
*/
|
||||
public void setCargoSpace(int cargoSpace) {
|
||||
if(cargoSpace > 0){
|
||||
this.cargoSpace = cargoSpace;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getRetire(){
|
||||
return retire;
|
||||
}
|
||||
|
||||
@@ -3,107 +3,161 @@ import java.util.Scanner;
|
||||
public class TaipanShop {
|
||||
|
||||
private Player player;
|
||||
private int cargoSpace = 60;
|
||||
private int currentCargo = 0;
|
||||
private int opiumPrice = 16000;
|
||||
private int silkPrice = 1600;
|
||||
private int armsPrice = 160;
|
||||
private int generalPrice = 8;
|
||||
|
||||
/**
|
||||
* This method is evoked if the user is eligible to win, and chooses to end the game (by winning).
|
||||
*/
|
||||
public void retire(){
|
||||
player.setRetire(true);
|
||||
System.out.println("You win!");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 playerDummy = new Player(player);
|
||||
this.player = playerDummy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 playerDummy = new Player(player);
|
||||
return playerDummy;
|
||||
}
|
||||
|
||||
/**
|
||||
* constructor; only runs when a Player object is provided. The constructor is fully encapsulated.
|
||||
*
|
||||
* @param player is a Player object that will be copied and the player instance variable is set to the copy.
|
||||
*/
|
||||
public TaipanShop(Player player){
|
||||
Player playerDummy = new Player(player);
|
||||
this.player = playerDummy;
|
||||
}
|
||||
|
||||
public int getCargoSpace() {
|
||||
return cargoSpace;
|
||||
}
|
||||
|
||||
public void setCargoSpace(int cargoSpace) {
|
||||
if(cargoSpace > 0){
|
||||
this.cargoSpace = cargoSpace;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getOpiumPrice() {
|
||||
return opiumPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param opiumPrice
|
||||
*/
|
||||
public void setOpiumPrice(int opiumPrice) {
|
||||
if(opiumPrice > 0){
|
||||
this.opiumPrice = opiumPrice;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getSilkPrice() {
|
||||
return silkPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param silkPrice
|
||||
*/
|
||||
public void setSilkPrice(int silkPrice) {
|
||||
if(silkPrice > 0){
|
||||
this.silkPrice = silkPrice;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getArmsPrice() {
|
||||
return armsPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param armsPrice
|
||||
*/
|
||||
public void setArmsPrice(int armsPrice) {
|
||||
if(armsPrice > 0){
|
||||
this.armsPrice = armsPrice;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getGeneralPrice() {
|
||||
return generalPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param generalPrice
|
||||
*/
|
||||
public void setGeneralPrice(int generalPrice) {
|
||||
if(generalPrice > 0){
|
||||
this.generalPrice = generalPrice;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void travel(){
|
||||
Travel travel = new Travel(player);
|
||||
travel.travelTo();
|
||||
player = travel.getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void warehouse(){
|
||||
Warehouse warehouse = new Warehouse(player);
|
||||
warehouse.changeWarehouse();
|
||||
player = warehouse.getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void bank(){
|
||||
Bank bank = new Bank(player);
|
||||
bank.bank();
|
||||
player = bank.getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void loan(){
|
||||
loanShark loan = new loanShark(player);
|
||||
loan.loanMoney();
|
||||
player = loan.getPlayer();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void updatePrices(){
|
||||
String s = "\n" + player.getName() + ", the price of ";
|
||||
double value = 80*Math.random();
|
||||
@@ -149,12 +203,15 @@ public class TaipanShop {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void printShop(){
|
||||
currentCargo = player.getOpiumHeld()+player.getGuns()*10+player.getSilkHeld()+player.getArmsHeld()+player.getGeneralHeld();
|
||||
if(cargoSpace - currentCargo < 0){
|
||||
int currentCargo = player.getOpiumHeld()+player.getGuns()*10+player.getSilkHeld()+player.getArmsHeld()+player.getGeneralHeld();
|
||||
if(player.getCargoSpace() - currentCargo < 0){
|
||||
System.out.println("Hold: Overloaded" + " Guns: " + player.getGuns() + " HP: " + player.getHP() +"%");
|
||||
}else{
|
||||
System.out.println("Hold: " + (cargoSpace-currentCargo) + " Guns: " + player.getGuns() + " HP: " + player.getHP() +"%");
|
||||
System.out.println("Hold: " + (player.getCargoSpace()-currentCargo) + " Guns: " + player.getGuns() + " HP: " + player.getHP() +"%");
|
||||
}
|
||||
System.out.println("-------------------------------------------------------------");
|
||||
System.out.println(" Opium: " + player.getOpiumHeld() + " Silk: " + player.getSilkHeld());
|
||||
@@ -166,6 +223,11 @@ public class TaipanShop {
|
||||
System.out.println(" Arms: " + armsPrice + " General: " + generalPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param notDone
|
||||
* @param input
|
||||
*/
|
||||
public void atLocationOne(boolean notDone, Scanner input){
|
||||
while(notDone){
|
||||
printShop();
|
||||
@@ -314,6 +376,11 @@ public class TaipanShop {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param notDone
|
||||
* @param input
|
||||
*/
|
||||
public void notAtLocationOne(boolean notDone, Scanner input){
|
||||
while(notDone){
|
||||
printShop();
|
||||
@@ -454,6 +521,11 @@ public class TaipanShop {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param notDone
|
||||
* @param input
|
||||
*/
|
||||
public void retireAndLocationOne(boolean notDone, Scanner input){
|
||||
while(notDone){
|
||||
printShop();
|
||||
@@ -604,6 +676,9 @@ public class TaipanShop {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void shop() {
|
||||
updatePrices();
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
Reference in New Issue
Block a user