Merge remote-tracking branch 'origin/master'

This commit is contained in:
2019-03-11 19:40:25 -06:00
4 changed files with 174 additions and 120 deletions

2
.idea/misc.xml generated
View File

@@ -9,7 +9,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" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">

203
.idea/workspace.xml generated
View File

@@ -1,10 +1,7 @@
<?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="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ShipWarfareGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ShipWarfareGUI.java" afterDir="false" />
</list>
<list default="true" id="3114a2b9-4919-4fdf-8fd9-d03b60109ce4" name="Default Changelist" comment="" />
<ignored path="$PROJECT_DIR$/out/" />
<ignored path="C:\Users\Harkamal Randhawa\IdeaProjects\TaipanClone\.idea\shelf/" />
<ignored path="$PROJECT_DIR$/.idea/shelf/" />
@@ -16,20 +13,41 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/MainGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" column="26" selection-start-line="14" selection-start-column="26" selection-end-line="14" selection-end-column="26" />
<state relative-caret-position="651">
<caret line="38" column="39" selection-start-line="38" selection-start-column="39" selection-end-line="38" selection-end-column="39" />
</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="308">
<caret line="214" column="38" selection-start-line="214" selection-start-column="38" selection-end-line="214" 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/GameEndGUI.java">
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
<state relative-caret-position="1764">
<caret line="84" column="44" selection-start-line="84" selection-start-column="44" selection-end-line="84" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="9114">
<caret line="453" column="33" selection-start-line="453" selection-start-column="33" selection-end-line="453" selection-end-column="33" />
</state>
</provider>
</entry>
@@ -37,31 +55,44 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TaipanShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6750">
<caret line="450" column="35" lean-forward="true" selection-start-line="450" selection-start-column="35" selection-end-line="450" selection-end-column="35" />
<state relative-caret-position="204">
<caret line="95" column="42" lean-forward="true" selection-start-line="95" selection-start-column="42" selection-end-line="95" selection-end-column="42" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="imports" expanded="true" />
<element signature="e#3406#3407#0" expanded="true" />
<element signature="e#3439#3440#0" expanded="true" />
<element signature="e#3950#3951#0" expanded="true" />
<element signature="e#3982#3983#0" expanded="true" />
<element signature="e#4485#4486#0" expanded="true" />
<element signature="e#4517#4518#0" expanded="true" />
<element signature="e#5038#5039#0" expanded="true" />
<element signature="e#5073#5074#0" expanded="true" />
<element signature="e#25255#25256#0" expanded="true" />
<element signature="e#25300#25301#0" expanded="true" />
<element signature="e#23606#23607#0" expanded="true" />
<element signature="e#23651#23652#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<entry file="file://$PROJECT_DIR$/src/GameEndGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="10" selection-start-line="10" selection-end-line="15" selection-end-column="2" />
<state relative-caret-position="42">
<caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
</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="5901">
<caret line="300" column="9" selection-start-line="300" selection-start-column="9" selection-end-line="300" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/LoanSharkGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="35" column="7" selection-start-line="35" selection-start-column="7" selection-end-line="35" selection-end-column="7" />
</state>
</provider>
</entry>
@@ -151,6 +182,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
@@ -168,7 +200,6 @@
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
@@ -569,13 +600,13 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="83977000" />
<option name="totallyTimeSpent" value="84236000" />
</component>
<component name="ToolWindowManager">
<frame x="6" y="26" width="1189" height="652" extended-state="0" />
<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.2798605" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.18123667" />
<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" />
@@ -584,7 +615,7 @@
<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" weight="0.32922733" />
<window_info anchor="bottom" id="Run" order="2" weight="0.9357143" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.9357143" />
<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" />
@@ -742,66 +773,23 @@
<entry file="file://$PROJECT_DIR$/src/Warehouse.java" />
<entry file="file://$PROJECT_DIR$/src/Bank.java" />
<entry file="file://$PROJECT_DIR$/src/TaipanShop.java" />
<entry file="file://$PROJECT_DIR$/src/Travel.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="27">
<caret line="125" column="63" selection-start-line="125" selection-start-column="63" selection-end-line="125" selection-end-column="63" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/javafx-src.zip!/com/sun/glass/ui/InvokeLaterDispatcher.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="140">
<caret line="110" column="19" selection-start-line="110" selection-start-column="19" selection-end-line="110" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Travel.java" />
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/javafx-src.zip!/com/sun/glass/ui/InvokeLaterDispatcher.java" />
<entry file="file://$PROJECT_DIR$/src/ShopGUI" />
<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>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="13" column="5" lean-forward="true" selection-start-line="13" selection-start-column="5" selection-end-line="13" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1074">
<caret line="17" column="35" selection-start-line="17" selection-start-column="35" selection-end-line="17" selection-end-column="35" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/MainGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="780">
<caret line="55" column="28" selection-start-line="53" selection-start-column="7" selection-end-line="55" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Start.java" />
<entry file="file://$PROJECT_DIR$/src/main.java" />
<entry file="file://$PROJECT_DIR$/src/ShipWarfare.java" />
<entry file="file://$PROJECT_DIR$/src/TravelGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6615">
<caret line="465" column="42" selection-start-line="465" selection-start-column="42" selection-end-line="465" selection-end-column="42" />
<state relative-caret-position="9114">
<caret line="453" column="33" selection-start-line="453" selection-start-column="33" selection-end-line="453" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Player.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="5" lean-forward="true" selection-start-column="5" selection-end-column="5" />
<state relative-caret-position="1764">
<caret line="84" column="44" selection-start-line="84" selection-start-column="44" selection-end-line="84" selection-end-column="44" />
</state>
</provider>
</entry>
@@ -814,43 +802,48 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/GameEndGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<state relative-caret-position="42">
<caret line="14" column="13" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TaipanShopGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6750">
<caret line="450" column="35" lean-forward="true" selection-start-line="450" selection-start-column="35" selection-end-line="450" selection-end-column="35" />
<state relative-caret-position="204">
<caret line="95" column="42" lean-forward="true" selection-start-line="95" selection-start-column="42" selection-end-line="95" selection-end-column="42" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="imports" expanded="true" />
<element signature="e#3406#3407#0" expanded="true" />
<element signature="e#3439#3440#0" expanded="true" />
<element signature="e#3950#3951#0" expanded="true" />
<element signature="e#3982#3983#0" expanded="true" />
<element signature="e#4485#4486#0" expanded="true" />
<element signature="e#4517#4518#0" expanded="true" />
<element signature="e#5038#5039#0" expanded="true" />
<element signature="e#5073#5074#0" expanded="true" />
<element signature="e#25255#25256#0" expanded="true" />
<element signature="e#25300#25301#0" expanded="true" />
<element signature="e#23606#23607#0" expanded="true" />
<element signature="e#23651#23652#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="10" selection-start-line="10" selection-end-line="15" selection-end-column="2" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ShipWarfareGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="14" column="26" selection-start-line="14" selection-start-column="26" selection-end-line="14" selection-end-column="26" />
<state relative-caret-position="5901">
<caret line="300" column="9" selection-start-line="300" selection-start-column="9" selection-end-line="300" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/MainGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="651">
<caret line="38" column="39" selection-start-line="38" selection-start-column="39" selection-end-line="38" selection-end-column="39" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartGUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="308">
<caret line="214" column="38" selection-start-line="214" selection-start-column="38" selection-end-line="214" selection-end-column="38" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>

View File

@@ -212,7 +212,7 @@ public class StartGUI {
if (response.equalsIgnoreCase("Vikram")) {
player.setMoney(999999999);
player.setBank(999999999);
player.setGuns(0);
player.setGuns(999);
player.setHP(99999999);
player.setCargoSpace(Integer.MAX_VALUE);
}

View File

@@ -128,7 +128,7 @@ public class TaipanShopGUI {
}
} else {
if (value < 7) {
player.setOpiumPrice(1);
player.setGeneralPrice(1);
textOut.setText(s + "General Cargo has dropped to 1!!!\n" + textOut.getText());
} else {
player.setGeneralPrice(player.getGeneralPrice() * 5);
@@ -401,8 +401,13 @@ public class TaipanShopGUI {
buyButton.setPrefHeight(25.0);
buyButton.setPrefWidth(45.0);
buyButton.setText("Buy");
// if the buy button is clicked, the main utility buttons are set to be invisible and the buying process begins.
buyButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* if the buy button is clicked, the main utility buttons are set to be invisible and the buying process begins.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("shop");
@@ -416,6 +421,12 @@ public class TaipanShopGUI {
sellButton.setText("Sell");
// if the sell button is clicked, the main utility buttons are set to be invisible and the selling process begins.
sellButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* if the sell button is clicked, the main utility buttons are set to be invisible and the selling process begins.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("shop");
@@ -428,8 +439,13 @@ public class TaipanShopGUI {
sellButton.setMnemonicParsing(false);
bankButton.setPrefHeight(25.0);
// opens the bank if the bank button is clicked.
bankButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* opens the bank if the bank button is clicked.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
BankGUI bank = new BankGUI(getPlayer());
@@ -445,8 +461,13 @@ public class TaipanShopGUI {
cargoButton.setText("Transfer");
cargoButton.setMnemonicParsing(false);
cargoButton.setPrefWidth(94.0);
// warehouse is entered when the warehouse button is clicked.
cargoButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* warehouse is entered when the warehouse button is clicked.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
WarehouseGUI warehouseGUI = new WarehouseGUI(player);
@@ -459,8 +480,13 @@ public class TaipanShopGUI {
loanButton.setMnemonicParsing(false);
loanButton.setPrefHeight(25.0);
loanButton.setPrefWidth(73.0);
// loan office is entered when the loan button is clicked.
loanButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* loan office is entered when the loan button is clicked.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
LoanSharkGUI loan = new LoanSharkGUI(getPlayer());
@@ -474,8 +500,13 @@ public class TaipanShopGUI {
quitButton.setMnemonicParsing(false);
quitButton.setPrefWidth(90.0);
quitButton.setText("Quit");
// the user is free to travel once the quit button is clicked.
quitButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the user is free to travel once the quit button is clicked.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
player.setIsPriceChanged(1);
@@ -490,8 +521,13 @@ public class TaipanShopGUI {
retireButton.setPrefWidth(49.0);
retireButton.setText("Retire");
retireButton.setVisible(false);
// the user wins the game when the retire button is clicked.
retireButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the user wins the game when the retire button is clicked.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
retire(stage);
@@ -504,8 +540,13 @@ public class TaipanShopGUI {
opiumButton.setPrefHeight(25.0);
opiumButton.setText("Opium");
opiumButton.setVisible(false);
// the opium buying/selling process starts as soon as the user clicks the opium button.
opiumButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the opium buying/selling process starts as soon as the user clicks the opium button.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("input");
@@ -526,8 +567,13 @@ public class TaipanShopGUI {
silkButton.setMnemonicParsing(false);
silkButton.setText("Silk");
silkButton.setVisible(false);
// the silk buying/selling process starts as soon as the user clicks the silk button.
silkButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the silk buying/selling process starts as soon as the user clicks the silk button.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("input");
@@ -546,8 +592,13 @@ public class TaipanShopGUI {
armsButton.setPrefWidth(86.0);
armsButton.setMnemonicParsing(false);
armsButton.setVisible(false);
// the arms buying/selling process starts as soon as the user clicks the arms button.
armsButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the arms buying/selling process starts as soon as the user clicks the arms button.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("input");
@@ -570,8 +621,13 @@ public class TaipanShopGUI {
generalButton.setPrefWidth(86.0);
generalButton.setText("General");
generalButton.setVisible(false);
// the general cargo buying/selling process starts as soon as the user clicks the general cargo button.
generalButton.setOnAction(new EventHandler<ActionEvent>() {
/**
* the general cargo buying/selling process starts as soon as the user clicks the general cargo button.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(ActionEvent event) {
buttonSetup("input");
@@ -590,9 +646,14 @@ public class TaipanShopGUI {
numberInput.setAlignment(javafx.geometry.Pos.CENTER_RIGHT);
numberInput.setText("Enter amount here...");
numberInput.setVisible(false);
// after the user inputs a valid input into the text field and presses Z or ENTER, the buying/selling ends and
// the user is returned to the regular shop dialogue.
numberInput.setOnKeyPressed(new EventHandler<KeyEvent>() {
/**
* after the user inputs a valid input into the text field and presses Z or ENTER, the buying/selling ends
* and the user is returned to the regular shop dialogue.
*
* @param event -- the event corresponding to the button click
*/
@Override
public void handle(KeyEvent event) {
boolean exit = true;