diff --git a/docs/README.md b/docs/README.md index 30d6cc9d91..817b44beef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ ## Features -commands.Command Format: +logic.commands.Command Format: - text ### Feature 1.1. Resume previous version of choice: `load` diff --git a/docs/team/JingXuan.adoc b/docs/team/JingXuan.adoc index f39e76e49b..f155a7ed47 100644 --- a/docs/team/JingXuan.adoc +++ b/docs/team/JingXuan.adoc @@ -13,13 +13,13 @@ AddressBook - Level 3 is a desktop address book application used for teaching So == Summary of contributions -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. +* *Major enhancement*: added *the ability to undo/redo previous logic.commands* +** What it does: allows the user to undo all previous logic.commands one at a time. Preceding undo logic.commands can be reversed by using the redo command. +** Justification: This feature improves the product significantly because a user can make mistakes in logic.commands and the app should provide a convenient way to rectify them. +** Highlights: This enhancement affects existing logic.commands and logic.commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing logic.commands. ** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. +* *Minor enhancement*: added a history command that allows the user to navigate to previous logic.commands using up/down keys. * *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ diff --git a/docs/team/John.adoc b/docs/team/John.adoc index 5bdd53ecc5..4cf7a212c1 100644 --- a/docs/team/John.adoc +++ b/docs/team/John.adoc @@ -19,13 +19,13 @@ With interactive gameplay and gamification, we hope that FarmLogic will be able == Summary of contributions -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. +* *Major enhancement*: added *the ability to undo/redo previous logic.commands* +** What it does: allows the user to undo all previous logic.commands one at a time. Preceding undo logic.commands can be reversed by using the redo command. +** Justification: This feature improves the product significantly because a user can make mistakes in logic.commands and the app should provide a convenient way to rectify them. +** Highlights: This enhancement affects existing logic.commands and logic.commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing logic.commands. ** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. +* *Minor enhancement*: added a history command that allows the user to navigate to previous logic.commands using up/down keys. * *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ diff --git a/docs/team/jinghui.adoc b/docs/team/jinghui.adoc index a028680745..dfb002ce5e 100644 --- a/docs/team/jinghui.adoc +++ b/docs/team/jinghui.adoc @@ -13,13 +13,13 @@ FarmLogic is a game that is targeted to children aged between 11 and 14, and aim == Summary of contributions -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. +* *Major enhancement*: added *the ability to undo/redo previous logic.commands* +** What it does: allows the user to undo all previous logic.commands one at a time. Preceding undo logic.commands can be reversed by using the redo command. +** Justification: This feature improves the product significantly because a user can make mistakes in logic.commands and the app should provide a convenient way to rectify them. +** Highlights: This enhancement affects existing logic.commands and logic.commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing logic.commands. ** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. +* *Minor enhancement*: added a history command that allows the user to navigate to previous logic.commands using up/down keys. * *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ diff --git a/docs/team/umar.adoc b/docs/team/umar.adoc index 729a28af06..09bb529bb2 100644 --- a/docs/team/umar.adoc +++ b/docs/team/umar.adoc @@ -27,13 +27,13 @@ FarmLogic == Summary of contributions -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. +* *Major enhancement*: added *the ability to undo/redo previous logic.commands* +** What it does: allows the user to undo all previous logic.commands one at a time. Preceding undo logic.commands can be reversed by using the redo command. +** Justification: This feature improves the product significantly because a user can make mistakes in logic.commands and the app should provide a convenient way to rectify them. +** Highlights: This enhancement affects existing logic.commands and logic.commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing logic.commands. ** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. +* *Minor enhancement*: added a history command that allows the user to navigate to previous logic.commands using up/down keys. * *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ diff --git a/docs/team/zhengwen.adoc b/docs/team/zhengwen.adoc index f39e76e49b..f155a7ed47 100644 --- a/docs/team/zhengwen.adoc +++ b/docs/team/zhengwen.adoc @@ -13,13 +13,13 @@ AddressBook - Level 3 is a desktop address book application used for teaching So == Summary of contributions -* *Major enhancement*: added *the ability to undo/redo previous commands* -** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. -** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. -** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. +* *Major enhancement*: added *the ability to undo/redo previous logic.commands* +** What it does: allows the user to undo all previous logic.commands one at a time. Preceding undo logic.commands can be reversed by using the redo command. +** Justification: This feature improves the product significantly because a user can make mistakes in logic.commands and the app should provide a convenient way to rectify them. +** Highlights: This enhancement affects existing logic.commands and logic.commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing logic.commands. ** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_ -* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys. +* *Minor enhancement*: added a history command that allows the user to navigate to previous logic.commands using up/down keys. * *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_ diff --git a/farmio.log.1 b/farmio.log.1 index c1805f5f07..f52bcd064c 100644 --- a/farmio.log.1 +++ b/farmio.log.1 @@ -1,4 +1,4 @@ Nov 06, 2019 1:34:09 PM farmio.Farmio run INFO: New game session started. -Nov 06, 2019 1:34:19 PM farmio.Parser parse +Nov 06, 2019 1:34:19 PM logic.Parser parse INFO: Deteched invalid command at stage: MENU_START command: diff --git a/src/main/java/farmio/Farmio.java b/src/main/java/farmio/Farmio.java index 8ccdb2e1ad..64852e7ad8 100644 --- a/src/main/java/farmio/Farmio.java +++ b/src/main/java/farmio/Farmio.java @@ -1,13 +1,18 @@ package farmio; -import commands.Command; -import commands.CommandWelcome; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import gameassets.Farmer; +import gameassets.Level; +import logic.commands.Command; +import logic.commands.CommandWelcome; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import frontend.AsciiColours; import frontend.Simulation; import frontend.Ui; import frontend.UiManager; +import logic.Logic; +import storage.Storage; +import storage.StorageManager; import java.io.IOException; import java.util.EnumSet; diff --git a/src/main/java/exceptions/FarmioException.java b/src/main/java/farmio/exceptions/FarmioException.java similarity index 82% rename from src/main/java/exceptions/FarmioException.java rename to src/main/java/farmio/exceptions/FarmioException.java index c74bd9d680..4029d0c912 100644 --- a/src/main/java/exceptions/FarmioException.java +++ b/src/main/java/farmio/exceptions/FarmioException.java @@ -1,4 +1,4 @@ -package exceptions; +package farmio.exceptions; public class FarmioException extends Exception { public FarmioException(String error) { diff --git a/src/main/java/exceptions/FarmioFatalException.java b/src/main/java/farmio/exceptions/FarmioFatalException.java similarity index 83% rename from src/main/java/exceptions/FarmioFatalException.java rename to src/main/java/farmio/exceptions/FarmioFatalException.java index 18dbd4ccfa..a1697494cf 100644 --- a/src/main/java/exceptions/FarmioFatalException.java +++ b/src/main/java/farmio/exceptions/FarmioFatalException.java @@ -1,4 +1,4 @@ -package exceptions; +package farmio.exceptions; public class FarmioFatalException extends Exception { public FarmioFatalException(String message) { diff --git a/src/main/java/frontend/GameConsole.java b/src/main/java/frontend/GameConsole.java index ab6ad4481c..841ba4acbe 100644 --- a/src/main/java/frontend/GameConsole.java +++ b/src/main/java/frontend/GameConsole.java @@ -1,6 +1,6 @@ package frontend; -import farmio.Farmer; +import gameassets.Farmer; import java.util.Map; import java.util.ArrayList; diff --git a/src/main/java/farmio/Menu.java b/src/main/java/frontend/Menu.java similarity index 92% rename from src/main/java/farmio/Menu.java rename to src/main/java/frontend/Menu.java index 2de227b01c..854f29fa10 100644 --- a/src/main/java/farmio/Menu.java +++ b/src/main/java/frontend/Menu.java @@ -1,8 +1,6 @@ -package farmio; +package frontend; -import exceptions.FarmioFatalException; -import frontend.Simulation; -import frontend.Ui; +import farmio.exceptions.FarmioFatalException; public class Menu { diff --git a/src/main/java/frontend/Simulation.java b/src/main/java/frontend/Simulation.java index 7c5c0908f8..70720246c9 100644 --- a/src/main/java/frontend/Simulation.java +++ b/src/main/java/frontend/Simulation.java @@ -1,10 +1,10 @@ package frontend; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Farmer; -import farmio.Level; -import farmio.Storage; +import gameassets.Farmer; +import gameassets.Level; +import storage.Storage; public class Simulation { private static final int SLEEP_TIME = 300; @@ -131,7 +131,7 @@ public void showNarrative() throws FarmioFatalException { simulate(); ui.showWarning("Invalid Command for story mode!"); ui.show("Story segment only accepts [skip] to skip the story or pressing [ENTER] to continue with the " - + "narrative.\nIf you wish to use other commands, enter [skip] followed by entering the " + + "narrative.\nIf you wish to use other logic.commands, enter [skip] followed by entering the " + "command of your choice."); userInput = ui.getInput(); } diff --git a/src/main/java/frontend/Ui.java b/src/main/java/frontend/Ui.java index aceda45470..c5efaa7a5e 100644 --- a/src/main/java/frontend/Ui.java +++ b/src/main/java/frontend/Ui.java @@ -1,10 +1,5 @@ package frontend; -import exceptions.FarmioFatalException; -import farmio.Level; - -import java.util.Scanner; - public interface Ui { /** * Removes the clear screen string if the OS is windows. diff --git a/src/main/java/frontend/UiDummy.java b/src/main/java/frontend/UiDummy.java index c4df52f2ff..f766c0c985 100644 --- a/src/main/java/frontend/UiDummy.java +++ b/src/main/java/frontend/UiDummy.java @@ -1,8 +1,5 @@ package frontend; -import exceptions.FarmioFatalException; -import farmio.Level; - public class UiDummy implements Ui { public static String uiTestString; public static String input; diff --git a/src/main/java/frontend/UiManager.java b/src/main/java/frontend/UiManager.java index 859d37fece..a23aeaf362 100644 --- a/src/main/java/frontend/UiManager.java +++ b/src/main/java/frontend/UiManager.java @@ -1,8 +1,5 @@ package frontend; -import exceptions.FarmioFatalException; -import farmio.Level; - import java.util.Scanner; public class UiManager implements Ui { diff --git a/src/main/java/farmio/Farmer.java b/src/main/java/gameassets/Farmer.java similarity index 97% rename from src/main/java/farmio/Farmer.java rename to src/main/java/gameassets/Farmer.java index 6c9c6ee305..6d963047dc 100644 --- a/src/main/java/farmio/Farmer.java +++ b/src/main/java/gameassets/Farmer.java @@ -1,12 +1,13 @@ -package farmio; +package gameassets; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import farmio.Farmio; import frontend.GameConsole; -import places.ChickenFarm; -import places.CowFarm; -import places.WheatFarm; -import usercode.tasks.TaskList; +import gameassets.places.ChickenFarm; +import gameassets.places.CowFarm; +import gameassets.places.WheatFarm; +import logic.usercode.tasks.TaskList; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import java.util.ArrayList; diff --git a/src/main/java/farmio/Level.java b/src/main/java/gameassets/Level.java similarity index 99% rename from src/main/java/farmio/Level.java rename to src/main/java/gameassets/Level.java index 2c1c2bec8e..ccd86b3cd0 100644 --- a/src/main/java/farmio/Level.java +++ b/src/main/java/gameassets/Level.java @@ -1,5 +1,7 @@ -package farmio; +package gameassets; +import farmio.Farmio; +import gameassets.Farmer; import org.json.simple.JSONArray; import org.json.simple.JSONObject; diff --git a/src/main/java/places/ChickenFarm.java b/src/main/java/gameassets/places/ChickenFarm.java similarity index 94% rename from src/main/java/places/ChickenFarm.java rename to src/main/java/gameassets/places/ChickenFarm.java index 7eba165c3a..0b5bbf53d1 100644 --- a/src/main/java/places/ChickenFarm.java +++ b/src/main/java/gameassets/places/ChickenFarm.java @@ -1,6 +1,6 @@ -package places; +package gameassets.places; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.json.simple.JSONObject; public class ChickenFarm extends Farm { diff --git a/src/main/java/places/CowFarm.java b/src/main/java/gameassets/places/CowFarm.java similarity index 94% rename from src/main/java/places/CowFarm.java rename to src/main/java/gameassets/places/CowFarm.java index 581aaa3ea1..789be0d14c 100644 --- a/src/main/java/places/CowFarm.java +++ b/src/main/java/gameassets/places/CowFarm.java @@ -1,6 +1,6 @@ -package places; +package gameassets.places; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.json.simple.JSONObject; public class CowFarm extends Farm { diff --git a/src/main/java/places/Farm.java b/src/main/java/gameassets/places/Farm.java similarity index 81% rename from src/main/java/places/Farm.java rename to src/main/java/gameassets/places/Farm.java index f3e3dd1b9d..94bc466727 100644 --- a/src/main/java/places/Farm.java +++ b/src/main/java/gameassets/places/Farm.java @@ -1,4 +1,4 @@ -package places; +package gameassets.places; import org.json.simple.JSONObject; diff --git a/src/main/java/places/Market.java b/src/main/java/gameassets/places/Market.java similarity index 89% rename from src/main/java/places/Market.java rename to src/main/java/gameassets/places/Market.java index e1ee974097..55cc1d6554 100644 --- a/src/main/java/places/Market.java +++ b/src/main/java/gameassets/places/Market.java @@ -1,4 +1,4 @@ -package places; +package gameassets.places; public class Market { public static final int PRICE_OF_SEED = 10; diff --git a/src/main/java/places/WheatFarm.java b/src/main/java/gameassets/places/WheatFarm.java similarity index 94% rename from src/main/java/places/WheatFarm.java rename to src/main/java/gameassets/places/WheatFarm.java index aae78c01b7..907f978c7d 100644 --- a/src/main/java/places/WheatFarm.java +++ b/src/main/java/gameassets/places/WheatFarm.java @@ -1,6 +1,6 @@ -package places; +package gameassets.places; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.json.simple.JSONObject; public class WheatFarm extends Farm { diff --git a/src/main/java/farmio/Logic.java b/src/main/java/logic/Logic.java similarity index 76% rename from src/main/java/farmio/Logic.java rename to src/main/java/logic/Logic.java index 3a5b7b6acf..15b9bd7071 100644 --- a/src/main/java/farmio/Logic.java +++ b/src/main/java/logic/Logic.java @@ -1,10 +1,8 @@ -package farmio; +package logic; -import frontend.Simulation; -import frontend.Ui; -import frontend.UiManager; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.Farmio; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; public class Logic { diff --git a/src/main/java/farmio/Parser.java b/src/main/java/logic/Parser.java similarity index 87% rename from src/main/java/farmio/Parser.java rename to src/main/java/logic/Parser.java index 7393b5242c..1a41b83f2d 100644 --- a/src/main/java/farmio/Parser.java +++ b/src/main/java/logic/Parser.java @@ -1,38 +1,39 @@ -package farmio; +package logic; -import commands.Command; +import logic.commands.Command; -import commands.CommandAddName; -import commands.CommandCheckObjectives; -import commands.CommandDayEnd; -import commands.CommandDayStart; -import commands.CommandGameLoad; -import commands.CommandGameNew; -import commands.CommandGameQuit; -import commands.CommandGameSave; -import commands.CommandLevelEnd; -import commands.CommandLevelReset; -import commands.CommandLevelStart; -import commands.CommandMenuInGame; -import commands.CommandMenuStart; -import commands.CommandShowList; -import commands.CommandTaskAddReset; -import commands.CommandTaskCreate; -import commands.CommandTaskDelete; -import commands.CommandTaskDeleteAll; -import commands.CommandTaskEdit; -import commands.CommandTaskInsert; -import commands.CommandTaskHint; -import commands.CommandTaskRun; -import usercode.tasks.Task; -import usercode.tasks.IfTask; -import usercode.tasks.ForTask; -import usercode.tasks.DoTask; -import usercode.tasks.WhileTask; -import exceptions.FarmioException; -import usercode.actions.Action; -import usercode.conditions.Condition; +import logic.commands.CommandAddName; +import logic.commands.CommandCheckObjectives; +import logic.commands.CommandDayEnd; +import logic.commands.CommandDayStart; +import logic.commands.CommandGameLoad; +import logic.commands.CommandGameNew; +import logic.commands.CommandGameQuit; +import logic.commands.CommandGameSave; +import logic.commands.CommandLevelEnd; +import logic.commands.CommandLevelReset; +import logic.commands.CommandLevelStart; +import logic.commands.CommandMenuInGame; +import logic.commands.CommandMenuStart; +import logic.commands.CommandShowList; +import logic.commands.CommandTaskAddReset; +import logic.commands.CommandTaskCreate; +import logic.commands.CommandTaskDelete; +import logic.commands.CommandTaskDeleteAll; +import logic.commands.CommandTaskEdit; +import logic.commands.CommandTaskInsert; +import logic.commands.CommandTaskHint; +import logic.commands.CommandTaskRun; +import farmio.Farmio; +import logic.usercode.tasks.Task; +import logic.usercode.tasks.IfTask; +import logic.usercode.tasks.ForTask; +import logic.usercode.tasks.DoTask; +import logic.usercode.tasks.WhileTask; +import farmio.exceptions.FarmioException; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; import java.util.logging.Level; import java.util.logging.Logger; @@ -152,7 +153,7 @@ private static Command parseTaskAdd(String userInput) throws FarmioException { if (userInput.equals("market")) { return new CommandShowList("MarketList"); } - if (userInput.equals("task commands") || userInput.equals("task command")) { + if (userInput.equals("task logic.commands") || userInput.equals("task command")) { return new CommandShowList("TaskCommands"); } if (userInput.startsWith("do") || userInput.startsWith("if") @@ -279,8 +280,8 @@ private static Task parseConditionalTask(String userInput) throws FarmioExceptio } /** - * Parses commands meant to edit any Task in the TaskList. - * Edit commands must be of the form 'edit [TaskID] [taskType] [Condition] do [Action]. + * Parses logic.commands meant to edit any Task in the TaskList. + * Edit logic.commands must be of the form 'edit [TaskID] [taskType] [Condition] do [Action]. * * @param userInput user input String * @return Command that will edit the Task in the TaskList with the specified ID when executed @@ -298,7 +299,7 @@ private static Command editTask(String userInput) throws FarmioException { } /** - * Parses commands meant to insert a Task at a specific position in the TaskList. + * Parses logic.commands meant to insert a Task at a specific position in the TaskList. * * @param userInput user input String * @return Command that inserts a Task at the specified position diff --git a/src/main/java/commands/Command.java b/src/main/java/logic/commands/Command.java similarity index 55% rename from src/main/java/commands/Command.java rename to src/main/java/logic/commands/Command.java index f78e335806..bc10913788 100644 --- a/src/main/java/commands/Command.java +++ b/src/main/java/logic/commands/Command.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; public abstract class Command { public abstract void execute(Farmio farmio) throws FarmioException, FarmioFatalException; diff --git a/src/main/java/commands/CommandAddName.java b/src/main/java/logic/commands/CommandAddName.java similarity index 93% rename from src/main/java/commands/CommandAddName.java rename to src/main/java/logic/commands/CommandAddName.java index 7b1a85c7b8..a2c1b82899 100644 --- a/src/main/java/commands/CommandAddName.java +++ b/src/main/java/logic/commands/CommandAddName.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import frontend.Ui; diff --git a/src/main/java/commands/CommandChangeTask.java b/src/main/java/logic/commands/CommandChangeTask.java similarity index 78% rename from src/main/java/commands/CommandChangeTask.java rename to src/main/java/logic/commands/CommandChangeTask.java index 46b4dfea7e..fe9c6d9718 100644 --- a/src/main/java/commands/CommandChangeTask.java +++ b/src/main/java/logic/commands/CommandChangeTask.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Storage; +import storage.Storage; public abstract class CommandChangeTask extends Command { diff --git a/src/main/java/commands/CommandCheckObjectives.java b/src/main/java/logic/commands/CommandCheckObjectives.java similarity index 92% rename from src/main/java/commands/CommandCheckObjectives.java rename to src/main/java/logic/commands/CommandCheckObjectives.java index f8e45c58da..1b96302ee9 100644 --- a/src/main/java/commands/CommandCheckObjectives.java +++ b/src/main/java/logic/commands/CommandCheckObjectives.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; +import gameassets.Level; import java.util.List; public class CommandCheckObjectives extends Command { diff --git a/src/main/java/commands/CommandDayEnd.java b/src/main/java/logic/commands/CommandDayEnd.java similarity index 89% rename from src/main/java/commands/CommandDayEnd.java rename to src/main/java/logic/commands/CommandDayEnd.java index dd8a1544f3..88fd90206e 100644 --- a/src/main/java/commands/CommandDayEnd.java +++ b/src/main/java/logic/commands/CommandDayEnd.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Farmer; +import gameassets.Farmer; import frontend.AsciiColours; public class CommandDayEnd extends Command { diff --git a/src/main/java/commands/CommandDayStart.java b/src/main/java/logic/commands/CommandDayStart.java similarity index 90% rename from src/main/java/commands/CommandDayStart.java rename to src/main/java/logic/commands/CommandDayStart.java index 63f7f338c2..2fccde636e 100644 --- a/src/main/java/commands/CommandDayStart.java +++ b/src/main/java/logic/commands/CommandDayStart.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; import frontend.AsciiColours; import frontend.Ui; diff --git a/src/main/java/commands/CommandGameLoad.java b/src/main/java/logic/commands/CommandGameLoad.java similarity index 90% rename from src/main/java/commands/CommandGameLoad.java rename to src/main/java/logic/commands/CommandGameLoad.java index 4f562f5e14..7b9648554e 100644 --- a/src/main/java/commands/CommandGameLoad.java +++ b/src/main/java/logic/commands/CommandGameLoad.java @@ -1,12 +1,12 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; -import farmio.Farmer; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; import farmio.Farmio; -import farmio.Storage; -import farmio.Level; +import storage.Storage; +import gameassets.Level; import frontend.Ui; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; public class CommandGameLoad extends Command { /** diff --git a/src/main/java/commands/CommandGameNew.java b/src/main/java/logic/commands/CommandGameNew.java similarity index 86% rename from src/main/java/commands/CommandGameNew.java rename to src/main/java/logic/commands/CommandGameNew.java index c76eb1766d..503b1a9e69 100644 --- a/src/main/java/commands/CommandGameNew.java +++ b/src/main/java/logic/commands/CommandGameNew.java @@ -1,7 +1,7 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; -import farmio.Farmer; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; import farmio.Farmio; import frontend.Ui; diff --git a/src/main/java/commands/CommandGameQuit.java b/src/main/java/logic/commands/CommandGameQuit.java similarity index 85% rename from src/main/java/commands/CommandGameQuit.java rename to src/main/java/logic/commands/CommandGameQuit.java index a400f34230..c14393a887 100644 --- a/src/main/java/commands/CommandGameQuit.java +++ b/src/main/java/logic/commands/CommandGameQuit.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; public class CommandGameQuit extends Command { diff --git a/src/main/java/commands/CommandGameSave.java b/src/main/java/logic/commands/CommandGameSave.java similarity index 91% rename from src/main/java/commands/CommandGameSave.java rename to src/main/java/logic/commands/CommandGameSave.java index 537f2e8384..2f89cbbba0 100644 --- a/src/main/java/commands/CommandGameSave.java +++ b/src/main/java/logic/commands/CommandGameSave.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; import frontend.Ui; diff --git a/src/main/java/commands/CommandLevelEnd.java b/src/main/java/logic/commands/CommandLevelEnd.java similarity index 89% rename from src/main/java/commands/CommandLevelEnd.java rename to src/main/java/logic/commands/CommandLevelEnd.java index 74027af8e5..b6a04a5836 100644 --- a/src/main/java/commands/CommandLevelEnd.java +++ b/src/main/java/logic/commands/CommandLevelEnd.java @@ -1,10 +1,10 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; -import farmio.Farmer; -import farmio.Storage; +import gameassets.Level; +import gameassets.Farmer; +import storage.Storage; import frontend.AsciiColours; public class CommandLevelEnd extends Command { diff --git a/src/main/java/commands/CommandLevelReset.java b/src/main/java/logic/commands/CommandLevelReset.java similarity index 87% rename from src/main/java/commands/CommandLevelReset.java rename to src/main/java/logic/commands/CommandLevelReset.java index 3d98725e3b..32b076310b 100644 --- a/src/main/java/commands/CommandLevelReset.java +++ b/src/main/java/logic/commands/CommandLevelReset.java @@ -1,10 +1,10 @@ -package commands; +package logic.commands; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Farmer; -import farmio.Storage; +import gameassets.Farmer; +import storage.Storage; import frontend.Ui; public class CommandLevelReset extends Command { diff --git a/src/main/java/commands/CommandLevelStart.java b/src/main/java/logic/commands/CommandLevelStart.java similarity index 82% rename from src/main/java/commands/CommandLevelStart.java rename to src/main/java/logic/commands/CommandLevelStart.java index 8fa9a8f14b..ce34c7459c 100644 --- a/src/main/java/commands/CommandLevelStart.java +++ b/src/main/java/logic/commands/CommandLevelStart.java @@ -1,11 +1,10 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import frontend.Ui; -import farmio.Storage; -import farmio.Farmer; -import farmio.Level; +import storage.Storage; +import gameassets.Farmer; +import gameassets.Level; public class CommandLevelStart extends Command { /** diff --git a/src/main/java/commands/CommandMenuInGame.java b/src/main/java/logic/commands/CommandMenuInGame.java similarity index 82% rename from src/main/java/commands/CommandMenuInGame.java rename to src/main/java/logic/commands/CommandMenuInGame.java index 458beb38da..96f719538c 100644 --- a/src/main/java/commands/CommandMenuInGame.java +++ b/src/main/java/logic/commands/CommandMenuInGame.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Menu; +import frontend.Menu; public class CommandMenuInGame extends Command { diff --git a/src/main/java/commands/CommandMenuStart.java b/src/main/java/logic/commands/CommandMenuStart.java similarity index 83% rename from src/main/java/commands/CommandMenuStart.java rename to src/main/java/logic/commands/CommandMenuStart.java index 4b16b1f006..e3d8bc510a 100644 --- a/src/main/java/commands/CommandMenuStart.java +++ b/src/main/java/logic/commands/CommandMenuStart.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Menu; +import frontend.Menu; public class CommandMenuStart extends Command { diff --git a/src/main/java/commands/CommandShowList.java b/src/main/java/logic/commands/CommandShowList.java similarity index 91% rename from src/main/java/commands/CommandShowList.java rename to src/main/java/logic/commands/CommandShowList.java index 3c20273e2d..3203e71ff9 100644 --- a/src/main/java/commands/CommandShowList.java +++ b/src/main/java/logic/commands/CommandShowList.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; import frontend.Ui; diff --git a/src/main/java/commands/CommandTaskAddReset.java b/src/main/java/logic/commands/CommandTaskAddReset.java similarity index 85% rename from src/main/java/commands/CommandTaskAddReset.java rename to src/main/java/logic/commands/CommandTaskAddReset.java index fbd7c9058c..aeba006cc3 100644 --- a/src/main/java/commands/CommandTaskAddReset.java +++ b/src/main/java/logic/commands/CommandTaskAddReset.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; +import gameassets.Level; import frontend.Ui; public class CommandTaskAddReset extends Command { diff --git a/src/main/java/commands/CommandTaskCreate.java b/src/main/java/logic/commands/CommandTaskCreate.java similarity index 84% rename from src/main/java/commands/CommandTaskCreate.java rename to src/main/java/logic/commands/CommandTaskCreate.java index 46f11ffb3b..1f18284ae3 100644 --- a/src/main/java/commands/CommandTaskCreate.java +++ b/src/main/java/logic/commands/CommandTaskCreate.java @@ -1,11 +1,11 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Farmer; -import exceptions.FarmioException; +import gameassets.Farmer; +import farmio.exceptions.FarmioException; import frontend.Ui; -import usercode.tasks.Task; +import logic.usercode.tasks.Task; public class CommandTaskCreate extends CommandChangeTask { private Task task; diff --git a/src/main/java/commands/CommandTaskDelete.java b/src/main/java/logic/commands/CommandTaskDelete.java similarity index 90% rename from src/main/java/commands/CommandTaskDelete.java rename to src/main/java/logic/commands/CommandTaskDelete.java index 68c5475a02..00ab9fbdb8 100644 --- a/src/main/java/commands/CommandTaskDelete.java +++ b/src/main/java/logic/commands/CommandTaskDelete.java @@ -1,7 +1,7 @@ -package commands; +package logic.commands; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; public class CommandTaskDelete extends CommandChangeTask { diff --git a/src/main/java/commands/CommandTaskDeleteAll.java b/src/main/java/logic/commands/CommandTaskDeleteAll.java similarity index 88% rename from src/main/java/commands/CommandTaskDeleteAll.java rename to src/main/java/logic/commands/CommandTaskDeleteAll.java index be5e644b8b..f8313bb430 100644 --- a/src/main/java/commands/CommandTaskDeleteAll.java +++ b/src/main/java/logic/commands/CommandTaskDeleteAll.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; public class CommandTaskDeleteAll extends CommandChangeTask { diff --git a/src/main/java/commands/CommandTaskEdit.java b/src/main/java/logic/commands/CommandTaskEdit.java similarity index 84% rename from src/main/java/commands/CommandTaskEdit.java rename to src/main/java/logic/commands/CommandTaskEdit.java index c766511fd0..578d1ca723 100644 --- a/src/main/java/commands/CommandTaskEdit.java +++ b/src/main/java/logic/commands/CommandTaskEdit.java @@ -1,11 +1,11 @@ -package commands; +package logic.commands; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; import frontend.Ui; -import usercode.tasks.Task; -import farmio.Farmer; +import logic.usercode.tasks.Task; +import gameassets.Farmer; public class CommandTaskEdit extends CommandChangeTask { private Task task; diff --git a/src/main/java/commands/CommandTaskHint.java b/src/main/java/logic/commands/CommandTaskHint.java similarity index 83% rename from src/main/java/commands/CommandTaskHint.java rename to src/main/java/logic/commands/CommandTaskHint.java index d1b58f35f1..2f9dc9a58e 100644 --- a/src/main/java/commands/CommandTaskHint.java +++ b/src/main/java/logic/commands/CommandTaskHint.java @@ -1,8 +1,8 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; +import gameassets.Level; import frontend.Ui; public class CommandTaskHint extends Command { diff --git a/src/main/java/commands/CommandTaskInsert.java b/src/main/java/logic/commands/CommandTaskInsert.java similarity index 85% rename from src/main/java/commands/CommandTaskInsert.java rename to src/main/java/logic/commands/CommandTaskInsert.java index 093ca9c88c..fd6a86d4cb 100644 --- a/src/main/java/commands/CommandTaskInsert.java +++ b/src/main/java/logic/commands/CommandTaskInsert.java @@ -1,9 +1,9 @@ -package commands; +package logic.commands; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import usercode.tasks.Task; +import logic.usercode.tasks.Task; public class CommandTaskInsert extends CommandChangeTask { private Task task; diff --git a/src/main/java/commands/CommandTaskRun.java b/src/main/java/logic/commands/CommandTaskRun.java similarity index 88% rename from src/main/java/commands/CommandTaskRun.java rename to src/main/java/logic/commands/CommandTaskRun.java index 94db0799d5..ba79596d30 100644 --- a/src/main/java/commands/CommandTaskRun.java +++ b/src/main/java/logic/commands/CommandTaskRun.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; public class CommandTaskRun extends Command { diff --git a/src/main/java/commands/CommandWelcome.java b/src/main/java/logic/commands/CommandWelcome.java similarity index 87% rename from src/main/java/commands/CommandWelcome.java rename to src/main/java/logic/commands/CommandWelcome.java index a9c3cef695..160b4ba06f 100644 --- a/src/main/java/commands/CommandWelcome.java +++ b/src/main/java/logic/commands/CommandWelcome.java @@ -1,6 +1,6 @@ -package commands; +package logic.commands; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; import frontend.Ui; diff --git a/src/main/java/usercode/actions/Action.java b/src/main/java/logic/usercode/actions/Action.java similarity index 95% rename from src/main/java/usercode/actions/Action.java rename to src/main/java/logic/usercode/actions/Action.java index 426c51e442..2e7d853ea1 100644 --- a/src/main/java/usercode/actions/Action.java +++ b/src/main/java/logic/usercode/actions/Action.java @@ -1,11 +1,11 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioFatalException; -import farmio.Storage; -import exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import storage.Storage; +import farmio.exceptions.FarmioException; import frontend.Simulation; import frontend.Ui; -import farmio.Farmer; +import gameassets.Farmer; import javafx.util.Pair; import java.util.ArrayList; diff --git a/src/main/java/usercode/actions/ActionType.java b/src/main/java/logic/usercode/actions/ActionType.java similarity index 79% rename from src/main/java/usercode/actions/ActionType.java rename to src/main/java/logic/usercode/actions/ActionType.java index fcdc3343cd..775489dd09 100644 --- a/src/main/java/usercode/actions/ActionType.java +++ b/src/main/java/logic/usercode/actions/ActionType.java @@ -1,4 +1,4 @@ -package usercode.actions; +package logic.usercode.actions; public enum ActionType { buySeeds, diff --git a/src/main/java/usercode/actions/BuySeedsAction.java b/src/main/java/logic/usercode/actions/BuySeedsAction.java similarity index 84% rename from src/main/java/usercode/actions/BuySeedsAction.java rename to src/main/java/logic/usercode/actions/BuySeedsAction.java index fc67a319c0..3e3134e594 100644 --- a/src/main/java/usercode/actions/BuySeedsAction.java +++ b/src/main/java/logic/usercode/actions/BuySeedsAction.java @@ -1,12 +1,12 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; -import exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; +import farmio.exceptions.FarmioException; import frontend.Simulation; import frontend.Ui; -import places.Market; +import gameassets.places.Market; import javafx.util.Pair; import java.util.ArrayList; diff --git a/src/main/java/usercode/actions/GotoFarmAction.java b/src/main/java/logic/usercode/actions/GotoFarmAction.java similarity index 92% rename from src/main/java/usercode/actions/GotoFarmAction.java rename to src/main/java/logic/usercode/actions/GotoFarmAction.java index 4c30185083..18f7d6cc28 100644 --- a/src/main/java/usercode/actions/GotoFarmAction.java +++ b/src/main/java/logic/usercode/actions/GotoFarmAction.java @@ -1,8 +1,8 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; import frontend.Simulation; import frontend.Ui; diff --git a/src/main/java/usercode/actions/GotoMarketAction.java b/src/main/java/logic/usercode/actions/GotoMarketAction.java similarity index 86% rename from src/main/java/usercode/actions/GotoMarketAction.java rename to src/main/java/logic/usercode/actions/GotoMarketAction.java index c649940d8b..723435747c 100644 --- a/src/main/java/usercode/actions/GotoMarketAction.java +++ b/src/main/java/logic/usercode/actions/GotoMarketAction.java @@ -1,8 +1,8 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; import frontend.Simulation; import frontend.Ui; diff --git a/src/main/java/usercode/actions/HarvestWheatAction.java b/src/main/java/logic/usercode/actions/HarvestWheatAction.java similarity index 86% rename from src/main/java/usercode/actions/HarvestWheatAction.java rename to src/main/java/logic/usercode/actions/HarvestWheatAction.java index 5bb8b45537..11af327f94 100644 --- a/src/main/java/usercode/actions/HarvestWheatAction.java +++ b/src/main/java/logic/usercode/actions/HarvestWheatAction.java @@ -1,9 +1,9 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; import frontend.Simulation; import frontend.Ui; import javafx.util.Pair; diff --git a/src/main/java/usercode/actions/PlantSeedsAction.java b/src/main/java/logic/usercode/actions/PlantSeedsAction.java similarity index 86% rename from src/main/java/usercode/actions/PlantSeedsAction.java rename to src/main/java/logic/usercode/actions/PlantSeedsAction.java index 53ce09be55..6771850ab9 100644 --- a/src/main/java/usercode/actions/PlantSeedsAction.java +++ b/src/main/java/logic/usercode/actions/PlantSeedsAction.java @@ -1,9 +1,9 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; import frontend.Simulation; import frontend.Ui; import javafx.util.Pair; diff --git a/src/main/java/usercode/actions/SellGrainAction.java b/src/main/java/logic/usercode/actions/SellGrainAction.java similarity index 86% rename from src/main/java/usercode/actions/SellGrainAction.java rename to src/main/java/logic/usercode/actions/SellGrainAction.java index 511d5aa194..46c5819538 100644 --- a/src/main/java/usercode/actions/SellGrainAction.java +++ b/src/main/java/logic/usercode/actions/SellGrainAction.java @@ -1,9 +1,9 @@ -package usercode.actions; +package logic.usercode.actions; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; -import farmio.Farmer; -import farmio.Storage; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; +import storage.Storage; import frontend.Simulation; import frontend.Ui; import javafx.util.Pair; diff --git a/src/main/java/usercode/conditions/BooleanCondition.java b/src/main/java/logic/usercode/conditions/BooleanCondition.java similarity index 95% rename from src/main/java/usercode/conditions/BooleanCondition.java rename to src/main/java/logic/usercode/conditions/BooleanCondition.java index 4bc03dcf73..af9ba65426 100644 --- a/src/main/java/usercode/conditions/BooleanCondition.java +++ b/src/main/java/logic/usercode/conditions/BooleanCondition.java @@ -1,4 +1,4 @@ -package usercode.conditions; +package logic.usercode.conditions; import farmio.Farmio; import org.json.simple.JSONObject; diff --git a/src/main/java/usercode/conditions/BooleanConditionType.java b/src/main/java/logic/usercode/conditions/BooleanConditionType.java similarity index 78% rename from src/main/java/usercode/conditions/BooleanConditionType.java rename to src/main/java/logic/usercode/conditions/BooleanConditionType.java index 3d07d96102..820e3480bd 100644 --- a/src/main/java/usercode/conditions/BooleanConditionType.java +++ b/src/main/java/logic/usercode/conditions/BooleanConditionType.java @@ -1,4 +1,4 @@ -package usercode.conditions; +package logic.usercode.conditions; public enum BooleanConditionType { hasSeeds, diff --git a/src/main/java/usercode/conditions/Comparator.java b/src/main/java/logic/usercode/conditions/Comparator.java similarity index 75% rename from src/main/java/usercode/conditions/Comparator.java rename to src/main/java/logic/usercode/conditions/Comparator.java index 29e9581af2..ebe4aa8469 100644 --- a/src/main/java/usercode/conditions/Comparator.java +++ b/src/main/java/logic/usercode/conditions/Comparator.java @@ -1,4 +1,4 @@ -package usercode.conditions; +package logic.usercode.conditions; public enum Comparator { lessThan, diff --git a/src/main/java/usercode/conditions/Condition.java b/src/main/java/logic/usercode/conditions/Condition.java similarity index 98% rename from src/main/java/usercode/conditions/Condition.java rename to src/main/java/logic/usercode/conditions/Condition.java index 1dd86ed625..02db40f17c 100644 --- a/src/main/java/usercode/conditions/Condition.java +++ b/src/main/java/logic/usercode/conditions/Condition.java @@ -1,7 +1,7 @@ -package usercode.conditions; +package logic.usercode.conditions; import farmio.Farmio; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.json.simple.JSONObject; public abstract class Condition { diff --git a/src/main/java/usercode/conditions/ConditionChecker.java b/src/main/java/logic/usercode/conditions/ConditionChecker.java similarity index 93% rename from src/main/java/usercode/conditions/ConditionChecker.java rename to src/main/java/logic/usercode/conditions/ConditionChecker.java index 8f946443c4..0dfb68403a 100644 --- a/src/main/java/usercode/conditions/ConditionChecker.java +++ b/src/main/java/logic/usercode/conditions/ConditionChecker.java @@ -1,7 +1,7 @@ -package usercode.conditions; +package logic.usercode.conditions; import farmio.Farmio; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; public class ConditionChecker { diff --git a/src/main/java/usercode/conditions/ValueCondition.java b/src/main/java/logic/usercode/conditions/ValueCondition.java similarity index 95% rename from src/main/java/usercode/conditions/ValueCondition.java rename to src/main/java/logic/usercode/conditions/ValueCondition.java index 60fa473585..1fd7959d53 100644 --- a/src/main/java/usercode/conditions/ValueCondition.java +++ b/src/main/java/logic/usercode/conditions/ValueCondition.java @@ -1,7 +1,7 @@ -package usercode.conditions; +package logic.usercode.conditions; import farmio.Farmio; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.json.simple.JSONObject; public class ValueCondition extends Condition { diff --git a/src/main/java/usercode/conditions/ValueConditionType.java b/src/main/java/logic/usercode/conditions/ValueConditionType.java similarity index 56% rename from src/main/java/usercode/conditions/ValueConditionType.java rename to src/main/java/logic/usercode/conditions/ValueConditionType.java index 289d457e0f..293a37a67e 100644 --- a/src/main/java/usercode/conditions/ValueConditionType.java +++ b/src/main/java/logic/usercode/conditions/ValueConditionType.java @@ -1,4 +1,4 @@ -package usercode.conditions; +package logic.usercode.conditions; public enum ValueConditionType { gold, diff --git a/src/main/java/usercode/tasks/DoTask.java b/src/main/java/logic/usercode/tasks/DoTask.java similarity index 73% rename from src/main/java/usercode/tasks/DoTask.java rename to src/main/java/logic/usercode/tasks/DoTask.java index 336fafb3b1..dea4e3959b 100644 --- a/src/main/java/usercode/tasks/DoTask.java +++ b/src/main/java/logic/usercode/tasks/DoTask.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import usercode.actions.Action; -import usercode.conditions.Condition; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; public class DoTask extends Task { diff --git a/src/main/java/usercode/tasks/ForTask.java b/src/main/java/logic/usercode/tasks/ForTask.java similarity index 76% rename from src/main/java/usercode/tasks/ForTask.java rename to src/main/java/logic/usercode/tasks/ForTask.java index 5ac7908bfc..d213368206 100644 --- a/src/main/java/usercode/tasks/ForTask.java +++ b/src/main/java/logic/usercode/tasks/ForTask.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import usercode.actions.Action; -import usercode.conditions.Condition; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; public class ForTask extends Task { diff --git a/src/main/java/usercode/tasks/IfElseTask.java b/src/main/java/logic/usercode/tasks/IfElseTask.java similarity index 85% rename from src/main/java/usercode/tasks/IfElseTask.java rename to src/main/java/logic/usercode/tasks/IfElseTask.java index 19e08c5846..08903c3046 100644 --- a/src/main/java/usercode/tasks/IfElseTask.java +++ b/src/main/java/logic/usercode/tasks/IfElseTask.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import exceptions.FarmioException; -import usercode.actions.Action; -import usercode.conditions.Condition; +import farmio.exceptions.FarmioException; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; import org.json.simple.JSONObject; public class IfElseTask extends Task { diff --git a/src/main/java/usercode/tasks/IfTask.java b/src/main/java/logic/usercode/tasks/IfTask.java similarity index 79% rename from src/main/java/usercode/tasks/IfTask.java rename to src/main/java/logic/usercode/tasks/IfTask.java index af5607d4d5..9c413f2895 100644 --- a/src/main/java/usercode/tasks/IfTask.java +++ b/src/main/java/logic/usercode/tasks/IfTask.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import exceptions.FarmioException; -import usercode.actions.Action; -import usercode.conditions.Condition; +import farmio.exceptions.FarmioException; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; public class IfTask extends Task { diff --git a/src/main/java/usercode/tasks/Task.java b/src/main/java/logic/usercode/tasks/Task.java similarity index 93% rename from src/main/java/usercode/tasks/Task.java rename to src/main/java/logic/usercode/tasks/Task.java index f99730fb6d..cefdfa7433 100644 --- a/src/main/java/usercode/tasks/Task.java +++ b/src/main/java/logic/usercode/tasks/Task.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import usercode.actions.Action; -import exceptions.FarmioException; -import usercode.conditions.Condition; +import logic.usercode.actions.Action; +import farmio.exceptions.FarmioException; +import logic.usercode.conditions.Condition; import org.json.simple.JSONObject; public abstract class Task { diff --git a/src/main/java/usercode/tasks/TaskList.java b/src/main/java/logic/usercode/tasks/TaskList.java similarity index 98% rename from src/main/java/usercode/tasks/TaskList.java rename to src/main/java/logic/usercode/tasks/TaskList.java index 2d28a065ac..08f6070e30 100644 --- a/src/main/java/usercode/tasks/TaskList.java +++ b/src/main/java/logic/usercode/tasks/TaskList.java @@ -1,6 +1,6 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import frontend.GameConsole; import org.json.simple.JSONArray; import org.json.simple.JSONObject; diff --git a/src/main/java/usercode/tasks/WhileTask.java b/src/main/java/logic/usercode/tasks/WhileTask.java similarity index 73% rename from src/main/java/usercode/tasks/WhileTask.java rename to src/main/java/logic/usercode/tasks/WhileTask.java index 2dcf6ed118..25e2bb6de6 100644 --- a/src/main/java/usercode/tasks/WhileTask.java +++ b/src/main/java/logic/usercode/tasks/WhileTask.java @@ -1,10 +1,10 @@ -package usercode.tasks; +package logic.usercode.tasks; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import exceptions.FarmioException; -import usercode.actions.Action; -import usercode.conditions.Condition; +import farmio.exceptions.FarmioException; +import logic.usercode.actions.Action; +import logic.usercode.conditions.Condition; public class WhileTask extends Task { diff --git a/src/main/java/farmio/Storage.java b/src/main/java/storage/Storage.java similarity index 92% rename from src/main/java/farmio/Storage.java rename to src/main/java/storage/Storage.java index 3c6296ccfe..af3458d4d6 100644 --- a/src/main/java/farmio/Storage.java +++ b/src/main/java/storage/Storage.java @@ -1,7 +1,8 @@ -package farmio; +package storage; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; import org.json.simple.JSONObject; import java.util.ArrayList; diff --git a/src/main/java/farmio/StorageDummy.java b/src/main/java/storage/StorageDummy.java similarity index 87% rename from src/main/java/farmio/StorageDummy.java rename to src/main/java/storage/StorageDummy.java index 26f74a56f0..6a9c1e6a04 100644 --- a/src/main/java/farmio/StorageDummy.java +++ b/src/main/java/storage/StorageDummy.java @@ -1,7 +1,8 @@ -package farmio; +package storage; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; +import gameassets.Farmer; import org.json.simple.JSONObject; import java.util.ArrayList; diff --git a/src/main/java/farmio/StorageManager.java b/src/main/java/storage/StorageManager.java similarity index 97% rename from src/main/java/farmio/StorageManager.java rename to src/main/java/storage/StorageManager.java index e4ddd0f149..83d5938519 100644 --- a/src/main/java/farmio/StorageManager.java +++ b/src/main/java/storage/StorageManager.java @@ -1,8 +1,9 @@ -package farmio; +package storage; -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import frontend.AsciiColours; +import gameassets.Farmer; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; diff --git a/src/main/resources/asciiArt/Menu/frame2.txt b/src/main/resources/asciiArt/Menu/frame2.txt index 39adeb28bb..118293c117 100644 --- a/src/main/resources/asciiArt/Menu/frame2.txt +++ b/src/main/resources/asciiArt/Menu/frame2.txt @@ -9,7 +9,7 @@ [Market] - show the the market rates of items [Hint] - show hints on the current level - [Task Commands] - show full list of task commands + [Task Commands] - show full list of task logic.commands _[_]_ \|/ (") \|/ diff --git a/src/test/java/ActionTest.java b/src/test/java/ActionTest.java index 016edcd751..43cc5c6801 100644 --- a/src/test/java/ActionTest.java +++ b/src/test/java/ActionTest.java @@ -1,10 +1,10 @@ -import exceptions.FarmioException; -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; +import gameassets.Level; import frontend.UiDummy; import org.junit.jupiter.api.Test; -import usercode.actions.*; +import logic.usercode.actions.*; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/test/java/ConditionTest.java b/src/test/java/ConditionTest.java index eb3951be02..620b2bd30a 100644 --- a/src/test/java/ConditionTest.java +++ b/src/test/java/ConditionTest.java @@ -1,8 +1,8 @@ -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.junit.jupiter.api.Test; -import usercode.conditions.BooleanCondition; -import usercode.conditions.BooleanConditionType; -import usercode.conditions.Condition; +import logic.usercode.conditions.BooleanCondition; +import logic.usercode.conditions.BooleanConditionType; +import logic.usercode.conditions.Condition; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/GameConsoleTest.java b/src/test/java/GameConsoleTest.java index 3357686c45..dab3445aab 100644 --- a/src/test/java/GameConsoleTest.java +++ b/src/test/java/GameConsoleTest.java @@ -1,14 +1,9 @@ -import exceptions.FarmioFatalException; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; -import frontend.Simulation; +import gameassets.Level; import frontend.UiDummy; import org.junit.jupiter.api.Test; -import java.io.FileNotFoundException; -import java.io.PrintWriter; -import java.util.Formatter; - public class GameConsoleTest { private Farmio farmio; private final String frame0Test = "[0m.____________________________________________________________________" diff --git a/src/test/java/LevelTest.java b/src/test/java/LevelTest.java index 395108a09f..3084c6e616 100644 --- a/src/test/java/LevelTest.java +++ b/src/test/java/LevelTest.java @@ -1,4 +1,4 @@ -import farmio.Level; +import gameassets.Level; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; diff --git a/src/test/java/ParserTest.java b/src/test/java/ParserTest.java index b4dd754cc2..3eed1a2f6d 100644 --- a/src/test/java/ParserTest.java +++ b/src/test/java/ParserTest.java @@ -1,8 +1,7 @@ -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import farmio.Farmio; -import farmio.Farmio.Stage; import org.junit.jupiter.api.Test; -import farmio.Parser; +import logic.Parser; import static org.junit.jupiter.api.Assertions.assertEquals; public class ParserTest { diff --git a/src/test/java/SimulationTest.java b/src/test/java/SimulationTest.java index 5cee8886c5..b1bb9b7fe9 100644 --- a/src/test/java/SimulationTest.java +++ b/src/test/java/SimulationTest.java @@ -1,13 +1,8 @@ -import exceptions.FarmioException; -import exceptions.FarmioFatalException; -import farmio.Farmer; +import farmio.exceptions.FarmioFatalException; import farmio.Farmio; -import farmio.Level; -import farmio.Storage; -import frontend.Ui; +import gameassets.Level; import frontend.UiDummy; import org.junit.jupiter.api.Test; -import places.Farm; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/src/test/java/TaskListTest.java b/src/test/java/TaskListTest.java index 1ba085908c..44566a67ff 100644 --- a/src/test/java/TaskListTest.java +++ b/src/test/java/TaskListTest.java @@ -1,10 +1,10 @@ -import exceptions.FarmioException; +import farmio.exceptions.FarmioException; import org.junit.jupiter.api.Test; -import usercode.actions.BuySeedsAction; -import usercode.conditions.BooleanCondition; -import usercode.conditions.BooleanConditionType; -import usercode.tasks.DoTask; -import usercode.tasks.TaskList; +import logic.usercode.actions.BuySeedsAction; +import logic.usercode.conditions.BooleanCondition; +import logic.usercode.conditions.BooleanConditionType; +import logic.usercode.tasks.DoTask; +import logic.usercode.tasks.TaskList; import static org.junit.jupiter.api.Assertions.assertEquals;