Exemple #1
0
            public override bool Test(Sim a, Book target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target is BookToddler)
                {
                    if (!a.Inventory.Contains(target))
                    {
                        if (isAutonomous)
                        {
                            return(false);
                        }
                    }

                    if (a.LotHome != a.LotCurrent)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (a.Inventory.Contains(target) && (a.LotCurrent != a.LotHome))
                    {
                        return(false);
                    }
                }

                if (target.InUse || (Bookshelf.FindClosestBookshelf(a, target, a.Inventory.Contains(target)) == null))
                {
                    return(false);
                }

                if (!target.IsServiceableBySim(a))
                {
                    return(false);
                }

                return(true);
            }