public static List <T> QuickFind <T>(Inventory ths, bool checkInUse, ItemTestFunction testFunction, object customData) where T : GameObject { if ((!checkInUse) && (testFunction == null)) { return(QuickFind <T>(ths)); } else { List <T> retList = new List <T>(); QuickApplyFuncToAllItems <T>( ths, delegate(InventoryItem item) { if (!checkInUse || (!item.InUse && !ths.GetStackInUse(item.StackNumber))) { T local = item.Object as T; if ((local != null) && ((testFunction == null) || testFunction(item.Object, customData))) { retList.Add(local); } } }, false ); return(retList); } }
public override List<GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List<GameObject> results = new List<GameObject>(); foreach (HotairBalloon obj in actor.LotCurrent.GetObjects<HotairBalloon>(new Predicate<HotairBalloon>(TestUse))) { if ((testFunc != null) && (!testFunc(obj, null))) continue; results.Add(obj); } return results; }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List <GameObject> results = new List <GameObject>(); foreach (HotairBalloon obj in actor.LotCurrent.GetObjects <HotairBalloon>(new Predicate <HotairBalloon>(TestUse))) { if ((testFunc != null) && (!testFunc(obj, null))) { continue; } results.Add(obj); } return(results); }
public override List<GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List<GameObject> results = new List<GameObject>(); if (GameUtils.IsInstalled(ProductVersion.EP4)) { foreach (ShowerOutdoor obj in actor.LotCurrent.GetObjects<ShowerOutdoor>(new Predicate<ShowerOutdoor>(TestUse))) { if ((testFunc != null) && (!testFunc(obj, null))) continue; results.Add(obj); } } return results; }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List <GameObject> results = new List <GameObject>(); if (GameUtils.IsInstalled(ProductVersion.EP4)) { foreach (ShowerOutdoor obj in actor.LotCurrent.GetObjects <ShowerOutdoor>(new Predicate <ShowerOutdoor>(TestUse))) { if ((testFunc != null) && (!testFunc(obj, null))) { continue; } results.Add(obj); } } return(results); }
public static List <T> QuickFind <T>(Inventory ths, bool checkInUse, ItemTestFunction testFunction) where T : GameObject { return(QuickFind <T>(ths, checkInUse, testFunction, null)); }
public static List <T> InventoryFindAll <T>(SimDescription sim, bool checkInUse, ItemTestFunction func) where T : GameObject { if (!VerifyInventory(sim)) { return(new List <T>()); } return(QuickFind <T>(sim.CreatedSim.Inventory, checkInUse, func)); }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { return(null); }
protected static void AddToList <T>(SimDescription sim, List <GameObject> objs, ItemTestFunction testFunc) where T : GameObject { bool first = true; List <T> results = Inventories.InventoryFindAll <T>(sim); results.Sort(new Comparison <T>(SortByValue)); foreach (T obj in results) { if (testFunc != null) { if (!testFunc(obj, null)) { continue; } } if (!first) { objs.Add(obj as GameObject); } else { first = false; } } }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List <GameObject> list = new List <GameObject>(); foreach (ToiletStall current in actor.LotCurrent.GetObjects <ToiletStall>(new Predicate <ToiletStall>(TestUse))) { if ((testFunc == null || testFunc(current, null)) && TestAccessible(current, actor) && TestAccessible(current, target)) { list.Add(current); } } return(list); }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List <GameObject> results = new List <GameObject>(); foreach (ElevatorDoors obj in actor.LotCurrent.GetObjects <ElevatorDoors>(new Predicate <ElevatorDoors>(new Tester(actor).TestUse))) { if ((testFunc != null) && (!testFunc(obj, null))) { continue; } results.Add(obj); } return(results); }
public override List<GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { return null; }
public override List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc) { List <BedDouble> objects = new List <BedDouble>(); BedDouble bed = actor.Bed as BedDouble; if (bed != null) { if (bed.LotCurrent == actor.LotCurrent && TestUse(bed)) { objects.Add(bed); } } bed = target.Bed as BedDouble; if (bed != null) { if (bed.LotCurrent == target.LotCurrent && TestUse(bed)) { objects.Add(bed); } } if (objects.Count == 0) { objects = actor.LotCurrent.GetObjects(new Predicate <BedDouble>(TestUse)); } List <GameObject> results = new List <GameObject>(); foreach (GameObject obj in objects) { if (testFunc != null && !testFunc(obj, null)) { continue; } results.Add(obj); } return(results); }
public abstract List<GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc);
public abstract List <GameObject> GetAvailableObjects(Sim actor, Sim target, ItemTestFunction testFunc);