public Order(string description, int destinationTable, double price, ORDER_TYPE type) { this.description = description; this.destinationTable = destinationTable; this.price = price; state = ORDER_STATE.NOT_PICKED; this.type = type; }
public Order() { ID = 0; description = ""; destinationTable = 0; price = 0.0; state = ORDER_STATE.NOT_PICKED; }
// 處理已出貨訂單並設定下一關的狀態 private string processShipment() { // 回傳處理過程資訊 string procResult = "目前狀態:已付款\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.FINISHED; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已完成\n\n"; return procResult; }
// 處理已付款訂單並設定下一關的狀態 private string processPayment() { // 回傳處理過程資訊 string procResult = "目前狀態:新訂單\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.SHIPPED; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已出貨\n\n"; return procResult; }
// 處理新訂單並設定下一關的狀態 private string processNewOrder() { // 回傳處理過程資訊 string procResult = "目前狀態:新訂單成立中‧‧‧\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.PAID; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已付款"; return procResult; }
// 處理已出貨訂單並設定下一關的狀態 private string processShipment() { // 回傳處理過程資訊 string procResult = "目前狀態:已付款\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.FINISHED; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已完成\n\n"; return(procResult); }
// 處理已付款訂單並設定下一關的狀態 private string processPayment() { // 回傳處理過程資訊 string procResult = "目前狀態:新訂單\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.SHIPPED; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已出貨\n\n"; return(procResult); }
// 處理新訂單並設定下一關的狀態 private string processNewOrder() { // 回傳處理過程資訊 string procResult = "目前狀態:新訂單成立中‧‧‧\n" + "紀錄本關卡的處理過程‧‧‧。\n"; current_state = ORDER_STATE.PAID; // 設定下一關的狀態 procResult = procResult + "轉移至下一關卡狀態為:已付款"; return(procResult); }
public void setState(ORDER_STATE state) { this.state = state; }
private ORDER_STATE current_state; // initial state // constructor public OrderState_SwitchCase() { // assign the new order's state as 'NEW_ORDER' current_state = ORDER_STATE.NEW_ORDER; }
private ORDER_STATE current_state; // initial state // constructor public OrderState_SwitchCase() { // assign the new order's state as 'NEW_ORDER' current_state = ORDER_STATE.NEW_ORDER; }