Пример #1
0
 public override bool Test(Sim a, WashingMachine target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (!target.CanDoLaundry())
     {
         return(false);
     }
     if (target.mWashState == WashingMachine.WashState.HasDirtyLaundry)
     {
         return(true);
     }
     if (a.IsSelectable && target.LotCurrent.IsCommunityLot && a.FamilyFunds < target.Tuning.kCostToOperate)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WashingMachine.LocalizeString("InsufficientFunds"));
         return(false);
     }
     if (!target.LotCurrent.IsResidentialLot)
     {
         return(true);
     }
     if (Sims3.Gameplay.Queries.CountObjects <ClothingPileDry>(target.LotCurrent) > 0U)
     {
         return(true);
     }
     foreach (Hamper hamper in target.LotCurrent.GetObjects <Hamper>())
     {
         if (hamper.HasClothingPiles())
         {
             return(true);
         }
     }
     if (a.Inventory.ContainsType(typeof(ClothingPileDry), 1))
     {
         return(true);
     }
     greyedOutTooltipCallback = new GreyedOutTooltipCallback(WashingMachine.DoLaundry.Definition.NoLaundryTooltip);
     return(false);
 }