This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Restaurant
Matthew Pohlmann edited this page Jan 1, 2014
·
1 revision
####Description A Restaurant in SimCity201. Every team member will inherit from this to create their own Restaurants for the project.
####Class Signature
public abstract class Restaurant extends Structure {}
####Data
RestaurantConfigPanel configPanel; // This Restaurant's configuration panel
RestaurantCashierRole cashier; // This Restaurant's CashierRole
RestaurantCookRole cook; // This Restaurant's CookRole
RestaurantHostRole host; // This Restaurant's HostRole. Restaurant is not open if no Host is present
List<RestaurantWaiterRole> waiters; // This Restaurant's list of WaiterRoles
double moneyOnHand; /* The amount of money in the Restaurant (Restaurants also have accounts
at Banks) */
int bankAccountNumber; /* This Restaurant's account number at SimCity Bank (assigned when first making
a transaction at a bank */
####Constructors
public Restaurant(int x, int y, int width, int height, int id, StructurePanel p) {
super(x, y, width, height, id, p);
}
####Methods
public abstract Role getRole(PersonAgent.Intention intent);
// Returns this Restaurant's cashier Role
public RestaurantCashier getCashier() {
return cashier;
}
// Returns this Restaurant's cook Role
public RestaurantCook getCook() {
return cook;
}
// Returns this Restaurant's host Role
public RestaurantHost getHost() {
return host;
}
// Returns a list of this Restaurant's waiter Roles
public List<RestaurantWaiter> getWaiters() {
return waiters;
}
// Adds money to the Restaurant's money on hand
public void addMoney(double howMuch) {
moneyOnHand += howMuch;
}
// Removes money from the Restaurant's money on hand
public void removeMoney(double howMuch) {
moneyOnHand -= howMuch;
}
// Returns how much money the Restaurant has on hand
public double getCurrentRestaurantMoney() {
return moneyOnHand;
}
// Sets this Restaurant's bank account number
public void setBankAccountNumber(int newNumber) {
bankAccountNumber = newNumber;
}
// Sets whether this Restaurant is open or closed
public void setOpen(boolean open) {
isOpen = open;
}
// Returns whether or not this Restaurant is open
public boolean getOpen() {
return isOpen;
}
// Should be called by the Host when he believes it's okay for all the other employees to go Home
public abstract void closingTime();
// Used to forcibly close this Restaurant
public void closeRestaurant() {
forceClosed = true;
isOpen = false;
if (host.getPerson != null) {
host.msgClosingTime();
} else {
closingTime();
}
}
// Used to empty the restaurant Cook's inventory
public abstract void emptyEntireCookInventory();
// Used to get the restaurant Cook's inventory
public abstract List<String> getCookInventory();