Skip to content

Instantly share code, notes, and snippets.

@aukrocz
Created October 23, 2020 10:07
Show Gist options
  • Save aukrocz/861b2c0a64af2a1cd62d58f796896a26 to your computer and use it in GitHub Desktop.
Save aukrocz/861b2c0a64af2a1cd62d58f796896a26 to your computer and use it in GitHub Desktop.
class Main {
class Item {
public String Name;
public Double Price;
private int getPlateSize() { ... }
}
class OrderedItem {
public Item item;
public Receipt receipt;
void serve() {
var plateSize = getPlateSize();
// put food to plate size ...
}
void cancel() { ... }
}
class Receipt {
public ArrayList<OrderedItem> Items;
public int TableNumber;
public returnOrderedItem(Item item) { ... search item in ordered item ... cancel(); }
}
class CashRegister {
public ArrayList<Receipt> Receipts;
public CashRegister() { ... }
void searchReceipt(int tableNumber) { ... }
}
class DrinkActionPrice {
String getDrinkActionPrice() {
return "30% between 14:00 - 16:00.";
}
}
class MainCourseActionPrice {
String getMainCourseDiscount() {
return "20% between 11:00 - 13:00.";
}
}
class ActionPriceManager {
void processDrinkActionPrice(DrinkActionPrice actionPrice) {...}
void processMainCourseActionPrice(MainCourseActionPrice actionPrice) {...}
}
class CrispyChicken extends Item {
@Override
private int getPlateSize() { ... }
}
class Redbull extends Item {
@Override
private int getPlateSize() { ... }
}
public interface ItemAction {
void returnBackToWaiter();
void eat();
void drink();
}
class CrispyChickenAction {
public Item item;
void returnBackToWaiter() { ... }
void eat() { ... }
void drink() { ... }
}
class RedbullAction {
public Item item;
void returnBackToWaiter(int tableNumber) { cashRegister.searchReceipt(tableNumber).returnOrderedItem(item); }
void eat() { ... }
void drink() { ... }
}
public static CashRegister cashRegister = new CashRegister();
public static void main(String[] args) throws Exception {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment