//Determines whether a table requires the attention of the current employee public bool checkCondition(int employeeType, Button currentTable) { tableInfo currentTableInfo = currentTable.gameObject.GetComponent <tableInfo>(); //printInfo(currentTableInfo); //Debug.Log(currentTableInfo.occupied + " " + currentTableInfo.waitingToOrder); if (employeeType == 1) { if (currentTableInfo.occupied == false) { return(true); } } if (employeeType == 2) { if ((currentTableInfo.waitingToOrder == true) || (currentTableInfo.bill > 0 && currentTableInfo.order.Count < 2)) { return(true); } } if (employeeType == 3) { if (currentTableInfo.order.Count > 1) { return(true); } } if (employeeType == 4) { if (currentTableInfo.clean == false) { return(true); } } /* * switch (employeeType) { * //Host * case 1: if(currentTableInfo.occupied == false) return true; * break; * //Waiter * case 2: if(currentTableInfo.waitingToOrder == true) return true; * break; * //Kitchen * case 3: if(currentTableInfo.order.Count != 0) return true; * break; * //Busser * case 4: if(currentTableInfo.clean == false && currentTableInfo.occupied == false) return true; * break; * default: Debug.Log("Default checkCondition: " + currentTableInfo.tableNumber); * break; * } * Debug.Log("Outside switch, returning False"); */ //Debug.Log("Employee type: " + employeeType); return(false); }
public columnInfo(tableInfo t) { table = new tableInfo(t.stmt); table.database = t.database; table.schema = t.schema; table.table = t.table; table.tableAlias = t.tableAlias; }
void busserOnClick() { //Debug.Log("Busser Button."); updateTableData = callingButton.GetComponent <tableInfo>(); updateTableData.markClean(); colorMe.highlightSpecificButton(callingButton, Color.green); writeMe.writeToFile(); player.playSound(1); }
void kitchenOnClick() { //Debug.Log("Kitchen Button."); updateTableData = callingButton.GetComponent <tableInfo>(); updateTableData.markOrderFilled(); colorMe.highlightSpecificButton(callingButton, Color.green); writeMe.writeToFile(); player.playSound(1); }
void hostOnClick() { //Debug.Log("Host Button; Guests Leaving."); updateTableData = callingButton.GetComponent <tableInfo>(); updateTableData.markOccupied(); colorMe.highlightSpecificButton(callingButton, Color.green); writeMe.writeToFile(); player.playSound(1); }
private void orderCancelClick() { //Debug.Log("OrderCancel button."); Destroy(GameObject.FindGameObjectWithTag("orderPopup")); updateTableData = callingButton.GetComponent <tableInfo>(); updateTableData.waitingToOrder = false; colorMe.highlightSpecificButton(callingButton, Color.green); writeMe.writeToFile(); player.playSound(2); }
// Use this for initialization void Start() { muhStaticClass = GameObject.FindObjectOfType <StaticClass>(); thisButton = this.gameObject.GetComponent <Button>(); thisButton.onClick.AddListener(onClick); colorMe = GameObject.FindObjectOfType <tableHighlight>(); callingButton = colorMe.getCallingTable(); writeMe = callingButton.GetComponent <tableInfo>(); //login = colorMe.getLoginNumber(); login = muhStaticClass.getLogin(); tablesToHighlight = colorMe.tablesToHighlight; tablesToHighlight.Clear(); onClick(); }
private void setTableStatus(Text tblStatus, tableInfo writeMe, int login) { if (writeMe.waitingToOrder == true) { tblStatus.text = "Waiting to Order."; } else if (writeMe.bill > 0 && writeMe.order.Count > 1) { tblStatus.text = "Waiting for food."; } else if (writeMe.bill > 0 && writeMe.order.Count <= 1) { tblStatus.text = "Waiting to pay."; } else { tblStatus.text = "Does not need attention."; } }
private void parseTableInfo(string thisTableInfo, int currentTable) { //get all tables GameObject[] allTables = GameObject.FindGameObjectsWithTag("button"); //find current table foreach (GameObject goTable in allTables) { tableInfo currentTableInfo = goTable.GetComponent <tableInfo>(); if (currentTableInfo.tableNumber == currentTable) { //Debug.Log("thisTableInfo: " + thisTableInfo); string[] words = thisTableInfo.Split(','); //Debug.Log("Entered Setters"); currentTableInfo.setOccupied(bool.Parse(words[1])); currentTableInfo.setClean(bool.Parse(words[2])); currentTableInfo.setW2O(bool.Parse(words[3])); currentTableInfo.setOrder(new List <string>(words[4].Split(' '))); currentTableInfo.setBill(double.Parse(words[5])); } } }
// Use this for initialization void Start() { colorMe = GameObject.FindObjectOfType <tableHighlight>(); callingButton = colorMe.getCallingTable(); writeMe = callingButton.GetComponent <tableInfo>(); login = colorMe.getLoginNumber(); otherButtons.Clear(); player = (GameObject.FindGameObjectWithTag("Player").GetComponent <keypadSounds>()); if (this.gameObject.name != "Order Popup(Clone)") { actionButton = GameObject.FindGameObjectWithTag("action").GetComponent <Button>(); cancelButton = GameObject.FindGameObjectWithTag("cancel").GetComponent <Button>(); inputOrder = GameObject.FindGameObjectWithTag("placeOrder").GetComponent <Button>(); tableStatus = GameObject.FindGameObjectWithTag("other").GetComponent <Button>(); orderList = GameObject.FindGameObjectWithTag("orderList").GetComponent <Button>(); addActionClickMethod(); cancelButton.onClick.AddListener(cancelClick); Text abText = actionButton.GetComponentInChildren <Text>(); //Debug.Log(abText.text); renameActionButton(login, abText); Text tblStatus = tableStatus.GetComponentInChildren <Text>(); setTableStatus(tblStatus, writeMe, login); populateOrderList(); } else { GameObject[] otherButtonsGO = GameObject.FindGameObjectsWithTag("other"); foreach (GameObject currentOtherButton in otherButtonsGO) { //Debug.Log(otherButtons.ToString()); otherButtons.Add(currentOtherButton.GetComponent <Button>()); clickHandler(currentOtherButton.GetComponent <Button>()); } cancelButton = GameObject.FindGameObjectWithTag("orderCancel").GetComponent <Button>(); cancelButton.onClick.AddListener(orderCancelClick); } }
private void printInfo(tableInfo currentTableInfo) { currentTableInfo.toString(); }