Merge remote-tracking branch 'origin/master'

This commit is contained in:
2019-02-19 17:49:30 -07:00
2 changed files with 101 additions and 121 deletions

172
.idea/workspace.xml generated
View File

@@ -2,9 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<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$/out/production/TaipanClone/ShipWarfare.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/TaipanClone/ShipWarfare.class" 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/" />
@@ -19,8 +17,8 @@
<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="-673">
<caret line="9" column="55" selection-start-line="9" selection-start-column="55" selection-end-line="9" selection-end-column="55" />
<state relative-caret-position="171">
<caret line="11" column="36" selection-start-line="11" selection-start-column="36" selection-end-line="11" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1150#1151#0" expanded="true" />
@@ -32,46 +30,33 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Player.java">
<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="30">
<caret line="2" column="35" lean-forward="true" selection-start-line="2" selection-start-column="35" selection-end-line="2" selection-end-column="35" />
<state relative-caret-position="-3629">
<caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
<folding>
<element signature="e#350#351#0" expanded="true" />
<element signature="e#377#378#0" expanded="true" />
<element signature="e#417#418#0" expanded="true" />
<element signature="e#449#450#0" expanded="true" />
<element signature="e#475#476#0" expanded="true" />
<element signature="e#500#501#0" expanded="true" />
<element signature="imports" expanded="true" />
<element signature="e#333#334#0" expanded="true" />
<element signature="e#366#367#0" expanded="true" />
<element signature="e#333#334#0" expanded="true" />
<element signature="e#366#367#0" expanded="true" />
<element signature="e#492#493#0" expanded="true" />
<element signature="e#524#525#0" expanded="true" />
<element signature="e#646#647#0" expanded="true" />
<element signature="e#678#679#0" expanded="true" />
<element signature="e#803#804#0" expanded="true" />
<element signature="e#838#839#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<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="810">
<caret line="55" column="30" lean-forward="true" selection-start-line="55" selection-start-column="30" selection-end-line="55" selection-end-column="30" />
<folding>
<element signature="e#371#372#0" expanded="true" />
<element signature="e#404#405#0" expanded="true" />
<element signature="e#453#454#0" expanded="true" />
<element signature="e#497#498#0" expanded="true" />
<element signature="e#530#531#0" expanded="true" />
<element signature="e#562#563#0" expanded="true" />
<element signature="e#609#610#0" expanded="true" />
<element signature="e#651#652#0" expanded="true" />
<element signature="e#684#685#0" expanded="true" />
<element signature="e#716#717#0" expanded="true" />
<element signature="e#763#764#0" expanded="true" />
<element signature="e#805#806#0" expanded="true" />
<element signature="e#841#842#0" expanded="true" />
<element signature="e#876#877#0" expanded="true" />
<element signature="e#929#930#0" expanded="true" />
<element signature="e#977#978#0" expanded="true" />
</folding>
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
@@ -94,18 +79,17 @@
<find>bank</find>
<find>player.getMoney() += num *</find>
<find>opiumHeld</find>
<find>hp</find>
<find>player.</find>
<find>silkPrice</find>
</findStrings>
<replaceStrings>
<replace>player.getName()</replace>
<replace>player.getBank()</replace>
<replace>player.setMoney(player.getMoney() + num*)</replace>
<replace>player.getOpiumHeld()</replace>
<replace>getSilkPrice()</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="UPDATE_TYPE" value="MERGE" />
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
@@ -127,7 +111,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
@@ -145,17 +128,18 @@
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1550552776844" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1550596140450" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
<property name="settings.editor.selected.configurable" value="project.propVCSSupport.Mappings" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
@@ -169,7 +153,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Application.ShipWarfare">
<component name="RunManager" selected="Application.TaipanShop">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="TaipanClone" />
@@ -201,8 +185,8 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Application.ShipWarfare" />
<item itemvalue="Application.TaipanShop" />
<item itemvalue="Application.ShipWarfare" />
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
@@ -219,9 +203,6 @@
<option name="presentableId" value="Default" />
<updated>1550454898506</updated>
<workItem from="1550454902781" duration="459000" />
<workItem from="1550550806467" duration="577000" />
<workItem from="1550552635138" duration="118000" />
<workItem from="1550553016386" duration="1451000" />
</task>
<task id="LOCAL-00001" summary="Added troll comments">
<created>1550458807806</created>
@@ -244,16 +225,24 @@
<option name="project" value="LOCAL" />
<updated>1550544805794</updated>
</task>
<option name="localTasksCounter" value="4" />
<task id="LOCAL-00004" summary="the shop now uses the player class as a parent class.">
<created>1550544933067</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1550544933067</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="2605000" />
<option name="totallyTimeSpent" value="459000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="709" extended-state="6" />
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.27786753" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.17857143" />
<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" />
@@ -262,17 +251,17 @@
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3273906" />
<window_info anchor="bottom" id="Run" order="2" weight="0.32827735" />
<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="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49946696" weight="0.32936078" />
<window_info active="true" anchor="bottom" id="Version Control" order="8" sideWeight="0.49946696" visible="true" weight="0.032502707" />
<window_info anchor="bottom" id="Database Changes" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" weight="0.32936078" />
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50053304" side_tool="true" weight="0.32901135" />
<window_info anchor="bottom" id="Messages" order="12" weight="0.60777956" />
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50053304" side_tool="true" weight="0.32936078" />
<window_info anchor="bottom" id="Messages" order="12" weight="0.32827735" />
<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" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -300,35 +289,10 @@
<entry file="file://$PROJECT_DIR$/TaipanClone.iml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/.idea/misc.xml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" lean-forward="true" selection-start-line="2" selection-end-line="2" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="35" lean-forward="true" selection-start-line="2" selection-start-column="35" selection-end-line="2" selection-end-column="35" />
<folding>
<element signature="e#350#351#0" expanded="true" />
<element signature="e#377#378#0" expanded="true" />
<element signature="e#417#418#0" expanded="true" />
<element signature="e#449#450#0" expanded="true" />
<element signature="e#475#476#0" expanded="true" />
<element signature="e#500#501#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="-673">
<caret line="9" column="55" selection-start-line="9" selection-start-column="55" selection-end-line="9" selection-end-column="55" />
<state relative-caret-position="171">
<caret line="11" column="36" selection-start-line="11" selection-start-column="36" selection-end-line="11" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1150#1151#0" expanded="true" />
@@ -339,27 +303,29 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="55" column="30" lean-forward="true" selection-start-line="55" selection-start-column="30" selection-end-line="55" selection-end-column="30" />
<state relative-caret-position="-3629">
<caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
<folding>
<element signature="e#371#372#0" expanded="true" />
<element signature="e#404#405#0" expanded="true" />
<element signature="e#453#454#0" expanded="true" />
<element signature="e#497#498#0" expanded="true" />
<element signature="e#530#531#0" expanded="true" />
<element signature="e#562#563#0" expanded="true" />
<element signature="e#609#610#0" expanded="true" />
<element signature="e#651#652#0" expanded="true" />
<element signature="e#684#685#0" expanded="true" />
<element signature="e#716#717#0" expanded="true" />
<element signature="e#763#764#0" expanded="true" />
<element signature="e#805#806#0" expanded="true" />
<element signature="e#841#842#0" expanded="true" />
<element signature="e#876#877#0" expanded="true" />
<element signature="e#929#930#0" expanded="true" />
<element signature="e#977#978#0" expanded="true" />
<element signature="imports" expanded="true" />
<element signature="e#333#334#0" expanded="true" />
<element signature="e#366#367#0" expanded="true" />
<element signature="e#333#334#0" expanded="true" />
<element signature="e#366#367#0" expanded="true" />
<element signature="e#492#493#0" expanded="true" />
<element signature="e#524#525#0" expanded="true" />
<element signature="e#646#647#0" expanded="true" />
<element signature="e#678#679#0" expanded="true" />
<element signature="e#803#804#0" expanded="true" />
<element signature="e#838#839#0" expanded="true" />
</folding>
</state>
</provider>
@@ -404,7 +370,7 @@
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8.0_201</last-edited>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>

View File

@@ -1,7 +1,7 @@
import java.util.Random;
import java.util.Scanner;
public class TaipanShop extends Player {
private int cargoSpace = 60;
private int currentCargo = 0;
private int opiumPrice = 16000;
@@ -9,12 +9,24 @@ public class TaipanShop extends Player {
private int armsPrice = 160;
private int generalPrice = 8;
public int getCargoSpace() {
return cargoSpace;
}
public void setCargoSpace(int cargoSpace) {
if(cargoSpace > 0){
this.cargoSpace = cargoSpace;
}
}
public int getOpiumPrice() {
return opiumPrice;
}
public void setOpiumPrice(int opiumPrice) {
this.opiumPrice = opiumPrice;
if(opiumPrice > 0){
this.opiumPrice = opiumPrice;
}
}
public int getSilkPrice() {
@@ -22,7 +34,9 @@ public class TaipanShop extends Player {
}
public void setSilkPrice(int silkPrice) {
this.silkPrice = silkPrice;
if(silkPrice > 0){
this.silkPrice = silkPrice;
}
}
public int getArmsPrice() {
@@ -30,7 +44,9 @@ public class TaipanShop extends Player {
}
public void setArmsPrice(int armsPrice) {
this.armsPrice = armsPrice;
if(armsPrice > 0){
this.armsPrice = armsPrice;
}
}
public int getGeneralPrice() {
@@ -38,29 +54,28 @@ public class TaipanShop extends Player {
}
public void setGeneralPrice(int generalPrice) {
this.generalPrice = generalPrice;
if(generalPrice > 0){
this.generalPrice = generalPrice;
}
}
private void updatePrices(){
String s = "\n" + getName() + ", the price of ";
double value = 80*Math.random();
Random rand = new Random();
setOpiumPrice((rand.nextInt(201) + 60)*100);
setSilkPrice((rand.nextInt(201) + 60)*10);
setArmsPrice((rand.nextInt(21) + 6)*10);
setGeneralPrice(rand.nextInt(17) + 4);
opiumPrice = (rand.nextInt(201) + 60)*100;
silkPrice = (rand.nextInt(201) + 60)*10;
armsPrice = (rand.nextInt(21) + 6)*10;
generalPrice = rand.nextInt(17) + 4;
if(value < 8){
if(value < 2){
if(value < 1){
setOpiumPrice(getOpiumPrice()/5);
System.out.println(s + "Opium has dropped to " + getOpiumPrice() +"!!!\n");
opiumPrice /= 5;
System.out.println(s + "Opium has dropped to " + opiumPrice +"!!!\n");
}else{
setOpiumPrice(getOpiumPrice()*5);
System.out.println(s + "Opium has risen to " + getOpiumPrice() +"!!!\n");
opiumPrice *= 5;
System.out.println(s + "Opium has risen to " + opiumPrice +"!!!\n");
}
}else if(value < 4){
if(value < 3){
silkPrice /= 5;
@@ -399,5 +414,4 @@ public class TaipanShop extends Player {
TaipanShop shop = new TaipanShop();
shop.shop();
}
}
}