/// <summary> /// /// </summary> /// <param name="interactionName"></param> /// <returns></returns> public static List <IMiniSimDescription> ShowSimSelector(Sim actor, ulong cheffId, string interactionName) { List <IMiniSimDescription> residents = new List <IMiniSimDescription>(); string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); List <object> list2; //Create list of sims foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable && sd.SimDescriptionId != cheffId) { list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, sd)); } } list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, 3, false); if (list2 == null || list2.Count == 0) { return(null); } foreach (var item in list2) { residents.Add(item as SimDescription); } return(residents); }
/// <summary> /// /// </summary> /// <param name="interactionName"></param> /// <returns></returns> public static SimDescription ReturnSim(ulong descriptionId) { foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (sd.SimDescriptionId == descriptionId && sd.IsContactable) { return(sd); } } return(null); }
private static bool CheckIfValidEmployee(ulong id) { bool valid = false; //Find the cheff foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable && sd.SimDescriptionId == id) { valid = true; } } return(valid); }
public static List <PhoneSimPicker.SimPickerInfo> ReturnUnemployedSims(Sim sim, Lot lot, bool residentsOnly, List <SimDescription> workers) { List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); //Create list of sims if (residentsOnly) { foreach (Household h in Household.GetHouseholdsLivingInWorld()) { foreach (SimDescription sd in h.SimDescriptions) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable) { list.Add(Phone.Call.CreateBasicPickerInfo(sim.SimDescription, sd)); } } } } else { foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable) { list.Add(Phone.Call.CreateBasicPickerInfo(sim.SimDescription, sd)); } } } //Remove Employed Sims if (workers != null && workers.Count > 0) { foreach (SimDescription sd in workers) { PhoneSimPicker.SimPickerInfo sp = Phone.Call.CreateBasicPickerInfo(sim.SimDescription, sd); if (sp.SimDescription != null && ((SimDescription)sp.SimDescription).SimDescriptionId == sd.SimDescriptionId) { list.Remove(sp); } } } return(list); }
public static SimDescription ReturnSimsInHousehold(SimDescription actor, bool teenOrAbove, bool residentsOnly) { string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); List <object> list2; //Create list of sims if (residentsOnly) { foreach (Household h in Household.GetHouseholdsLivingInWorld()) { foreach (SimDescription sd in h.SimDescriptions) { if (!sd.IsPet && sd.TeenOrAbove) { list.Add(Phone.Call.CreateBasicPickerInfo(actor, sd)); } } } } else { foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable) { list.Add(Phone.Call.CreateBasicPickerInfo(actor, sd)); } } } list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, "", "", buttonFalse, 1, false); if (list2 == null || list2.Count == 0) { return(null); } return(list2[0] as SimDescription); }