From 4cc4f953da4ebd81140f4abb26a0a08a8178fd42 Mon Sep 17 00:00:00 2001 From: Hossein <128542056+gholami1234@users.noreply.github.com> Date: Tue, 13 Jun 2023 10:02:58 +0330 Subject: [PATCH 1/3] Update README.md --- README.md | 55 +++---------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index d05545f..b79bccf 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,3 @@ -# Growing In Lightcity Project - -This project is a city-building game that includes various features and systems. The objective is to understand the game logic and design it accordingly. - -## Getting Started - -To get started with the project, you need to fork it - -### Prerequisites - -The project contains an initial structure and some implemented systems. Each team member is responsible for implementing a specific system. - -## User Interface - -The user interface section includes tasks such as user registration, login, and character creation. You should also examine the game loop and implement each system and feature as you encounter them. - -The project structure is highly flexible, allowing for modifications and additions in any direction desired. The game logic remains constant, but you can add or direct branches as needed. - -## City Structure - -The city structure is partially implemented, and certain algorithms, such as property creation upon the municipality's creation, are missing. You should implement these algorithms based on the desired city structure. For example, you can create 20 lands with dimensions of 40x80 using a simple loop to generate the properties. - -Pay attention to the existing algorithms, such as the stock market's capital increase and decrease. Think about how you can create a menu for interacting with this section or how you can display charts and detailed information about investments. Feel free to be creative and make any necessary changes, even to the initial structure, by informing the exercise solver. - -No system is devoid of flexibility. Embrace creativity and progress each topic one by one. - -## Structure Overview - -The following is an overview of the initial structure and implemented classes: - -1. **Game**: The Game class contains information about cities and the overall game structure. -2. **City**: The City class contains a list of characters, a bank system, a municipality, and the root character. -3. **Municipality**: The Municipality class generates properties based on a specific algorithm (you need to devise this algorithm). It also contains a list of properties and property operations such as buying and selling. -4. **Character**: The Character class includes user information, a bank account, a life system, a job (can be null), a list of owned properties, and the character's current position property. -5. **User**: The User class includes the username and password. -6. **Job**: The Job class includes the job title, income, and industry ID. -7. **Employee**: The Employee class is generated when a character joins an industry. It includes the username, base salary, level, bank account, and industry. -8. **Manager**: [No further information provided] -9. **Bank**: The Bank class includes a list of accounts, a manager (root), and the bank's turnover. -10. **BankTurnOver**: The BankTurnOver class includes income and outcome. -11. **BankAccount**: The BankAccount class represents the owner (a character), password, money, and the last change date. -12. **Property**: The Property class includes an array of scales, an array of coordinates, and the owner. -13. **StockMarket**: The StockMarket system works with the character's money and generates a profit or loss per second within the range of -0.03 to +0.03. -14. **Food & Liquid**: Includes water and food options. -15. **Industry**: The Industry class includes the title, income, and a list of employees. - -And other interfaces... - -## Contributing - -Feel free to contribute to the project by suggesting improvements or implementing new features. -`` +Hossein GHolami: DataBase from sql +AmirHossein Ziarati: Impliment industries +Kiarash EbrahimNezhad: CLI menu(Step 2,5) From 8d1784f56ea66b1592b0079a3c0a1716c3d2a178 Mon Sep 17 00:00:00 2001 From: AHZ Date: Sat, 1 Jul 2023 11:31:44 +0330 Subject: [PATCH 2/3] thth --- LightCity-Hossein/.idea/.gitignore | 3 + LightCity-Hossein/.idea/compiler.xml | 13 ++ LightCity-Hossein/.idea/encodings.xml | 7 + LightCity-Hossein/.idea/jarRepositories.xml | 20 ++ LightCity-Hossein/.idea/misc.xml | 12 ++ LightCity-Hossein/README.md | 3 + LightCity-Hossein/pom.xml | 39 ++++ .../src/main/java/org/example/App.java | 13 ++ .../src/main/java/org/example/Database.java | 142 +++++++++++++ .../src/main/java/org/example/Game.java | 49 +++++ .../src/main/java/org/example/Menu.java | 197 ++++++++++++++++++ .../java/org/example/defualtSystem/Bank.java | 44 ++++ .../example/defualtSystem/BankTurnover.java | 20 ++ .../example/defualtSystem/FastFoodShop.java | 17 ++ .../java/org/example/defualtSystem/Life.java | 92 ++++++++ .../example/defualtSystem/Municipality.java | 33 +++ .../example/defualtSystem/StockMarket.java | 63 ++++++ .../java/org/example/enumerations/Gender.java | 5 + .../org/example/interfaces/BankInterface.java | 4 + .../interfaces/CharacterInterface.java | 6 + .../org/example/interfaces/CityInterface.java | 9 + .../org/example/interfaces/GameInterface.java | 15 ++ .../interfaces/MunicipalityInterface.java | 11 + .../java/org/example/models/BankAccount.java | 72 +++++++ .../java/org/example/models/Character.java | 76 +++++++ .../main/java/org/example/models/City.java | 67 ++++++ .../java/org/example/models/Employee.java | 47 +++++ .../main/java/org/example/models/Food.java | 32 +++ .../java/org/example/models/Industry.java | 65 ++++++ .../src/main/java/org/example/models/Job.java | 42 ++++ .../main/java/org/example/models/Liquid.java | 16 ++ .../main/java/org/example/models/Manager.java | 8 + .../java/org/example/models/Property.java | 37 ++++ .../main/java/org/example/models/User.java | 37 ++++ .../src/test/java/org/example/AppTest.java | 38 ++++ 35 files changed, 1354 insertions(+) create mode 100644 LightCity-Hossein/.idea/.gitignore create mode 100644 LightCity-Hossein/.idea/compiler.xml create mode 100644 LightCity-Hossein/.idea/encodings.xml create mode 100644 LightCity-Hossein/.idea/jarRepositories.xml create mode 100644 LightCity-Hossein/.idea/misc.xml create mode 100644 LightCity-Hossein/README.md create mode 100644 LightCity-Hossein/pom.xml create mode 100644 LightCity-Hossein/src/main/java/org/example/App.java create mode 100644 LightCity-Hossein/src/main/java/org/example/Database.java create mode 100644 LightCity-Hossein/src/main/java/org/example/Game.java create mode 100644 LightCity-Hossein/src/main/java/org/example/Menu.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/Bank.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/BankTurnover.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/FastFoodShop.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/Life.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/Municipality.java create mode 100644 LightCity-Hossein/src/main/java/org/example/defualtSystem/StockMarket.java create mode 100644 LightCity-Hossein/src/main/java/org/example/enumerations/Gender.java create mode 100644 LightCity-Hossein/src/main/java/org/example/interfaces/BankInterface.java create mode 100644 LightCity-Hossein/src/main/java/org/example/interfaces/CharacterInterface.java create mode 100644 LightCity-Hossein/src/main/java/org/example/interfaces/CityInterface.java create mode 100644 LightCity-Hossein/src/main/java/org/example/interfaces/GameInterface.java create mode 100644 LightCity-Hossein/src/main/java/org/example/interfaces/MunicipalityInterface.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/BankAccount.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Character.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/City.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Employee.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Food.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Industry.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Job.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Liquid.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Manager.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/Property.java create mode 100644 LightCity-Hossein/src/main/java/org/example/models/User.java create mode 100644 LightCity-Hossein/src/test/java/org/example/AppTest.java diff --git a/LightCity-Hossein/.idea/.gitignore b/LightCity-Hossein/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/LightCity-Hossein/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/LightCity-Hossein/.idea/compiler.xml b/LightCity-Hossein/.idea/compiler.xml new file mode 100644 index 0000000..9c435a1 --- /dev/null +++ b/LightCity-Hossein/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/LightCity-Hossein/.idea/encodings.xml b/LightCity-Hossein/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/LightCity-Hossein/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/LightCity-Hossein/.idea/jarRepositories.xml b/LightCity-Hossein/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/LightCity-Hossein/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/LightCity-Hossein/.idea/misc.xml b/LightCity-Hossein/.idea/misc.xml new file mode 100644 index 0000000..44185bb --- /dev/null +++ b/LightCity-Hossein/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/LightCity-Hossein/README.md b/LightCity-Hossein/README.md new file mode 100644 index 0000000..b79bccf --- /dev/null +++ b/LightCity-Hossein/README.md @@ -0,0 +1,3 @@ +Hossein GHolami: DataBase from sql +AmirHossein Ziarati: Impliment industries +Kiarash EbrahimNezhad: CLI menu(Step 2,5) diff --git a/LightCity-Hossein/pom.xml b/LightCity-Hossein/pom.xml new file mode 100644 index 0000000..ad15b26 --- /dev/null +++ b/LightCity-Hossein/pom.xml @@ -0,0 +1,39 @@ + + 4.0.0 + + org.example + GrowingInLightCity + 1.0-SNAPSHOT + jar + + GrowingInLightCity + http://maven.apache.org + + + UTF-8 + 20 + 20 + + + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 19 + 19 + + + + + diff --git a/LightCity-Hossein/src/main/java/org/example/App.java b/LightCity-Hossein/src/main/java/org/example/App.java new file mode 100644 index 0000000..5f21d2e --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/App.java @@ -0,0 +1,13 @@ +package org.example; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/Database.java b/LightCity-Hossein/src/main/java/org/example/Database.java new file mode 100644 index 0000000..ff98ec1 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/Database.java @@ -0,0 +1,142 @@ +package org.example; + +import com.sun.tools.javac.Main; +import org.example.models.Property; +import org.example.models.User; + +import javax.xml.crypto.Data; +import java.sql.*; +import java.util.ArrayList; + +public class Database { + + static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; + static final String DB_URL = "jdbc:mysql://localhost:3306/lightCity"; + + // Database credentials + static final String USER = "root"; + static final String PASS = "hossein1383"; + + + private static Connection conn; + + public Database() { + try { + Class.forName(JDBC_DRIVER); + conn = DriverManager.getConnection(DB_URL, USER, PASS); + System.out.println("Connecting to database..."); + } catch (Exception exp) { + System.out.println("Database Exception : \n" + exp.toString()); + System.exit(0); + } + } + // Tables + + /** + * Users + */ + + private void createTables() { +// query example + String query = "CREATE TABLE IF NOT EXISTS Users (username varchar(255) primary key ,password varchar(255));" + + "CREATE TABLE IF NOT EXISTS ...."; + try { + Statement stmt = conn.createStatement(); + if (stmt.execute(query)) { + + } else + System.out.println("An error accord during operation"); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + static String userName; + static String passWord; + + public static User loginGame(User user) { + + try { + Statement stmt = conn.createStatement(); + String query = "SELECT * FROM lightCity"; + ResultSet res = stmt.executeQuery(query); + while (res.next()) { + userName = res.getString(1); + passWord = res.getString(2); + if (user.getUsername().equals(userName) && user.getPassword().equals(passWord)) { + return user; + } + } + } catch (Exception exception) { + } + return null; + } + + public static boolean notNull(User user) { + try { + Statement statement = conn.createStatement(); + ResultSet res = statement.executeQuery("SELECT * FROM users"); + if (res.next()) { + return false; + } else + return true; + } catch (Exception e) { + } + return false; + } + + public static User registerGame(User user) { + boolean isNotNull = notNull(user); + if (!isNotNull) { + try { + Statement statement = conn.createStatement(); + String query = String.format("INSERT INTO lightCity(username,password) VALUES(%s,%s)", user.getUsername(), user.getPassword()); + } catch (Exception e) { + } + } + return null; + } + + public static void saveProperties(Property property) { + String query = "INSERT INTO properties(width , height,coordinate1,coordinate2,owner) VALUES (?,?,?,?,?)"; + try { + PreparedStatement preparedStatement = conn.prepareStatement(query); + float width = property.getScales()[0]; + float height = property.getScales()[1]; + float xCoordinate = property.getCoordinate()[0]; + float yCoordinate = property.getScales()[1]; + preparedStatement.setFloat(1, width); + preparedStatement.setFloat(2, height); + preparedStatement.setFloat(3, xCoordinate); + preparedStatement.setFloat(4, yCoordinate); + if (property.getOwner() == null) { + preparedStatement.setString(5, "defaultOwner"); + } else + preparedStatement.setString(5, property.getOwner().toString()); + preparedStatement.executeUpdate(); + } catch (Exception e) { + + } + + } + + public static ArrayList getProperties() { + ArrayList getPropertiesList = new ArrayList<>(); + try { + Statement statement = conn.createStatement(); + ResultSet resultSet = statement.executeQuery("SELECT * FROM properties"); + while (resultSet.next()) { + float width = resultSet.getFloat("width"); + float height = resultSet.getFloat("height"); + float xCoordinate = resultSet.getFloat("xCoordinate"); + float yCoordinate = resultSet.getFloat("yCoordinate"); + Property property = new Property(new float[]{width, height}, new float[]{xCoordinate, yCoordinate}, null); + getPropertiesList.add(property); + } + return getPropertiesList; + } catch (Exception e) { + + } + return getPropertiesList; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/Game.java b/LightCity-Hossein/src/main/java/org/example/Game.java new file mode 100644 index 0000000..dc85634 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/Game.java @@ -0,0 +1,49 @@ +package org.example; + +import org.example.interfaces.GameInterface; +import org.example.models.Character; +import org.example.models.City; +import org.example.models.User; + +import java.util.ArrayList; +import java.util.Scanner; + +public class Game implements GameInterface { + +// Check Data from Database or file to see There is city or not + private City city; + @Override + public void continueGame(User user) { + if (user != null){ + + } + + } + +/** Create new city and Generate new Character + * @param user : User information contain username, password + * */ + @Override + public void startGame(User user) { + + generateNewCity(); + city.joinCharacter(user); + //data base;save and send data; + + } + + /** + * @param ip Server ip address / example : 127.0.0.1 + * @param port Server open port for specific ip address + * */ + @Override + public void joinServer(String ip, int port) { + + } + + @Override + public void generateNewCity() { + city = new City(); + } + +} diff --git a/LightCity-Hossein/src/main/java/org/example/Menu.java b/LightCity-Hossein/src/main/java/org/example/Menu.java new file mode 100644 index 0000000..591892d --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/Menu.java @@ -0,0 +1,197 @@ +package org.example; + +import org.example.models.User; + +import java.util.Scanner; + +public class Menu { + private static Game game = new Game(); + private static Scanner scanner = new Scanner(System.in); + + public static void showMenu() { + while (true) { + mainMenu(); + String next = scanner.next(); + if (next.equals("1")) { + game.continueGame(loginMenu()); + } else if (next.equals("2")) { + game.startGame(loginMenu()); + } else if (next.equals("3")) { + joinServer(); + } else if (next.equals("4")) + System.exit(0); + } + } + + public static void mainMenu() { +// show menu : sout () + System.out.println("****************************"); + System.out.println("*** 1-Continue ***"); + System.out.println("*** 2-Start New Game ***"); + System.out.println("*** 3-Join Server ***"); + System.out.println("*** 4-Exit ***"); + System.out.println("****************************"); + + } + + public static void userMenu()//print option for user + { + System.out.println("****************************"); + System.out.println("*** 1-Go to ***"); + System.out.println("*** 2-Process Location ***"); + System.out.println("*** 3-Dashboard ***"); + System.out.println("*** 4-Life ***"); + System.out.println("*** 5-Exit ***"); + System.out.println("****************************"); + } + + public static void showUserMenu(User user)// + { + userMenu(); + String next = scanner.next(); + switch (next) { + case "1": { + System.out.println("** Enter location (1 or 2) **"); + System.out.println("** a. Location ID **"); + System.out.println("** b. Industry Title **"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.out.print("Enter Your Location ID : "); + String LocationId = scanner.next(); + //complete this part + } else if (nextGoTo.equals("b")) { + System.out.print("Enter Your Industry Title : "); + String IndustryTitle = scanner.next(); + //complete this part + } + } + case "2": { + System.out.println("** Show Detail (1 or 2) **"); + System.out.println("** a. Show where is character : Property detail {position , title,…} **"); + System.out.println("** b. Show options according to Industry and Property ownership **"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + //kia(level of user) + //complete this part + } else if (nextGoTo.equals("b")) { + //option of user industry + //complete this part + } + } + case "3": { + System.out.println("a. My Job"); + System.out.println("b. Properties"); + System.out.println("c. Economy"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.out.println("i. Find Job"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //find job + } + } else if (nextGoTo.equals("b")) { + System.out.println("i. Show Properties"); + System.out.println("ii. Sell"); + System.out.println("iii. Management"); + System.out.println("iv. Found Industry"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //show prprty + } else if (nextGoToOptions.equals("ii")) { + //sell + } else if (nextGoToOptions.equals("iii")) { + //management + } else if (nextGoToOptions.equals("iv")) { + //found indstry + } + } else if (nextGoTo.equals("c")) { + System.out.println("i. Show Incomes"); + System.out.println("ii. Show Job Detail"); + System.out.println("iii. How Can Grow Up"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //show incomes + } else if (nextGoToOptions.equals("ii")) { + //show job detail + } else if (nextGoToOptions.equals("iii")) { + //H C Grow Up + } + } + } + case ("4"): { + System.out.println("a. Life Detail"); + System.out.println("b. Sleep Function"); + System.out.println("c. Eat Function"); + System.out.println("d. Show (Food , Water , Sleep) Percent"); + } + case ("5"): { + System.out.println("a. Are You Sure?"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.exit(0); + } + } + } + } + + public static User loginMenu() { + boolean b = true; + while (b) { + Scanner input = new Scanner(System.in); + System.out.print("** Enter your username : "); + String username = input.nextLine(); + System.out.print("** Enter your password: "); + String password = input.nextLine(); + User user = new User(username, password); + if (Database.loginGame(user) != null) { + return user; + } else { + System.out.println("1. logIn"); + System.out.println("2. signUp"); + String temp = input.nextLine(); + switch (temp) { + case "1" -> loginMenu(); + case "2" -> registerMenu(); + case "3" -> b = false; + } + } + } + return null; + } + + private static void joinServer() { + System.out.print("Enter Server Ip Address :"); + String ip = scanner.next(); + System.out.print("Enter Server Port :"); + int port = scanner.nextInt(); + game.joinServer(ip, port); + } + + public static User registerMenu() { + boolean b = true; + while (b){ + Scanner input = new Scanner(System.in); + System.out.print("** Enter your username : "); + String username = input.nextLine(); + System.out.print("** Enter your password: "); + String password = input.nextLine(); + User user = new User(username, password); + if (Database.loginGame(user) != null) { + return user; + } else { + System.out.println("1. logIn"); + System.out.println("2. back"); + } + String next = input.nextLine(); + switch (next) { + case "1" -> loginMenu(); + case "2" -> b = false; + } + } + return null; + } + + public static void main(String[] args) { + showMenu(); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/Bank.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Bank.java new file mode 100644 index 0000000..a1af07d --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Bank.java @@ -0,0 +1,44 @@ +package org.example.defualtSystem; + +import org.example.interfaces.BankInterface; +import org.example.models.*; +import org.example.models.Character; + +import java.util.ArrayList; +import java.util.Date; + +public class Bank extends Industry implements BankInterface { + + private static final int MAX_EMPLOYEE_COUNT = 5; + private static final float BASE_EMP_SALARY = 0.5f; + private ArrayList accounts = new ArrayList(); + + private Manager manager = null; + + public static BankTurnover turnover; + + public Bank(Property property,Character root) { + super("Bank",property,root,100.0f); + turnover = new BankTurnover(); + } + + public BankAccount newAccount(String username,String password){ + BankAccount bankAccount = new BankAccount(username,password,0,new Date()); + accounts.add(bankAccount); + return bankAccount; + } + public boolean registerAsEmp(Character character){ + if(employees.size() >= MAX_EMPLOYEE_COUNT)return false; + Employee employee = new Employee(character.getUserInfo().getUsername(),this,BASE_EMP_SALARY,character.getAccount()); + employees.add(employee); + return true; + } + + + public String bankDetail(Character character){ + if(character.getUserInfo().getUsername().equals(manager.getUsername())){ + return ""; + } + return "Only Manager can see Bank detail"; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/BankTurnover.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/BankTurnover.java new file mode 100644 index 0000000..6695351 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/BankTurnover.java @@ -0,0 +1,20 @@ +package org.example.defualtSystem; + +public class BankTurnover { + private double withdraw = 0; + private double deposit = 0; + + /** + * @param amount : Money amount + * @param type : -1 for withdraw , +1 for deposit + * */ + public void transfer(float amount,int type){ + if(type == 1) + deposit=amount; + else if (type==-1) + withdraw+=amount; + } + public double calcTurnover(){ + return deposit-withdraw; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/FastFoodShop.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/FastFoodShop.java new file mode 100644 index 0000000..2c178cf --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/FastFoodShop.java @@ -0,0 +1,17 @@ +package org.example.defualtSystem; + +import org.example.models.Character; +import org.example.models.Industry; +import org.example.models.Property; + +public class FastFoodShop extends Industry { + + /** + * Industry type example (Business) + * */ + private static final float INCOME = 0.3f; + private static final float EMPLOYEE_INCOME = 0.02f; + public FastFoodShop(String title, Property property, Character character) { + super(title, property, character,EMPLOYEE_INCOME); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/Life.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Life.java new file mode 100644 index 0000000..1c51df1 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Life.java @@ -0,0 +1,92 @@ +package org.example.defualtSystem; + +import org.example.models.Food; +import org.example.models.Liquid; + +public class Life { + private float food; + private float water; + private float sleep; + + public Life(){ + food = 100.0f; + water=100.0f; + sleep=100.0f; + } + + public Life(float food, float water, float sleep) { + this.food = food; + this.water = water; + this.sleep = sleep; + startConsuming(); + } + + public float getFood() { + return food; + } + + public float getWater() { + return water; + } + + public float getSleep() { + return sleep; + } + + + public void foodConsumption(Food product){ + if(product.available){ + water+=product.getWater(); + food +=product.getFood(); + } + } + + public void liquidConsumption(Liquid product){ + if(product.available){ + water+=product.getLiquid(); + } + } + + + public void startConsuming() { + Thread thread = new Thread(() -> { + while (true) { + consumeFood(0.4f); + consumeWater(0.8f); + consumeSleep(0.7f); + + try { + Thread.sleep(60000); // wait for 1 minute + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }); + + thread.start(); + } + + private synchronized void consumeFood(float amount) { + if (food >= amount) { + food -= amount; + } else { + System.out.println("Not enough food!"); + } + } + + private synchronized void consumeWater(float amount) { + if (water >= amount) { + water -= amount; + } else { + System.out.println("Not enough water!"); + } + } + + private synchronized void consumeSleep(float amount) { + if (sleep >= amount) { + sleep -= amount; + } else { + System.out.println("Not enough sleep!"); + } + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/Municipality.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Municipality.java new file mode 100644 index 0000000..92781bf --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/Municipality.java @@ -0,0 +1,33 @@ +package org.example.defualtSystem; + +import org.example.interfaces.MunicipalityInterface; +import org.example.models.Property; + +import java.util.ArrayList; + +public class Municipality implements MunicipalityInterface { + private ArrayList properties; + + public Municipality(){ + generateProperties(); + } + + private void generateProperties() { +// Create an algorithm for generating properties for city + } + + @Override + public Property buyProperty() { + return null; + } + + @Override + public void sellProperty(Property property) { + + } + + @Override + public void showProperties() { + + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/defualtSystem/StockMarket.java b/LightCity-Hossein/src/main/java/org/example/defualtSystem/StockMarket.java new file mode 100644 index 0000000..5f06660 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/defualtSystem/StockMarket.java @@ -0,0 +1,63 @@ +package org.example.defualtSystem; + +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +public class StockMarket{ + private Map users; + + public StockMarket() { + users = new HashMap<>(); + } + + public synchronized void depositCapital(String userName, double amount) { + if (users.containsKey(userName)) { + double currentCapital = users.get(userName); + users.put(userName, currentCapital + amount); + } else { + users.put(userName, amount); + } + } + + public synchronized double getDetail(String userName) { + if (users.containsKey(userName)) { + return users.get(userName); + } else { + return 0.0; + } + } + + public synchronized double withdrawCapital(String userName) { + if (users.containsKey(userName)) { + double amount = users.get(userName); + users.put(userName, 0.0); + return amount; + } else { + return 0.0; + } + } + + public void startMarketSimulation() { + Thread marketThread = new Thread(() -> { + Random random = new Random(); + while (true) { + double change = random.nextDouble() * 0.06 - 0.03; + for (String userName : users.keySet()) { + double capital = users.get(userName); + double newCapital = capital + capital * change; + if (newCapital < 0) { + newCapital = 0; + } + users.put(userName, newCapital); + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }); + marketThread.start(); + } +} \ No newline at end of file diff --git a/LightCity-Hossein/src/main/java/org/example/enumerations/Gender.java b/LightCity-Hossein/src/main/java/org/example/enumerations/Gender.java new file mode 100644 index 0000000..dc64618 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/enumerations/Gender.java @@ -0,0 +1,5 @@ +package org.example.enumerations; + +public enum Gender { + Male,Female +} diff --git a/LightCity-Hossein/src/main/java/org/example/interfaces/BankInterface.java b/LightCity-Hossein/src/main/java/org/example/interfaces/BankInterface.java new file mode 100644 index 0000000..f8bb551 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/interfaces/BankInterface.java @@ -0,0 +1,4 @@ +package org.example.interfaces; + +public interface BankInterface { +} diff --git a/LightCity-Hossein/src/main/java/org/example/interfaces/CharacterInterface.java b/LightCity-Hossein/src/main/java/org/example/interfaces/CharacterInterface.java new file mode 100644 index 0000000..7e3529f --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/interfaces/CharacterInterface.java @@ -0,0 +1,6 @@ +package org.example.interfaces; + +public interface CharacterInterface { + void positionProcessing(); + +} diff --git a/LightCity-Hossein/src/main/java/org/example/interfaces/CityInterface.java b/LightCity-Hossein/src/main/java/org/example/interfaces/CityInterface.java new file mode 100644 index 0000000..42be3a9 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/interfaces/CityInterface.java @@ -0,0 +1,9 @@ +package org.example.interfaces; + +import org.example.models.Character; +import org.example.models.User; + +public interface CityInterface { + void joinCharacter(User character); + void getCityDetail(); +} diff --git a/LightCity-Hossein/src/main/java/org/example/interfaces/GameInterface.java b/LightCity-Hossein/src/main/java/org/example/interfaces/GameInterface.java new file mode 100644 index 0000000..4e2d808 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/interfaces/GameInterface.java @@ -0,0 +1,15 @@ +package org.example.interfaces; + +import org.example.models.Character; +import org.example.models.User; + +public interface GameInterface { + void continueGame(User user); + void startGame(User user); + + void joinServer(String ip ,int port); + + void generateNewCity(); + + +} diff --git a/LightCity-Hossein/src/main/java/org/example/interfaces/MunicipalityInterface.java b/LightCity-Hossein/src/main/java/org/example/interfaces/MunicipalityInterface.java new file mode 100644 index 0000000..f2f0ea2 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/interfaces/MunicipalityInterface.java @@ -0,0 +1,11 @@ +package org.example.interfaces; + +import org.example.models.Property; + +public interface MunicipalityInterface { + +// Buy and sell property + Property buyProperty(); + void sellProperty(Property property); + void showProperties(); +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/BankAccount.java b/LightCity-Hossein/src/main/java/org/example/models/BankAccount.java new file mode 100644 index 0000000..8c5e27d --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/BankAccount.java @@ -0,0 +1,72 @@ +package org.example.models; + +import org.example.defualtSystem.Bank; + +import java.util.Date; + +public class BankAccount { + private String owner; + private String password; + private float money; + private Date lastChange; + + private String logs = ""; + + public BankAccount(String owner, String password, float money, Date lastChange) { + this.owner = owner; + this.password = password; + this.money = money; + this.lastChange = lastChange; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public float getMoney() { + return money; + } + + + public Date getLastChange() { + return lastChange; + } + + public void setLastChange(Date lastChange) { + this.lastChange = lastChange; + } + + public boolean withdraw(Character character,float amount){ + if(character.getUserInfo().getUsername().equals(owner)){ + if(amount <= money){ + Bank.turnover.transfer(amount,-1); + money-= amount; + return true; + }else + return false; + } + return false; + } + public boolean deposit(Character character,float amount){ + if(amount >0){ + String log = String.format("User : %s deposit %f \n",character.getUserInfo().getUsername(),amount); + logs+=log; + Bank.turnover.transfer(amount,1); + money += amount; + return true; + } + return false; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Character.java b/LightCity-Hossein/src/main/java/org/example/models/Character.java new file mode 100644 index 0000000..bb6a061 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Character.java @@ -0,0 +1,76 @@ +package org.example.models; + +import org.example.defualtSystem.Life; +import org.example.interfaces.CharacterInterface; + +import java.util.ArrayList; + +public class Character implements CharacterInterface { + private User userInfo; + private BankAccount account; + private Life life; + + private Job job; + private ArrayList properties; + + private Property inPosition; + + public Character(User userInfo, BankAccount account, Life life, Job job, ArrayList properties, Property inPosition) { + this.userInfo = userInfo; + this.account = account; + this.life = life; + this.job = job; + this.properties = properties; + this.inPosition = inPosition; + } + + public User getUserInfo() { + return userInfo; + } + + public void setUserInfo(User userInfo) { + this.userInfo = userInfo; + } + + public BankAccount getAccount() { + return account; + } + + public void setAccount(BankAccount account) { + this.account = account; + } + + public Life getLife() { + return life; + } + + public void setLife(Life life) { + this.life = life; + } + + public Job getJob() { + return job; + } + + public void setJob(Job job) { + this.job = job; + } + + public void gotToLocation(Property destination){ + if(destination==null)return; + inPosition = destination; + } + + public ArrayList getProperties() { + return properties; + } + + public void setProperties(ArrayList properties) { + this.properties = properties; + } + + @Override + public void positionProcessing() { + + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/City.java b/LightCity-Hossein/src/main/java/org/example/models/City.java new file mode 100644 index 0000000..f68b861 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/City.java @@ -0,0 +1,67 @@ +package org.example.models; + +import org.example.defualtSystem.Bank; +import org.example.defualtSystem.Life; +import org.example.defualtSystem.Municipality; +import org.example.defualtSystem.StockMarket; +import org.example.interfaces.CityInterface; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Scanner; + +public class City implements CityInterface { + private final ArrayList characters; + private final Bank bankSystem; + private final Municipality municipality; + + private final StockMarket stockMarket; + + private Character root; + + public City() { + characters = new ArrayList<>(); + municipality = new Municipality(); +// Get Bank Property from municipality + bankSystem = new Bank(new Property(new float[]{12, 32}, new float[]{42, 32}, root), root); + stockMarket = new StockMarket(); + stockMarket.startMarketSimulation(); + } + + @Override + public void joinCharacter(User userinfo) { + BankAccount newAccount = bankSystem.newAccount(userinfo.getUsername(), userinfo.getPassword()); + Character character = new Character(userinfo, newAccount, new Life(), null, null, null); + characters.add(character); + beginGame(character); + } + + @Override + public void getCityDetail() { + String players = Arrays.toString(characters.toArray()); + } + + + /** + * Begin Game function generate a new thread for each character , DO NOT CHANGE THIS FUNCTION STRUCTURE , + * + * */ + private void beginGame(Character character) { + Thread thread = new Thread(() -> { + try { + Scanner scanner = new Scanner(System.in); + while (true) { + System.out.println("Show Menu"); + switch (scanner.next()) { + case "2"-> System.out.println("Do Something"); + case "3"-> System.out.println("Do Something"); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + thread.start(); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Employee.java b/LightCity-Hossein/src/main/java/org/example/models/Employee.java new file mode 100644 index 0000000..81e8fbc --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Employee.java @@ -0,0 +1,47 @@ +package org.example.models; + +public class Employee { + private String username; + private float baseSalary ; + private int level; + + private BankAccount bankAccount; + + private Industry industry; + + public Employee(String username,Industry industry, float baseSalary,BankAccount bankAccount) { + this.username = username; + this.baseSalary = baseSalary; + this.industry = industry; + this.level = 1; + this.bankAccount = bankAccount; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public float getBaseSalary() { + return baseSalary; + } + + public void setBaseSalary(float baseSalary) { + this.baseSalary = baseSalary; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public void paySalary(){ + bankAccount.deposit(industry.getOwner(),level*baseSalary); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Food.java b/LightCity-Hossein/src/main/java/org/example/models/Food.java new file mode 100644 index 0000000..b94d900 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Food.java @@ -0,0 +1,32 @@ +package org.example.models; + +public class Food { + + private String title; + private final float water; + private final float food; + + public boolean available = true; + + public Food(String title,float food,float water) { + this.food = food; + this.water = water; + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public float getWater() { + return water; + } + + public float getFood() { + return food; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Industry.java b/LightCity-Hossein/src/main/java/org/example/models/Industry.java new file mode 100644 index 0000000..b3bf20b --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Industry.java @@ -0,0 +1,65 @@ +package org.example.models; + +import java.util.ArrayList; +import java.util.List; + +public class Industry extends Property{ + private String title; + private float income; + + protected ArrayList employees = new ArrayList<>(); + + /** + * @param title : A Title for generate Industry @example : Bank extends Industry then title = "Bank" + * @param property : Industry owner should have a Property to create this industry on it + * @param character : Industry owner + * @param income : Each Business has a class like Bank and extends Industry , in super method Enter the desired monthly income amount + * */ + public Industry(String title,Property property,Character character,float income) { + super(property.getScales(),property.getCoordinate(),character); + this.title = title; + this.income = income; + startPaySalary(); + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public float getIncome() { + return income; + } + + public void setIncome(float income) { + this.income = income; + } + + + public ArrayList getEmployee() { + return employees; + } + + public void setEmployee(ArrayList employee) { + this.employees = employee; + } + + public void startPaySalary(){ + Thread thread = new Thread(()->{ + while (true){ + employees.stream().forEach((employee)->{ + employee.paySalary(); + }); + try { + Thread.sleep(10800000); // wait for 1 minute + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }); + thread.start(); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Job.java b/LightCity-Hossein/src/main/java/org/example/models/Job.java new file mode 100644 index 0000000..ac8c655 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Job.java @@ -0,0 +1,42 @@ +package org.example.models; + +public class Job { + private String title; + private float income; + private String industryId; + + /** + * @param title : Industry title + * @param income : industry The monthly income of its employees + * @param industryId : industry id + * */ + public Job(String title, float income, String industryId) { + this.title = title; + this.income = income; + this.industryId = industryId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public float getIncome() { + return income; + } + + public void setIncome(float income) { + this.income = income; + } + + public String getIndustryId() { + return industryId; + } + + public void setIndustryId(String industryId) { + this.industryId = industryId; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Liquid.java b/LightCity-Hossein/src/main/java/org/example/models/Liquid.java new file mode 100644 index 0000000..3b8cb59 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Liquid.java @@ -0,0 +1,16 @@ +package org.example.models; + +public class Liquid { + private final float liquid; + + public boolean available =true; + + public Liquid(float liquid) { + this.liquid = liquid; + } + + public float getLiquid() { + return liquid; + } + +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Manager.java b/LightCity-Hossein/src/main/java/org/example/models/Manager.java new file mode 100644 index 0000000..4d7464d --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Manager.java @@ -0,0 +1,8 @@ +package org.example.models; + +public class Manager extends Employee{ + + public Manager(String username, Industry industry, float baseSalary, BankAccount bankAccount) { + super(username, industry, baseSalary, bankAccount); + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/Property.java b/LightCity-Hossein/src/main/java/org/example/models/Property.java new file mode 100644 index 0000000..94c8029 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/Property.java @@ -0,0 +1,37 @@ +package org.example.models; + +public class Property { + private float[] scales; + private float[] coordinate; + private Character owner ; + + public Property(float[] scales, float[] coordinate, Character owner) { + this.scales = scales; + this.coordinate = coordinate; + this.owner = owner; + } + + public float[] getScales() { + return scales; + } + + public void setScales(float[] scales) { + this.scales = scales; + } + + public Character getOwner() { + return owner; + } + + public void setOwner(Character owner) { + this.owner = owner; + } + + public float[] getCoordinate() { + return coordinate; + } + + public void setCoordinate(float[] coordinate) { + this.coordinate = coordinate; + } +} diff --git a/LightCity-Hossein/src/main/java/org/example/models/User.java b/LightCity-Hossein/src/main/java/org/example/models/User.java new file mode 100644 index 0000000..c834866 --- /dev/null +++ b/LightCity-Hossein/src/main/java/org/example/models/User.java @@ -0,0 +1,37 @@ +package org.example.models; + +public class User { + private String username; + private String password; + + public User() + { + + } + public User(String username, String password) { + this.username = username; + this.password = password; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public void sign(String username,String password) + { + setPassword(password); + setUsername(username); + } +} diff --git a/LightCity-Hossein/src/test/java/org/example/AppTest.java b/LightCity-Hossein/src/test/java/org/example/AppTest.java new file mode 100644 index 0000000..d5f435d --- /dev/null +++ b/LightCity-Hossein/src/test/java/org/example/AppTest.java @@ -0,0 +1,38 @@ +package org.example; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} From 6c9cfd903adfebd45046c7a6aadbbda880873b2c Mon Sep 17 00:00:00 2001 From: hosein Date: Sat, 1 Jul 2023 23:32:23 +0330 Subject: [PATCH 3/3] the last file commited --- .gitignore | 38 --- .idea/uiDesigner.xml | 124 --------- .idea/vcs.xml | 6 - .../.idea}/.gitignore | 0 LightCity-AmirHosseinZh/.idea/compiler.xml | 13 + .../.idea}/encodings.xml | 0 .../.idea/jarRepositories.xml | 20 ++ .../.idea}/misc.xml | 4 +- LightCity-AmirHosseinZh/README.md | 3 + pom.xml => LightCity-AmirHosseinZh/pom.xml | 12 + .../src}/main/java/org/example/App.java | 0 .../src/main/java/org/example/Database.java | 261 ++++++++++++++++++ .../src}/main/java/org/example/Game.java | 10 + .../src/main/java/org/example/Menu.java | 197 +++++++++++++ .../java/org/example/defualtSystem/Bank.java | 2 +- .../example/defualtSystem/BankTurnover.java | 0 .../example/defualtSystem/FastFoodShop.java | 0 .../java/org/example/defualtSystem/Life.java | 6 +- .../example/defualtSystem/Municipality.java | 0 .../example/defualtSystem/StockMarket.java | 0 .../java/org/example/enumerations/Gender.java | 0 .../org/example/interfaces/BankInterface.java | 0 .../interfaces/CharacterInterface.java | 0 .../org/example/interfaces/CityInterface.java | 0 .../org/example/interfaces/GameInterface.java | 0 .../interfaces/MunicipalityInterface.java | 0 .../java/org/example/models/BankAccount.java | 0 .../java/org/example/models/Character.java | 4 + .../main/java/org/example/models/City.java | 245 ++++++++++++++++ .../java/org/example/models/Employee.java | 0 .../main/java/org/example/models/Food.java | 0 .../java/org/example/models/Industry.java | 0 .../main/java/org/example/models/Job.java | 0 .../main/java/org/example/models/Liquid.java | 0 .../main/java/org/example/models/Manager.java | 0 .../java/org/example/models/Property.java | 0 .../main/java/org/example/models/User.java | 0 LightCity-AmirHosseinZh/src/main/main.iml | 11 + .../src}/test/java/org/example/AppTest.java | 0 LightCity-AmirHosseinZh/src/test/test.iml | 11 + .../target/classes/org/example/App.class | Bin 0 -> 537 bytes .../target/classes/org/example/Database.class | Bin 0 -> 9831 bytes .../target/classes/org/example/Game.class | Bin 0 -> 962 bytes .../target/classes/org/example/Menu.class | Bin 0 -> 5548 bytes .../org/example/defualtSystem/Bank.class | Bin 0 -> 2548 bytes .../example/defualtSystem/BankTurnover.class | Bin 0 -> 671 bytes .../example/defualtSystem/FastFoodShop.class | Bin 0 -> 730 bytes .../org/example/defualtSystem/Life.class | Bin 0 -> 3113 bytes .../example/defualtSystem/Municipality.class | Bin 0 -> 925 bytes .../example/defualtSystem/StockMarket.class | Bin 0 -> 3030 bytes .../org/example/enumerations/Gender.class | Bin 0 -> 1055 bytes .../example/interfaces/BankInterface.class | Bin 0 -> 130 bytes .../interfaces/CharacterInterface.class | Bin 0 -> 175 bytes .../example/interfaces/CityInterface.class | Bin 0 -> 215 bytes .../example/interfaces/GameInterface.class | Bin 0 -> 282 bytes .../interfaces/MunicipalityInterface.class | Bin 0 -> 291 bytes .../org/example/models/BankAccount.class | Bin 0 -> 2794 bytes .../org/example/models/Character.class | Bin 0 -> 2949 bytes .../classes/org/example/models/City.class | Bin 0 -> 6974 bytes .../classes/org/example/models/Employee.class | Bin 0 -> 1552 bytes .../classes/org/example/models/Food.class | Bin 0 -> 862 bytes .../classes/org/example/models/Industry.class | Bin 0 -> 3202 bytes .../classes/org/example/models/Job.class | Bin 0 -> 1034 bytes .../classes/org/example/models/Liquid.class | Bin 0 -> 464 bytes .../classes/org/example/models/Manager.class | Bin 0 -> 565 bytes .../classes/org/example/models/Property.class | Bin 0 -> 1085 bytes .../classes/org/example/models/User.class | Bin 0 -> 1002 bytes src/main/java/org/example/Database.java | 69 ----- src/main/java/org/example/Menu.java | 41 --- src/main/java/org/example/models/City.java | 67 ----- 70 files changed, 794 insertions(+), 350 deletions(-) delete mode 100644 .gitignore delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml rename {.idea => LightCity-AmirHosseinZh/.idea}/.gitignore (100%) create mode 100644 LightCity-AmirHosseinZh/.idea/compiler.xml rename {.idea => LightCity-AmirHosseinZh/.idea}/encodings.xml (100%) create mode 100644 LightCity-AmirHosseinZh/.idea/jarRepositories.xml rename {.idea => LightCity-AmirHosseinZh/.idea}/misc.xml (73%) create mode 100644 LightCity-AmirHosseinZh/README.md rename pom.xml => LightCity-AmirHosseinZh/pom.xml (70%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/App.java (100%) create mode 100644 LightCity-AmirHosseinZh/src/main/java/org/example/Database.java rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/Game.java (86%) create mode 100644 LightCity-AmirHosseinZh/src/main/java/org/example/Menu.java rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/Bank.java (98%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/BankTurnover.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/FastFoodShop.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/Life.java (94%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/Municipality.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/defualtSystem/StockMarket.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/enumerations/Gender.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/interfaces/BankInterface.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/interfaces/CharacterInterface.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/interfaces/CityInterface.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/interfaces/GameInterface.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/interfaces/MunicipalityInterface.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/BankAccount.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Character.java (95%) create mode 100644 LightCity-AmirHosseinZh/src/main/java/org/example/models/City.java rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Employee.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Food.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Industry.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Job.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Liquid.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Manager.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/Property.java (100%) rename {src => LightCity-AmirHosseinZh/src}/main/java/org/example/models/User.java (100%) create mode 100644 LightCity-AmirHosseinZh/src/main/main.iml rename {src => LightCity-AmirHosseinZh/src}/test/java/org/example/AppTest.java (100%) create mode 100644 LightCity-AmirHosseinZh/src/test/test.iml create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/App.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/Database.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/Game.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/Menu.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Bank.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/BankTurnover.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/FastFoodShop.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Life.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Municipality.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/StockMarket.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/enumerations/Gender.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/interfaces/BankInterface.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/interfaces/CharacterInterface.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/interfaces/CityInterface.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/interfaces/GameInterface.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/interfaces/MunicipalityInterface.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/BankAccount.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Character.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/City.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Employee.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Food.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Industry.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Job.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Liquid.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Manager.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/Property.class create mode 100644 LightCity-AmirHosseinZh/target/classes/org/example/models/User.class delete mode 100644 src/main/java/org/example/Database.java delete mode 100644 src/main/java/org/example/Menu.java delete mode 100644 src/main/java/org/example/models/City.java diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ff6309..0000000 --- a/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ -*.iws -*.iml -*.ipr - -### Eclipse ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ - -### Mac OS ### -.DS_Store \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/.gitignore b/LightCity-AmirHosseinZh/.idea/.gitignore similarity index 100% rename from .idea/.gitignore rename to LightCity-AmirHosseinZh/.idea/.gitignore diff --git a/LightCity-AmirHosseinZh/.idea/compiler.xml b/LightCity-AmirHosseinZh/.idea/compiler.xml new file mode 100644 index 0000000..9c435a1 --- /dev/null +++ b/LightCity-AmirHosseinZh/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/LightCity-AmirHosseinZh/.idea/encodings.xml similarity index 100% rename from .idea/encodings.xml rename to LightCity-AmirHosseinZh/.idea/encodings.xml diff --git a/LightCity-AmirHosseinZh/.idea/jarRepositories.xml b/LightCity-AmirHosseinZh/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/LightCity-AmirHosseinZh/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/LightCity-AmirHosseinZh/.idea/misc.xml similarity index 73% rename from .idea/misc.xml rename to LightCity-AmirHosseinZh/.idea/misc.xml index 0a13117..44185bb 100644 --- a/.idea/misc.xml +++ b/LightCity-AmirHosseinZh/.idea/misc.xml @@ -8,7 +8,5 @@ - - - + \ No newline at end of file diff --git a/LightCity-AmirHosseinZh/README.md b/LightCity-AmirHosseinZh/README.md new file mode 100644 index 0000000..b79bccf --- /dev/null +++ b/LightCity-AmirHosseinZh/README.md @@ -0,0 +1,3 @@ +Hossein GHolami: DataBase from sql +AmirHossein Ziarati: Impliment industries +Kiarash EbrahimNezhad: CLI menu(Step 2,5) diff --git a/pom.xml b/LightCity-AmirHosseinZh/pom.xml similarity index 70% rename from pom.xml rename to LightCity-AmirHosseinZh/pom.xml index 8e8bcb0..ad15b26 100644 --- a/pom.xml +++ b/LightCity-AmirHosseinZh/pom.xml @@ -24,4 +24,16 @@ test + + + + org.apache.maven.plugins + maven-compiler-plugin + + 19 + 19 + + + + diff --git a/src/main/java/org/example/App.java b/LightCity-AmirHosseinZh/src/main/java/org/example/App.java similarity index 100% rename from src/main/java/org/example/App.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/App.java diff --git a/LightCity-AmirHosseinZh/src/main/java/org/example/Database.java b/LightCity-AmirHosseinZh/src/main/java/org/example/Database.java new file mode 100644 index 0000000..2e7778b --- /dev/null +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/Database.java @@ -0,0 +1,261 @@ +package org.example; + +import org.example.models.*; +import com.sun.tools.javac.Main; +import org.example.models.Character; +import org.example.models.Property; +import org.example.models.User; +import org.example.defualtSystem.*; + +import javax.xml.crypto.Data; + +import org.example.Database; + +import java.sql.*; +import java.util.ArrayList; + +public class Database { + + + static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; + static final String DB_URL = "jdbc:mysql://localhost:3306/lightCity"; + + // Database credentials + static final String USER = "root"; + static final String PASS = "hossein1383"; + + public static ArrayList characters = new ArrayList<>(); + private static Connection conn; + + public Database() { + try { + Class.forName(JDBC_DRIVER); + conn = DriverManager.getConnection(DB_URL, USER, PASS); + System.out.println("Connecting to database..."); + } catch (Exception exp) { + System.out.println("Database Exception : \n" + exp.toString()); + System.exit(0); + } + } + + public static void updateCharacter(String status, Character character) { + String updateQuery = ""; + switch (status) { + case "location": + updateQuery = "UPDATE characters SET location = ? WHERE username = ?"; + break; + case "job": + updateQuery = "UPDATE characters SET job = ? WHERE username = ?"; + break; + case "life": + updateQuery = "UPDATE characters SET life = ? WHERE username = ?"; + break; + case "money": + updateQuery = "UPDATE characters SET money = ? WHERE username = ?"; + break; + default: + System.out.println("Invalid status: " + status); + return; + } + + try (Connection connection = DriverManager.getConnection(DB_URL, USER, PASS); + PreparedStatement statement = connection.prepareStatement(updateQuery)) { + + switch (status) { + case "location": + String location = character.getInPosition() != null ? + character.getInPosition().getCoordinate()[0] + "," + character.getInPosition().getCoordinate()[1] : + "null"; + statement.setString(1, location); + break; + case "job": + statement.setString(1, character.getJob().getTitle()); + break; + case "life": + Life life = character.getLife(); + String lifeDetails = life.getFood() + "," + life.getSleep() + "," + life.getWater(); + statement.setString(1, lifeDetails); + break; + case "money": + BankAccount bankAccount = character.getAccount(); + statement.setFloat(1, bankAccount.getMoney()); + break; + } + + statement.setString(2, character.getUserInfo().getUsername()); + statement.executeUpdate(); + + } catch (SQLException e) { + e.printStackTrace(); + } + } + + + + // Tables + + /** + * Users + */ + + private void createTables() { +// query example + String query = "CREATE TABLE IF NOT EXISTS Users (username varchar(255) primary key ,password varchar(255));" + + "CREATE TABLE IF NOT EXISTS ...."; + try { + Statement stmt = conn.createStatement(); + if (stmt.execute(query)) { + + } else + System.out.println("An error accord during operation"); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + static String userName; + static String passWord; + + public static User loginGame(User user) { + + try { + Statement stmt = conn.createStatement(); + String query = "SELECT * FROM lightCity"; + ResultSet res = stmt.executeQuery(query); + while (res.next()) { + userName = res.getString(1); + passWord = res.getString(2); + if (user.getUsername().equals(userName) && user.getPassword().equals(passWord)) { + return user; + } + } + } catch (Exception exception) { + } + return null; + } + + public static boolean notNull(User user) { + try { + Statement statement = conn.createStatement(); + ResultSet res = statement.executeQuery("SELECT * FROM users"); + if (res.next()) { + return false; + } else + return true; + } catch (Exception e) { + } + return false; + } + + public static User registerGame(User user) { + boolean isNotNull = notNull(user); + if (!isNotNull) { + try { + Statement statement = conn.createStatement(); + String query = String.format("INSERT INTO lightCity(username,password) VALUES(%s,%s)", user.getUsername(), user.getPassword()); + } catch (Exception e) { + } + } + return null; + } + + public static void saveProperties(Property property) { + String query = "INSERT INTO properties(width , height,coordinate1,coordinate2,owner) VALUES (?,?,?,?,?)"; + try { + PreparedStatement preparedStatement = conn.prepareStatement(query); + float width = property.getScales()[0]; + float height = property.getScales()[1]; + float xCoordinate = property.getCoordinate()[0]; + float yCoordinate = property.getScales()[1]; + preparedStatement.setFloat(1, width); + preparedStatement.setFloat(2, height); + preparedStatement.setFloat(3, xCoordinate); + preparedStatement.setFloat(4, yCoordinate); + if (property.getOwner() == null) { + preparedStatement.setString(5, "defaultOwner"); + } else + preparedStatement.setString(5, property.getOwner().toString()); + preparedStatement.executeUpdate(); + } catch (Exception e) { + + } + + } + + public static void saveCharacter(Character character) { + String insertQuery = "INSERT INTO `characters`(`username`, `password`, `money`, `life`, `job`, `location`) VALUES (?,?,?,?,?,?)"; + + try (Connection connection = DriverManager.getConnection(DB_URL, USER, PASS); + PreparedStatement statement = connection.prepareStatement(insertQuery)) { + + String username = character.getUserInfo().getUsername(); + String password = character.getUserInfo().getPassword(); + String life = character.getLife().getFood() + "," + character.getLife().getSleep() + "," + character.getLife().getWater(); + String jobTitle = ""; + if (character.getJob() == null) { + jobTitle = "null"; + } else { + jobTitle = character.getJob().getTitle(); + } + String inLocation = " "; + + if (character.getInPosition() == null) { + inLocation = "null"; + } else { + inLocation = character.getInPosition().getCoordinate()[0] + "," + character.getInPosition().getCoordinate()[1]; + } + + statement.setString(1, username); + statement.setString(2, password); + statement.setFloat(3, character.getAccount().getMoney()); + statement.setString(4, life); + statement.setString(5, jobTitle); + statement.setString(6, inLocation); + + statement.executeUpdate(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + public static ArrayList getProperties() { + ArrayList getPropertiesList = new ArrayList<>(); + try { + Statement statement = conn.createStatement(); + ResultSet resultSet = statement.executeQuery("SELECT * FROM properties"); + while (resultSet.next()) { + float width = resultSet.getFloat("width"); + float height = resultSet.getFloat("height"); + float xCoordinate = resultSet.getFloat("xCoordinate"); + float yCoordinate = resultSet.getFloat("yCoordinate"); + Property property = new Property(new float[]{width, height}, new float[]{xCoordinate, yCoordinate}, null); + getPropertiesList.add(property); + } + return getPropertiesList; + } catch (Exception e) { + + } + return getPropertiesList; + } + + public static void createBankAccount(BankAccount bankAccount) { + String insertQuery = "INSERT INTO `bank-account`(`username`, `password`, `money`, `last`) VALUES (?,?,?,?)"; + + try (Connection connection = DriverManager.getConnection(DB_URL, USER, PASS); + PreparedStatement statement = connection.prepareStatement(insertQuery)) { + + String username = bankAccount.getOwner(); + String password = bankAccount.getPassword(); + float money = bankAccount.getMoney(); + String last = bankAccount.getLastChange().toString(); + statement.setString(1, username); + statement.setString(2, password); + statement.setFloat(3, money); + statement.setString(4, last); + statement.executeUpdate(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/org/example/Game.java b/LightCity-AmirHosseinZh/src/main/java/org/example/Game.java similarity index 86% rename from src/main/java/org/example/Game.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/Game.java index ee89f16..7785eef 100644 --- a/src/main/java/org/example/Game.java +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/Game.java @@ -6,6 +6,7 @@ import org.example.models.User; import java.util.ArrayList; +import java.util.Scanner; public class Game implements GameInterface { @@ -13,6 +14,10 @@ public class Game implements GameInterface { private City city; @Override public void continueGame(User user) { + if (user != null){ + City city = new City(); + } + } /** Create new city and Generate new Character @@ -20,8 +25,13 @@ public void continueGame(User user) { * */ @Override public void startGame(User user) { + generateNewCity(); city.joinCharacter(user); + //data base;save and send data; + + + } /** diff --git a/LightCity-AmirHosseinZh/src/main/java/org/example/Menu.java b/LightCity-AmirHosseinZh/src/main/java/org/example/Menu.java new file mode 100644 index 0000000..cbd43de --- /dev/null +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/Menu.java @@ -0,0 +1,197 @@ +package org.example; + +import org.example.models.User; + +import java.util.Scanner; + +public class Menu { + private static Game game = new Game(); + private static Scanner scanner = new Scanner(System.in); + + public static void showMenu() { + while (true) { + mainMenu(); + String next = scanner.next(); + if (next.equals("1")) { + game.continueGame(loginMenu()); + } else if (next.equals("2")) { + game.startGame(loginMenu()); + } else if (next.equals("3")) { + joinServer(); + } else if (next.equals("4")) + System.exit(0); + } + } + + public static void mainMenu() { +// show menu : sout () + System.out.println("****************************"); + System.out.println("*** 1-Continue Game ***"); + System.out.println("*** 2-Start Game ***"); + System.out.println("*** 3-Join Server ***"); + System.out.println("*** 4-Exit ***"); + System.out.println("****************************"); + + } + + public static void userMenu()//print option for user + { + System.out.println("****************************"); + System.out.println("*** 1-Go to ***"); + System.out.println("*** 2-Process Location ***"); + System.out.println("*** 3-Dashboard ***"); + System.out.println("*** 4-Life ***"); + System.out.println("*** 5-Exit ***"); + System.out.println("****************************"); + } + + public static void showUserMenu (User user) { + userMenu(); + String next = scanner.next(); + switch (next) { + case "1": { + System.out.println("** Enter location (1 or 2) **"); + System.out.println("** a. Location ID **"); + System.out.println("** b. Industry Title **"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.out.print("Enter Your Location ID : "); + String LocationId = scanner.next(); + //complete this part + } else if (nextGoTo.equals("b")) { + System.out.print("Enter Your Industry Title : "); + String IndustryTitle = scanner.next(); + //complete this part + } + } + case "2": { + System.out.println("** Show Detail (1 or 2) **"); + System.out.println("** a. Show where is character : Property detail {position , title,…} **"); + System.out.println("** b. Show options according to Industry and Property ownership **"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + //kia(level of user) + //complete this part + } else if (nextGoTo.equals("b")) { + //option of user industry + //complete this part + } + } + case "3": { + System.out.println("a. My Job"); + System.out.println("b. Properties"); + System.out.println("c. Economy"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.out.println("i. Find Job"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //find job + } + } else if (nextGoTo.equals("b")) { + System.out.println("i. Show Properties"); + System.out.println("ii. Sell"); + System.out.println("iii. Management"); + System.out.println("iv. Found Industry"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //show prprty + } else if (nextGoToOptions.equals("ii")) { + //sell + } else if (nextGoToOptions.equals("iii")) { + //management + } else if (nextGoToOptions.equals("iv")) { + //found indstry + } + } else if (nextGoTo.equals("c")) { + System.out.println("i. Show Incomes"); + System.out.println("ii. Show Job Detail"); + System.out.println("iii. How Can Grow Up"); + String nextGoToOptions = scanner.next(); + if (nextGoToOptions.equals("i")) { + //show incomes + } else if (nextGoToOptions.equals("ii")) { + //show job detail + } else if (nextGoToOptions.equals("iii")) { + //H C Grow Up + } + } + } + case ("4"): { + System.out.println("a. Life Detail"); + System.out.println("b. Sleep Function"); + System.out.println("c. Eat Function"); + System.out.println("d. Show (Food , Water , Sleep) Percent"); + } + case ("5"): { + System.out.println("a. Are You Sure?"); + String nextGoTo = scanner.next(); + if (nextGoTo.equals("a")) { + System.exit(0); + } + } + } + } + + public static User loginMenu() { + boolean b = true; + while (b) { + Scanner input = new Scanner(System.in); + System.out.print("** Enter your username : "); + String username = input.nextLine(); + System.out.print("** Enter your password: "); + String password = input.nextLine(); + User user = new User(username, password); + if (Database.loginGame(user) != null) { + return user; + } else { + System.out.println("1. logIn"); + System.out.println("2. signUp"); + System.out.println("3. back"); + String temp = input.nextLine(); + switch (temp) { + case "1" -> game.continueGame(loginMenu()); + case "2" -> game.startGame(registerMenu()); + case "3" -> b = false; + } + } + } + return null; + } + + private static void joinServer() { + System.out.print("Enter Server Ip Address :"); + String ip = scanner.next(); + System.out.print("Enter Server Port :"); + int port = scanner.nextInt(); + game.joinServer(ip, port); + } + + public static User registerMenu() { + boolean b = true; + while (b){ + Scanner input = new Scanner(System.in); + System.out.print("** Enter your username : "); + String username = input.nextLine(); + System.out.print("** Enter your password: "); + String password = input.nextLine(); + User user = new User(username, password); + if (Database.loginGame(user) != null) { + return user; + } else { + System.out.println("1. logIn"); + System.out.println("2. back"); + } + String next = input.nextLine(); + switch (next) { + case "1" -> loginMenu(); + case "2" -> b = false; + } + } + return null; + } + + public static void main(String[] args) { + showMenu(); + } +} diff --git a/src/main/java/org/example/defualtSystem/Bank.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Bank.java similarity index 98% rename from src/main/java/org/example/defualtSystem/Bank.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Bank.java index a1af07d..d0d2e44 100644 --- a/src/main/java/org/example/defualtSystem/Bank.java +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Bank.java @@ -23,7 +23,7 @@ public Bank(Property property,Character root) { } public BankAccount newAccount(String username,String password){ - BankAccount bankAccount = new BankAccount(username,password,0,new Date()); + BankAccount bankAccount = new BankAccount(username,password,10,new Date()); accounts.add(bankAccount); return bankAccount; } diff --git a/src/main/java/org/example/defualtSystem/BankTurnover.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/BankTurnover.java similarity index 100% rename from src/main/java/org/example/defualtSystem/BankTurnover.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/BankTurnover.java diff --git a/src/main/java/org/example/defualtSystem/FastFoodShop.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/FastFoodShop.java similarity index 100% rename from src/main/java/org/example/defualtSystem/FastFoodShop.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/FastFoodShop.java diff --git a/src/main/java/org/example/defualtSystem/Life.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Life.java similarity index 94% rename from src/main/java/org/example/defualtSystem/Life.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Life.java index 1c51df1..024e718 100644 --- a/src/main/java/org/example/defualtSystem/Life.java +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Life.java @@ -48,7 +48,7 @@ public void liquidConsumption(Liquid product){ } - public void startConsuming() { + public void startConsuming() { Thread thread = new Thread(() -> { while (true) { consumeFood(0.4f); @@ -89,4 +89,8 @@ private synchronized void consumeSleep(float amount) { System.out.println("Not enough sleep!"); } } + + public void setSleep(float sleep) { + this.sleep = sleep; + } } diff --git a/src/main/java/org/example/defualtSystem/Municipality.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Municipality.java similarity index 100% rename from src/main/java/org/example/defualtSystem/Municipality.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/Municipality.java diff --git a/src/main/java/org/example/defualtSystem/StockMarket.java b/LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/StockMarket.java similarity index 100% rename from src/main/java/org/example/defualtSystem/StockMarket.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/defualtSystem/StockMarket.java diff --git a/src/main/java/org/example/enumerations/Gender.java b/LightCity-AmirHosseinZh/src/main/java/org/example/enumerations/Gender.java similarity index 100% rename from src/main/java/org/example/enumerations/Gender.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/enumerations/Gender.java diff --git a/src/main/java/org/example/interfaces/BankInterface.java b/LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/BankInterface.java similarity index 100% rename from src/main/java/org/example/interfaces/BankInterface.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/BankInterface.java diff --git a/src/main/java/org/example/interfaces/CharacterInterface.java b/LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/CharacterInterface.java similarity index 100% rename from src/main/java/org/example/interfaces/CharacterInterface.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/CharacterInterface.java diff --git a/src/main/java/org/example/interfaces/CityInterface.java b/LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/CityInterface.java similarity index 100% rename from src/main/java/org/example/interfaces/CityInterface.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/CityInterface.java diff --git a/src/main/java/org/example/interfaces/GameInterface.java b/LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/GameInterface.java similarity index 100% rename from src/main/java/org/example/interfaces/GameInterface.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/GameInterface.java diff --git a/src/main/java/org/example/interfaces/MunicipalityInterface.java b/LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/MunicipalityInterface.java similarity index 100% rename from src/main/java/org/example/interfaces/MunicipalityInterface.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/interfaces/MunicipalityInterface.java diff --git a/src/main/java/org/example/models/BankAccount.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/BankAccount.java similarity index 100% rename from src/main/java/org/example/models/BankAccount.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/BankAccount.java diff --git a/src/main/java/org/example/models/Character.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Character.java similarity index 95% rename from src/main/java/org/example/models/Character.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Character.java index bb6a061..289c2b3 100644 --- a/src/main/java/org/example/models/Character.java +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Character.java @@ -73,4 +73,8 @@ public void setProperties(ArrayList properties) { public void positionProcessing() { } + + public Property getInPosition() { + return inPosition; + } } diff --git a/LightCity-AmirHosseinZh/src/main/java/org/example/models/City.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/City.java new file mode 100644 index 0000000..34b59b6 --- /dev/null +++ b/LightCity-AmirHosseinZh/src/main/java/org/example/models/City.java @@ -0,0 +1,245 @@ +package org.example.models; + +import org.example.Database; +import org.example.defualtSystem.Bank; +import org.example.defualtSystem.Life; +import org.example.defualtSystem.Municipality; +import org.example.defualtSystem.StockMarket; +import org.example.interfaces.CityInterface; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Scanner; + +public class City implements CityInterface { + private final ArrayList characters; + private final Bank bankSystem; + private final Municipality municipality; + + private final StockMarket stockMarket; + + private Character root; + + public City() { + characters = new ArrayList<>(); + municipality = new Municipality(); +// Get Bank Property from municipality + bankSystem = new Bank(new Property(new float[]{12, 32}, new float[]{42, 32}, root), root); + stockMarket = new StockMarket(); + stockMarket.startMarketSimulation(); + } + /** + * Begin Game function generate a new thread for each character , DO NOT CHANGE THIS FUNCTION STRUCTURE , + * + * */ + @Override + public void joinCharacter(User userinfo) { + try { + BankAccount newAccount = bankSystem.newAccount(userinfo.getUsername(), userinfo.getPassword()); + Database.createBankAccount(newAccount); + Character character = new Character(userinfo, newAccount, new Life(), null, null, null); + characters.add(character); + Database.saveCharacter(character); + beginGame(character); + } + catch (Exception e){ + System.out.println("user not found!"); + } + } + + private void beginGame(Character character) { + } + + @Override + public void getCityDetail() { + String players = Arrays.toString(characters.toArray()); + } + + + /** + * Begin Game function generate a new thread for each character , DO NOT CHANGE THIS FUNCTION STRUCTURE , + */ +// public void beginGame(Character character) { +//// using thread to save details for prevent from unsaved change due to system shutdown +// Thread savingLife = new Thread(() -> { +// while (true) { +// Database.updateCharacter("life", character); +// try { +// Thread.sleep(60000 * 2); // save each 2 minute +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } +// }); +// savingLife.start(); +// +// Thread thread = new Thread(() -> { +// try { +// Scanner scanner = new Scanner(System.in); +// System.out.println("panel menu"); +// System.out.println("1. go to place "); +// System.out.println("2. process location"); +// System.out.println("3. dashboard "); +// System.out.println("4. life "); +// System.out.println("5. exit "); +// System.out.println("**************************************"); +// System.out.println("enter your command : "); +// while (true) { +// switch (scanner.next()) { +// case "1" -> GoTo(character); +// case "2" -> Process_location(character); +// case "3" -> Dashboard(character); +// case "4" -> Life(character); +// case "5" -> { +// System.out.println("are you sure?[yes/no]"); +// if (scanner.next().equals("yes")) { +// System.exit(1); +// } else { +// beginGame(character); +// } +// } +// } +// } +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// }); +// thread.start(); +// } + public void Life(Character character) { + Scanner scanner = new Scanner(System.in); + System.out.println("life menu"); + System.out.println("* life detail [1] *"); + System.out.println("* sleep option [2] *"); + System.out.println("* eat option [3] *"); + System.out.println("* back [4] *"); + System.out.println("enter number: "); + switch (scanner.next()) { + case "1" -> Life_Detail(character); + case "2" -> Sleep(character); + case "3" -> Eat(character); + case "4" -> beginGame(character); + } + } +// public void GoTo(Character character) { +// System.out.println("***************************************"); +// System.out.println("**** go to place ****"); +// System.out.println("***************************************"); +// municipality.showProperties(character, Database.LoadProperties()); +// System.out.println("Tip: if you want travel by coordinate write in this order :(divide it by comma) X,Y"); +// +// Scanner MyPlace = new Scanner(System.in); +// String place = MyPlace.nextLine(); +// String placeX = "", placeY = ""; +// float locationX = 0.0f, locationY = 0.0f; +// System.out.println(place); +// if (place.contains(",")) { +// String[] placeXY = place.split(","); +// placeX = placeXY[0]; +// placeY = placeXY[1]; +// +// locationX = Float.parseFloat(placeX); +// locationY = Float.parseFloat(placeY); +// } +// +// Property location = null; +// boolean isWrongData = false; +// for (Property property : Database.LoadProperties()) { +// if (property.getIndustryTitle().equals(place)) { +// location = property; +// isWrongData = true; +// } else if (String.valueOf(property.getId()).equals(place)) { +// isWrongData = true; +// location = property; +// } else if (locationX == property.getCoordinate()[0] && locationY == property.getCoordinate()[1]) { +// isWrongData = true; +// location = property; +// } +// +// } +// if (!isWrongData) { +// System.out.println("You Enter details wrongly !"); +// System.out.println("please enter again..."); +// GoTo(character); +// } +// character.gotToLocation(location); +// character.positionProcessing(); +// +// } + public void Life_Detail(Character character) { + Scanner lifeDetails = new Scanner(System.in); + System.out.println("* you can manage and check your life status : *"); + System.out.println("* food : " + character.getLife().getFood() + " *"); + System.out.println("* water : " + character.getLife().getWater() + " *"); + System.out.println("* sleep : " + character.getLife().getSleep() + " *"); + System.out.println("*************"); + System.out.println("* take a nap [1] *"); + System.out.println("* eat or drink [2] *"); + System.out.println("* back [3] *"); + System.out.println("enter your command:"); + switch (lifeDetails.next()) { + case "1" -> Sleep(character); + case "2" -> Eat(character); + case "3" -> Life(character); + } + } + + public void Sleep(Character character) { + Scanner sleep = new Scanner(System.in); + System.out.println("* we have some plan for you *"); + System.out.println("* sleep : " + character.getLife().getSleep() + " *"); + System.out.println("* +10 for 1$ [1] *"); + System.out.println("* +20 for 2$ [2] *"); + System.out.println("* +30 for 2.5$ [3] *"); + System.out.println("* cancel and back [4] *"); + System.out.println("enter your command:"); + switch (sleep.next()) { + case "1" -> sleepCharge(character, 10, 1); + case "2" -> sleepCharge(character, 20, 2); + case "3" -> sleepCharge(character, 30, 2.5f); + case "4" -> Life_Detail(character); + } + System.out.println("************"); + System.out.println("what do you want?"); + System.out.println("* charge again [1] *"); + System.out.println("* back [2] *"); + switch (sleep.next()) { + case "1" -> Sleep(character); + case "2" -> Life_Detail(character); + } + } + + private void sleepCharge(Character character, float moreSleep, float price) { + BankAccount account = character.getAccount(); + account.withdraw(character, price); + + float lastSleep = character.getLife().getSleep(); + float nowSleep = lastSleep + moreSleep; + if (nowSleep >= 100) { + nowSleep = 100.0f; + } + + Life temp = character.getLife(); + temp.setSleep(nowSleep); + + Database.updateCharacter("life", character); + + System.out.println("your new sleep status is :" + temp.getSleep()); + } + + public void Eat(Character character) { + Scanner foodScan = new Scanner(System.in); + System.out.println("you can consume product to gain water or food"); + System.out.println("* travel and shop [1] *"); + System.out.println("* cancel and back [2] *"); + + switch (foodScan.next()) { + case "1" -> GoTo(character); + case "2" -> Life_Detail(character); + } + } + + private void GoTo(Character character) { + } +} diff --git a/src/main/java/org/example/models/Employee.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Employee.java similarity index 100% rename from src/main/java/org/example/models/Employee.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Employee.java diff --git a/src/main/java/org/example/models/Food.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Food.java similarity index 100% rename from src/main/java/org/example/models/Food.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Food.java diff --git a/src/main/java/org/example/models/Industry.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Industry.java similarity index 100% rename from src/main/java/org/example/models/Industry.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Industry.java diff --git a/src/main/java/org/example/models/Job.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Job.java similarity index 100% rename from src/main/java/org/example/models/Job.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Job.java diff --git a/src/main/java/org/example/models/Liquid.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Liquid.java similarity index 100% rename from src/main/java/org/example/models/Liquid.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Liquid.java diff --git a/src/main/java/org/example/models/Manager.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Manager.java similarity index 100% rename from src/main/java/org/example/models/Manager.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Manager.java diff --git a/src/main/java/org/example/models/Property.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/Property.java similarity index 100% rename from src/main/java/org/example/models/Property.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/Property.java diff --git a/src/main/java/org/example/models/User.java b/LightCity-AmirHosseinZh/src/main/java/org/example/models/User.java similarity index 100% rename from src/main/java/org/example/models/User.java rename to LightCity-AmirHosseinZh/src/main/java/org/example/models/User.java diff --git a/LightCity-AmirHosseinZh/src/main/main.iml b/LightCity-AmirHosseinZh/src/main/main.iml new file mode 100644 index 0000000..908ad4f --- /dev/null +++ b/LightCity-AmirHosseinZh/src/main/main.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/org/example/AppTest.java b/LightCity-AmirHosseinZh/src/test/java/org/example/AppTest.java similarity index 100% rename from src/test/java/org/example/AppTest.java rename to LightCity-AmirHosseinZh/src/test/java/org/example/AppTest.java diff --git a/LightCity-AmirHosseinZh/src/test/test.iml b/LightCity-AmirHosseinZh/src/test/test.iml new file mode 100644 index 0000000..a0e49a3 --- /dev/null +++ b/LightCity-AmirHosseinZh/src/test/test.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/App.class b/LightCity-AmirHosseinZh/target/classes/org/example/App.class new file mode 100644 index 0000000000000000000000000000000000000000..203b193f0fe5f2adf5fe206384c80b00a610f80a GIT binary patch literal 537 zcmZvZ$w~u35QhKGHjAU#Ox!i`lz4EC9wLee;$cuB5)Ym_Ni%ksnI0w+(Z|w*f(IYK zhZ3t3At>oXHC2E8U-k0!{qYIl6#F(Z$QsBw$fLke8u3T&20ZfJ>;6a#Qij5@jAVMk zkZrYl7ED+MYzIql{`h zQ9{{3#X%LT4AliL1|!ytAR=sQ#+@FJpfd71?Vf=;Ls2EZE1q~52f{szV}{(h8VV9T z8HuY&*cZty?*~+=cxu3d9#5pse~Y>FL5>;9-ak%!^xIQhqs*n9(Vjne2YZ>y>lC#N7}%ib%o?zXEy^rx nV}~l*d^Cko?G;94`3=Q6K>su7(@e6@Ar^MAM|Fk<#SEH1VV-Y1 literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/Database.class b/LightCity-AmirHosseinZh/target/classes/org/example/Database.class new file mode 100644 index 0000000000000000000000000000000000000000..761ed12c3de48faa5725e94045e450cc1d924f5a GIT binary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GQg)pL`0O&X=Htn6noY8e)WB|`aU481pz#oL;wH) literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/Game.class b/LightCity-AmirHosseinZh/target/classes/org/example/Game.class new file mode 100644 index 0000000000000000000000000000000000000000..ed946e168b92f6ded0268bce301cd716dd1376c8 GIT binary patch literal 962 zcmaJ=O>Yx15PjaH4cTs*wm_iJmX;RC2V&t$5IsZ!MM{fAN+gcX)}#)}Zsa%xeijn6 z5=b05@S_kjPH0x*md zS%JkTI@b27K&D*j#Z~_bwr)dxDwzhN&)8p3`G-BHlT5X(jNTr|(TqJmw$j)s+-JjWWlou- zRBp|i)wV{*y?V3K5%Bbg)%=kpU!%lOM@3V>ZzmHIsb`vP<(d8g1F%EQ@IXDL&*PrZ zHCdoB-42TDGz;l3c(r;C@sS1|ZcyYj2z--bFx`L+Y|>0%3nhvSe#zI3{)O6iEPX}p z^*QnfOp~C+{9DAo`(J)R`MsI!eRmdFnNv;u-ggw+PBvXY=a(Jd!Ci_xx`#3;68st{at$8S gZq5bOSphzyIOpXD2|T1qK1$UxxTs}?vL33x0F45#7ytkO literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/Menu.class b/LightCity-AmirHosseinZh/target/classes/org/example/Menu.class new file mode 100644 index 0000000000000000000000000000000000000000..3d37b48b05775d0b93d5a13157901c98b35ff53b GIT binary patch literal 5548 zcmb_gX<$^<75?sIl6f;c5(p9q>r)Yuki~?6m_R5(5`&2XVG%^}W%5iOOy-R<6Ck2> zYqjqCf?93s66=aU1BzSKT5GkdcCodswzZ{pv;C!|((kwWS0}l-+qq}`?m2hz z`lru44`31g9YFwjAp~{gqd;NICUc8f6EovIHD`2fvZ85)f(3TmPB$s!m6flFKtni$ zh>lS%xs&Xvv9_6giI`Q>Va59uv_8|0%P>sR(K-rIq!3C)&3N2ODvWD)CG@B5SWTz5 z*cicB6o)WQ$1xbMF!nPP3cj5HSA0$?RZb4h6xI)HiA-23SqL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R2~7*Og9mT~UZmM1Q0H^@!NojR)8M^KP7jML zNzYU!u(XKs<8dYz0%Bj2xDGtcV2#x*ok!F$Kcr(N;Psf8@bsgc zRbmeH!}~B?#J+$%NQ*2~y-0gp`8V!My+mv?rNJc|JX}`!$H;tZpanE|FSB}A)_~{V zK=|$tSo&&xF99pOT@GlF$;%5$k(FI`=lMyi(5?7{$7RC(Iq^HNoQFQAGT$#A= z0A9e`7;6v}BktUE_p5sKs`_=mygfYwIKXNgF@_DPnwGfX?T#m`hPVv5r>osSi?(I+ zK-*F_sx8?u_U>Oz6QdZ5Bc4J6NrvUY(za{}FR%{%Mi^+-WfU`Pz8IlM&gI%;_*?5f!PcbMd=5c`?|)xP#F8S zw|5Nb(ow}ZJ}Z^ZKdF`fog*5JKN*tsPx~0whH<~`WiYEURCQsyQRmFy zC)kaqz&dC!`av-)!NfSBR1ZxMo*cjTnOiW{jP?Vp=9O*=-c`WqUCKjn<)Mc6CF|51;noGiV literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Life.class b/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Life.class new file mode 100644 index 0000000000000000000000000000000000000000..f0673a6d540a2c545ba24805d54264ea413ee54f GIT binary patch literal 3113 zcma)8YjYD-7=E@*vT3@cO?rpYJCFt?Xc5q2(N+S*&;qH&7B6g*ZM!tt4ao+m_q+H5 z{J{7F_~wib6bEPg>^S%z{OI^2#OIt{lMQ4PI_&PbywCGqp7)&m_VsML`Ay>4Z9Q!+2xIt zaZ@jr3Pvh#tXK7dlijX3MlqE!*9`@Mb=%G>P}0J%Lqn&q3f|Biqbz3P8oK06rC=DP z2xodU^a^jH6-O^SbGB8f7ENoT4gDBUv0K9)3@YgJ^A_#AQK+QSlBtbBm<4^UKyqa@ zLbD+a!x&Kz-Y}d?f>?%=7E5Cq#>JA#C1Ku%eS&4bf`KLk8S`4z%tyEARxL|}G95t@&xtxc&)5^q zc1$jdJx4UWAhH*f*=xfw99Qw8hLY3 z(J)RoPD@pc24)^U{9S0{tcKT-QP7@~vM}6=2NG$D^JK=|v#8;`*rR!SWW@s~r>3R^ zLRQ0)e>E#)7i5+A@2@K&gKr8&u28s%vy;mzE>q+6ddyptPq|uhjQpvaIiuv5wiUrD z-q!GrNPCBjJL~AVt);S_6Z)T{IJuB9En}ftTrV1=VYuP z`=Ehns40=#8j@;HGXig&(KxbQ6vTbfc3X(L4e3R@YSGJZ#c;e>`wDt-Ew4{Vox843 zS`&xa^i21N52jho2pY-S)pE{Ao8q8o6Nl9yQD-WC*0!CBQ`Sr83}@5MS2{x2j^I7K zui^s@AL1hgV|7WG)^&T!NM)ouw9wb}oMV@_snVi<^w8f3o{>v%Mz`_>qcV}P?X7BQ z+UL60FTR-u!=>$#;otuBi!SAV+xpKT4|z^66tbpcOm`yG5yYpWqdwD67Sh+|Ez2m+ z74%BQsHpf-!M-Pw)GS^VUpKT^Ll9nSC;>M)7$sv1d$pBMUO@b65m$D`wwN#&4s`kavTZx zya(?PKESzt2|q5-C+;Dd+;s(Q8BL*zQ_ zUQTQixy8;B_D50aMRmsFuT!>{6w(MVyOX z2)8_}@nrnW4(5~bb30f_#xLyPVmIFS3776X`cr7*tviqYph=vqzK1_6T-}c$Ov0lC zJH|udI9I2+KEoX+Fo>7gkTW$$23fWW9AbcngnM9#VybjtRh5uc4qI>?H~7}L@g`|L T#wYy$IcFlA`2t_z76$$SV$_0! literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Municipality.class b/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/Municipality.class new file mode 100644 index 0000000000000000000000000000000000000000..4a4b5154200cf0b928f5064fdfb80312b10d6719 GIT binary patch literal 925 zcmah{OK;Oa5dOvq&9iA6NO=@!dO=C4@C8n(iVzYKl6go$xo^^Ky4A*x)@#83ie8Gu zfgiw+Ld?2O<5WdGc*Z;a9^={h^Y_=B{V>yPTFqE5~1xdjjf#dACgc_)Ldv~Q$l+x zLurJSpG`EE#wrnu8!I`;F%(!mi+l;3iZuo0+GeoSU#X}*ZD=1Mz=CPI&dQSO`< z%l1^ogx-qm|EIzFjd7AL3<Pl{*%Vbr z#ra-%%EKrz6ZuZLKi(={Yf!&-v`W(Ne&D0y{2=yb>9aa32qH z;sIxe^XP|*aMqX1PJ!uNF(2Yl&U}^OZ?N3Sh}$gYdb+f9Z##I*k>`DT*WH5mLW1x# HbKLz0u4l!E literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/StockMarket.class b/LightCity-AmirHosseinZh/target/classes/org/example/defualtSystem/StockMarket.class new file mode 100644 index 0000000000000000000000000000000000000000..a59b2decf05b413e04ffc5ec0c7d0de052ef8fd5 GIT binary patch literal 3030 zcma)8YjYD-7=E_7Y)F@+londRQlLOuE&(h84T92uEtDdpQv?w`O_p{^vKu$MK)s@f z;@yursKgc*LP?&N2?D#{R@gFz}K4*8EZlL1;Lpb}M_wu~Y`<%1;`-6MG0yv1T zl4wChMN~r!aRqG`#U+ug2y;4nV(Ow^bQHw*8>ZnLP!P%VPpU{LSmrsoj#0^ui2BTN zQAcKsaUEZg|vc=mOY)-uZU``qGwC`1y@v@!ff5qtJ#8M70btkUDlaD=GJw) zt{^?Okd`TPtyqS370Werpi{xprdT z7TdI#-{YYwRyT2xx7?|Up2R9VrJ)CFS-#|%CPl^7J!h zPc)FG8mC;-6zn{gLGn($udwJ~Q!yKioa}*Y%#e@q^#_3pvAs8lJ=Rlww(*Eyyu0%LGh#X=x&( z!^o>Rtl&@rDotV0!rc@{i#!Lbcrg{PvlQY+i49i;f$oMqU$xL%N&(w z?PUc$9u6;V)Ff8htvPz>@Rg!oa}3K&;w)a#a9(nrt}(Aua73{@VT&SVxujrBo5FEz zu6O%t@(APc+8+{^4=5M11TsC4Ba~sQ#PIZ(Vd~>S`mmAz&A@X}ED%XcjQf0a)ycnxu``2y#!pyd!ETmfwZ zcc2X1hkE7?mi&U`kDm7we^c}Tl87>68XAgx()<{dpz~=RE?_#y_dPSmY0D4%jO3O% zw6)+H3 zL_1#!%XyJ^dUytiZY^yyFt}p%0GV7}MA<`|M}@mBsB%AwmcbNpo3H}hI(H;ryRF?I7jzuLpG!q3sD-WybxHOX@iOV%1CZxDtAyE9yJvl&&E6ujOL#0iE;B9`Ar=FGr7 z3;=hqeQe8Z?0i%c1JuT|Wc@&>_vJyA6p`7eL!kgDd!J?H99Kyuzi}Uf6xuT~?Vb({ zl{>J1+Us-<{Cu3lAq7Lx?&usw6zXSGuErIL=hRS4^3ffe!-AONUHqFV7xyK)5~;7h zMLe}H;d^x@8ob?n_)`Za?qc#Lk}~yeoV)q(8gaRJ6Yucd=udTsJ@I=833Azq?Z}bO zaqPfp@^>D)cxDFK*KS7bVcZZS_u?wQO|H{Zo{SNG-j1V>`v!YGO_*B51+eMCG5+cWL_&AMxKOv?Q7JQ+$pu(fuEz#@NIF literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/enumerations/Gender.class b/LightCity-AmirHosseinZh/target/classes/org/example/enumerations/Gender.class new file mode 100644 index 0000000000000000000000000000000000000000..2c4d7de375dba9d49090b2309ee36fc97e4dd383 GIT binary patch literal 1055 zcmah{-%ry}6#nkoty?K<%n344+?cu!q0S#qn}{J`Or|_kmk^)s#&wo-t?4@ApQR%a zqS5f|A7wnZR4L(MYqFDb?)RPZogcsdeE$XDIUZ?9F|7E(z!IPN@RKVn;f;qP;GyGt zBkQH`4n&XxgK8j+4B6M*6%3Wm6i!Q$vIcUJl-U(SqRG&V0RyuPTCMw{^KQpxsJ@?? zOGh3B4YLO3QDjK>UEd=SrMlTU@aY=K`U87CW!Kv4cx>s_0@JfC){LMNT!OJugq>1X`Om5 zXOWY(VxWpu*?Xj6#89i7)4QiS|M2Rze?X1rJB}ybjE6lDyyZQ)k4wG$mp*Mr48@M$ z=Wdq=j?5D$Q$0SUoW-ltp#6s*9TJ|ioq@;0aX>hwZgy$c?YJdZOH9yHEDJwx>sduNgg3UmhK8Dl;tteOPc%|Rta~Pyee7w(Q` z0IjjMe1fH~(Q~rg1zp3Ml#T}xX1$=xn}~&&P$>$`r+l`G uoL^d$oa&aDlgh{-j%lPG$TT)a2B3PNlNcBnfi|!*uz^?%>_C!MlezL<;_QW3-8Z+GG+Lk1Uh U%0S>WS_t8FBD5W0=y;C!1Mn+2i~s-t literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/interfaces/GameInterface.class b/LightCity-AmirHosseinZh/target/classes/org/example/interfaces/GameInterface.class new file mode 100644 index 0000000000000000000000000000000000000000..e98919e270abe211f7876f0f60e7168945f2fff6 GIT binary patch literal 282 zcmY*Uu}%U(5PgHl$%#rVs3a3KI;{tmX*%9R!_R(=@CX~6Z(bTXjN*PtCvN= znJ4rzXT7m&ZrFrjGW)Amxh0pin%6AjyH`TD_FDW8H7=a7Da(e1Fi2)6?bM60`FPq~ z+~jOowC87je=vSaI7^y+oVvAS{AkMX_4c3D`$nll2-J`gXb0!#=!Ag~{q_rV4>-nU LV1yW!r0io;BR?KGz%4{Y{l;_nT0!Rz$5v86 literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/BankAccount.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/BankAccount.class new file mode 100644 index 0000000000000000000000000000000000000000..b3b7de9b99b582a9122655928db041d6d5d8df04 GIT binary patch literal 2794 zcma)8ZF3V<6n<`Ax@}l21WGMni6wV>9V*G;!@TeH?~)oOOzqKkxSuebu~O4obUa|~;xC_U{{v0u7L+8dVcNXY>e z2c=}NrMd2g?bN04kcv^fPPL|O>CXg2SxOJ9ID(@BDN}R3(kg-Lj3PLw?HOj_j^^pb z6vlB(K}N-!m=HMH2QY0Nt>)>Dz@8P|d*JHMtktjuj^w5)ee|UQ{bn(#;Dm~k$O(+@ zqStk4X-(ogNS8aPNFk3?3Z_+@#+jZ>1Y9u_`qQ>%lE{%<#5~ATaq7_!&f=Vc^D5rL zg>6}>>kXQE)n~4!H~r+0U9as}_PUHX*AwAR<%Lj_0l$q)3NEX-f~x{2q5kRQ`cLzYj~N-MkbZQb=**JQ^hUZ78veQRW@yn^`xw8 zW?P?cNG8isD*f*Sna3R!Gbod@hV3+^&6Ox;Vf8)kLt{h~YNgpJcU8>dJ!ZJ6t?4D( zs%hRs!&~Lf^)$<4PA>QHztdL~Z0P>~nwA4^-J+gaWM`GwZltJUSo*zob6Iy5v}Kc$ zbj7Y|=Az~p@;wwLyj6oxGdH!>>GM^x!R$Zl6ho;$d~9Mm0cLtvt}gu|dZOK3R*u#TZm+#nPphrXX|0e&C9GB6h`iT$^;GS)Q`5_a+bLXR#PzWM8TS@D^nobt#QLzx7YMSKyOfLWnN6S!#nTWXpx1Afz!L1 zRX24vTe0o6cB{Cv@*b_eQX?<+(~p2aYjxt#QmK_n1H|s$nhz06}U?MWd0Wnzu+bY zdH8@Y9Q6-T1BLJqfe%roL>gbGwmf3M52Xt|py~+09rZmN3bZ;f2SS(v3w?p4w*xuW z7s!MDK+@ZR94C{j_V!E&KBRmd`d+3Z* zLO|zPMsaSJC}dt`6d&W0(AQVYxXk(aQ(Jgr3&&-8w=ne_6IpIYzWENLKckS1ZQ){m ziGpl{C7Adj&Ochk{UQh|@B)){5r;X4CvXYVxQsKn%E^Dt$C3$7>7@2NKE-Fmz?1Pg z>n;Y3`vhYAg(0xq!S{mEB=}_}yXWigaWh>^{)X66JVaYvN@QQ+o$5=J?n!t82cLqY-URU literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Character.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Character.class new file mode 100644 index 0000000000000000000000000000000000000000..ff19ca41be22dc377cdbef43ea23254a868aa35c GIT binary patch literal 2949 zcmd5;-%}e^6#i~VHiaa#piokvAf+`4v}qOlLnxJEQQBCUq4K_jC0!bJGnc{?p)9%(c z-`auQ44pvXO0Vk#+uotCP;MBYKk#@}OpX?D71tEyyNw8;)y9k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wv?;LQS*IL3S;p5JO zG5?OCk{eET*k^tCLNV+#Kv2l7Bwvc8wgX*6-CCqw`Zl<$<%-f-R;%1? z5%Me12Kn_iv|LHLB#!t=zax_sukF`F(U$S1`urP`m3kviPYCpUBJxepEFybaS?Wb) zsr!_rh9(;aH7N2lnzZ^%{!y~?=1(wlwFBK;=^$mUbueLS9i+_+jhXLCV3o!>=rkJ8 zkU|2N=x>Z($~av$L1&X#qtkm`NvvaoRwS;_n3_ol2|TYbN7PILY6N8ARu9V}EB&M9 z59r@$5`nxtrZ&^+5~J(TyM*C3?$C~mX^Xt&6)_dhIlBC@0Wt)aRSMHxuQSY850l|8 zh0xUsf~3CE=RuI!P>}n0Fa)wpIUNL9B#@;GKx7GJ1|H&32uS+N0LV%x$YVSi0-2$b z4ua$f#Jm7R_K*ZAsNBo!zEq_GvQ(N3{ZE`?mQ4B+4XMLZEWaJpU#FaJ1PHTdHQQ8i GJpBh@Cm#s_ literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Food.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Food.class new file mode 100644 index 0000000000000000000000000000000000000000..bbbdaa92d36cd5b224e5281187c45a594af35919 GIT binary patch literal 862 zcmZ{i-EPxB5QWbswo|80(wej-0a|`qNQ{IZ08}oJd=`4o(i=R z5fT?X01t&YV_OBKL6&xQXJ^iQGwWZ!fBXdS8qeyepjw0Bz=Wl+bsk=XejLsw{=3n+ z9%l;Ht7sNw#|qV6e`sR^b`5n0n{X8Nl62zhFX8lato>Pjb@XVtlPWo4TAoV z>TgJ)&>BQD{dO@O>GZUKa0kgajE7+w$+>hI*{5i(&>8%v50=`P=~OQ=NTy>ysQF;J+{Q4Fenk}T4(4kBsR7T*hL7>_uM3g5`!%7Jj_%BXV7InpY5 z16q?i6L-0Gcv>*tpzV0yp*&-Wns>NF!#i4H+k3u5`(h3jR zZ^3`eXc4wnVC6>z0Zh(9;C73s8#t?kQ+SLgrPjY7+h12ex@$oW*CsbsllRvqALS*U F{sGoFf@1&x literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Industry.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Industry.class new file mode 100644 index 0000000000000000000000000000000000000000..3e704c59c1129fffa8f762aac54e6d5bfc71c29e GIT binary patch literal 3202 zcmai0*>=-b6y3^TgQE<@B!SQ{gaEb!7#fCx(=ddjgc=fX>NZWM8(VQiY{|$nC7q!2 z+^^_bymhr}mC(Xk{eZSV(Z~Ko>AsR|%b>u6rR#gou+KUBoU1?od+-ND|Q53*dlHADrk+xvzxIMePQ&g7{In*>@!BbTCpvOU1Lnc3ZcLnu1a^XX~bsoHUI}wZu|(;1o`Wky0^^7YVPC^d{p9!po*LC2}hY zc6%W>5T3Lc&$csbz>k03kwKkPaUPR0sG_EoB_}UQ`b;U<*~s>cL0VbWvaRK(Zb{(8 z7{LX+q~fB?NOzfKwKKNJtyzBZ_QR}BBkJ}zk*D?Johc*^&{7Y<8_p){T+^~gFHqkMcL!e1_qBftsOAC)-+*;>2?ddiS+#Q7v@Yq}S)=1&+3Osz=S|b* zU=iiZn!RG?E8QWy8^JAb{=TQ;eSDx`xG@%V!6{`Qm1 zQ*s?#6h@v`;YivvSF7ceFITnBeZrfoIM2HJ#ha`?_0Vib_SRgz+_R z^bJC6&P^EKHjU(_fIU$%)lDS!&}j>Yd@G;4jJax&w=Lgo@}lQWbj8`5MTBb=b9`Rq z&JR47*F!9Ea2*PN;Y0TkNjyZ?!hQ7ILo_jZ58D$1ZTB#gSjV1U94puO97KrEC^~6z z8@&&qj~97A4$xnQC&yg7n8z#pM-L7z#aU(Xs)II$*RVj$@>HU2BdXW2=wVCpE#=!2 zzhe8(T(m$s4mq2HjuX`t@SG@k18;Ii1~x%ynUIhZKm)e?#sYQ{+%CsLzbjRT8S-E% zcnfcPw){YbexkY`$Z#N#cOaesvX?o09LRnGIj{i`nGuTs?S2r_B0y?q*pn^lB6>7M7521ir+IGF@T=7eePYHF_p&|+L z5F-nT2iOnXME5DxUSZjd}&?BAn}3h0@a^ThB9o+Y4cs%!sbz z$OEzszvG1#@^IoeoW1+#U+HQ3?xTOGv4xBrv7>3^ig#s2fHilEDZVpYU(f)v$d12CIhUmo>?h7>7rL?9Lqkqb1A~Es8 zAK;HNzF%7hf$rv8RvyXvi&!UMJ%Ii+K`%xtJ)J=C+5kUFr`Nv^PXh*ctet z_iiy8dGVDy$}pm_8w}mpmvdg!k`Mk|;c!sg#F;{E>LpiMBOSB9{U#Oj8^u8Zr$E(d za*?;m2pv{<>3>Bt9T7EC(W>cYDp{Qym(d~~dyX&N)EMzg$rUFIt;9i=xpE-E z&Lp|(;4skPdcae_-!<+X>nD`;d4zN^wNd0A*WGDR{e+{c6bWt+RGD%KC^-}q7DGe9*hc2a926XezkM|jAJ zV4qVh#?=&g1uB1DP+uX8z;!d#4O}&cQ+R~Oxz{>K^D8f{gB%rt95d%lkWXBuM`j5E+et^wQR!{sVa8mvjIC literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Liquid.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Liquid.class new file mode 100644 index 0000000000000000000000000000000000000000..a823d5eb2c88410b1ed11063fda060784a000975 GIT binary patch literal 464 zcmZ`$O;5r=5Pefhp`}o)-*PfuqzC&0G!0oC~#7`6Z!t z+8?=S!fn9w(SlDnOtV=mU&P{3%XpDarC!B}dRnU~!DS|;#aK%M-J8OWj{sd})D?sV z1p9Q*AMtU`)r25XOL?5qcytW#TGn=MQQ{=q3O5KW70mng5Al?cB?| zP1o5(4wTWm(J$_#PC@_x literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Manager.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Manager.class new file mode 100644 index 0000000000000000000000000000000000000000..58cd2d3f3ce66f1903098056b8302395396d609e GIT binary patch literal 565 zcmZuu%TB{E5FEE@Q_@1Ayk8O=ka&q)xCMa#Q3)w<3F;ZAwSpmWkdq+#S)7nK@Bw@j zViO`jB0ktVJGE}*IDEXeZ&2bGCemQ@^HYl%yF4C(mR7qs8IRm ziFjFBU|6qG`f|Hn1@090-+ifzW_@9kFx*( literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/Property.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/Property.class new file mode 100644 index 0000000000000000000000000000000000000000..568c22ee5aeee5015a27b9bf08f156380e149587 GIT binary patch literal 1085 zcmaKq%Wl(95QhKbI9Hq|v>^r3(w1J7n2R3(R2Gr4iYQW1Hd#6DQR>QxE5|MHRv-}} zvETuCD8xUG+eVRFSvr^T%s=1EoWK8m{{ip;M->>z6=7P)qo7c~aIak_aHnJEWOSju zSfTLVpZf8!LayBzlu<&th>C?ruoPNhG`HwR#lr$#eA_sP1QrF&Bolb6RjK27T~+nr&L zrrDh-Pd3S2qT9)$p51mQOLMuR5*1SKz4pV-B3`9<_qK<;Gkp18ISsEOPxpK&wt55q zR%VMmcHH3Xb6hz?o(!2vvU3dFi{LEK;QEBOfd5VI4f_|A{c4V){d$h7{br8(k0h$e zwaExj*+iLN1#8sapz0>A_97ln@r*YrC3#hHlFUNWkS9PUh39CcnH}!pmA8MQ_?-uX zX@EjvtR>Rc!XcGb*upj~f_+SH5iTUiccAj#!BkS9z%>_Mw{V3Nj?WM~sn#+`eHCOg z6J(ct&H!2J*aD|7x literal 0 HcmV?d00001 diff --git a/LightCity-AmirHosseinZh/target/classes/org/example/models/User.class b/LightCity-AmirHosseinZh/target/classes/org/example/models/User.class new file mode 100644 index 0000000000000000000000000000000000000000..4f637d4538141c764574bf76b38f04a742879006 GIT binary patch literal 1002 zcmZ{i&2G~`6otv|Q(h4tF7L^4OtB4;JBC&MRQE-*mmF)nJ1rjY1 z3m$-nLY!-x7*SW2=FT|BXTE!Ge*OOO6TmYZ)=@&)gkfV16@~Q+_oM5~U4Q1hnq25< ztWbIC`CfdgQ0@=LHB?bEQMX~iR@e%{nWI0ui_5uo7QwlmN6x!QhYHmti|;P9LVJ{( zp2eZ(&rZaqX`>|`)k`;uJ_X@rUngN-%ZjV>k5VoV_&S4_>6u8{N{(iNd1-fFdM<&vcxFZ1x8? zWvM9d&WOC3uTVb=mf=*t@C39b9*-qA?6b`hhgIUk(32g5V>O{H<({2DnU4<4Pc{?kt5DNKBZdvsU&o=n1=%LZ&MhF4h$OJL3jPgYC3tIie2w+t k(KR;n&YH characters; - private final Bank bankSystem; - private final Municipality municipality; - - private final StockMarket stockMarket; - - private Character root; - - public City() { - characters = new ArrayList<>(); - municipality = new Municipality(); -// Get Bank Property from municipality - bankSystem = new Bank(new Property(new float[]{12, 32}, new float[]{42, 32}, root), root); - stockMarket = new StockMarket(); - stockMarket.startMarketSimulation(); - } - - @Override - public void joinCharacter(User userinfo) { - BankAccount newAccount = bankSystem.newAccount(userinfo.getUsername(), userinfo.getPassword()); - Character character = new Character(userinfo, newAccount, new Life(), null, null, null); - characters.add(character); - beginGame(character); - } - - @Override - public void getCityDetail() { - String players = Arrays.toString(characters.toArray()); - } - - - /** - * Begin Game function generate a new thread for each character , DO NOT CHANGE THIS FUNCTION STRUCTURE , - * - * */ - private void beginGame(Character character) { - Thread thread = new Thread(() -> { - try { - Scanner scanner = new Scanner(System.in); - while (true) { - System.out.println("Show Menu"); - switch (scanner.next()) { - case "2"-> System.out.println("Do Something"); - case "3"-> System.out.println("Do Something"); - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - thread.start(); - } -}