private void RepopulateSourceTable() { try { int row = -1; int num = -1; this.mSourceTable.GetFirstVisibleCell(ref num, ref row); this.mSourceTable.Clear(); foreach (ObjectPicker.RowInfo current in this.mSims) { if (!this.mSelectedSims.Contains(current)) { TableRow tableRow = this.mSourceTable.CreateRow(); DualPanelShopping.DualPaneSimPickerRowController dualPaneSimPickerRowController = new DualPanelShopping.DualPaneSimPickerRowController(tableRow, this.mSourceTable, current, mMultiplyer); tableRow.RowController = dualPaneSimPickerRowController; dualPaneSimPickerRowController.Enabled = true; this.mSourceTable.AddRow(tableRow); } } this.mSourceTable.ClearSelection(); this.mRightArrow.Enabled = false; this.mSourceTable.Flush(); this.mSourceTable.ScrollRowToTop(row); } catch (System.Exception ex) { CommonMethodsOFBBistroSet.PrintMessage("DualPanelSource: " + ex.Message); } }
public static void SendEverybodyHome(OFBOven oven, Sim cheff) { try { if (cheff != null) { cheff.PopPosture(); cheff.InteractionQueue.CancelAllInteractions(); cheff.SwitchToOutfitWithoutSpin(OutfitCategories.Everyday); if (!cheff.IsActiveSim) { Sim.MakeSimGoHome(cheff, false); } } //Send waiters home if (oven.Waiters != null) { foreach (ulong id in oven.Waiters) { SimDescription simDescription = CommonMethodsOFBBistroSet.ReturnSim(id);; if (simDescription != null && simDescription.CreatedSim != null) { simDescription.CreatedSim.PopPosture(); simDescription.CreatedSim.InteractionQueue.CancelAllInteractions(); simDescription.CreatedSim.SwitchToOutfitWithoutSpin(OutfitCategories.Everyday); if (!simDescription.CreatedSim.IsActiveSim) { Sim.MakeSimGoHome(simDescription.CreatedSim, false); } } else { CommonMethodsOFBBistroSet.PrintMessage("Couldn't send waiter home"); } } } } finally { oven.Waiters = new List <ulong>(); } }
public static Shift ReturnNextValidShift(OFBOven oven, List <Shift> shifts) { Shift shift = null; StringBuilder sb = new StringBuilder(); //Sort the shifts and get the next one shifts.Sort(delegate(Shift s1, Shift s2) { return(s1.StarWork.CompareTo(s2.StarWork)); }); Shift next = BusinessMethods.ReturnNextOrCurrentShift(shifts, SimClock.CurrentTime().Hour); if (next != null && next.Cheff != null) { if (BusinessMethods.CheckIfValidEmployee(next.Cheff.DescriptionId)) { shift = next; } else { sb.Append("Selected chef is not valid.\n"); sb.Append("Please select a new chef"); CommonMethodsOFBBistroSet.PrintMessage(sb.ToString()); } } else { if (next == null) { CommonMethodsOFBBistroSet.PrintMessage("Couldn't calculate next shift"); } else { CommonMethodsOFBBistroSet.PrintMessage(BusinessMethods.ShowShiftInfo(next, "Shift information invalid", null, null)); } } if (OFBOven.ShowDebugMessages) { CommonMethodsOFBBistroSet.PrintMessage(BusinessMethods.ShowShiftInfo(next, "Next shift:", null, null)); } return(shift); }