Select Git revision
iterative_methods.o
Main.java 2.29 KiB
package Core;
import java.util.ArrayList;
import Cli.Clui;
import Cli.errorWrongFormatValue;
import Cli.errorWrongNumberOfParams;
import Exception.ExceptionUnknownDishType;
import Exception.ExceptionUnknownMealType;
import Exception.ExceptionUnknownStartegyType;
import Item.Dish;
import Others.Adress;
import User.User;
import User.Customer;
import User.Manager;
import User.Restaurant;
public class Main {
public Main() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) throws ExceptionUnknownStartegyType, errorWrongNumberOfParams, errorWrongFormatValue, ExceptionUnknownDishType, ExceptionUnknownMealType {
// TODO Auto-generated method stub
MyFoodora foodora = new MyFoodora();
ActiveUserContext activeUser = new ActiveUserContext(foodora);
foodora.setMarkupPercentage(0.05);
foodora.setServiceFee(3.0);
Clui clui = new Clui(foodora,activeUser);
Manager manager = new Manager(0674, "jacques", "jacquo", "jacques.martin@hotmail.fr", "123456789", new Adress(15.0, 10.0), true, "25/15/1955", "jacquo");
foodora.addManager(manager);
foodora.addUser(manager);
manager.addUser(0245, "La tanire", "Lataniere", "contact@lataniere.fr", "1234", new Adress(10.0, 15.0), true,"", "", foodora,User.RESTAURANT,"Moral");
manager.addUser(045, "henry", "henry", "henry.dupont@hotmail.fr", "124578", new Adress(11.0, 15.2), true, "25/12/1994", "henrynou", foodora, User.CUSTOMER, "Human");
Restaurant resto1 = (Restaurant) foodora.getUserByName("Lataniere", "La tanire");
Customer custo1 = (Customer) foodora.getUserByName("henry", "henry");
resto1.addDish("MainDish", "pat", "glutenFree", 4.5);
resto1.createMeal("MyMeal", "HalfMeal");
resto1.getMealByName("MyMeal").addDish(resto1.getDishByName("pat"));
custo1.createOrder("myOrder",resto1);
custo1.getOrderByName("myOrder").add(resto1.getDishByName("pat"));
custo1.getOrderByName("myOrder").add(resto1.getMealByName("MyMeal"));
clui.executeCommand("login jacquo 123456789");
clui.executeCommand("registerRestaurant 0123456789 resto resto mail password 0.01,0.02");
clui.executeCommand("registerCustomer 0123456789 custo custo mail password 0.01,0.02 22/03/1995");
clui.executeCommand("registerCourier 0123456789 resto1 resto1 mail password 0.01,0.02 22/03/1995");
clui.launchClui();
}
}