Ejemplo n.º 1
0
        public static void AddWooHooToQue(BedDouble bed, Sim actor, Sim recipient, InteractionDefinition definition)
        {
            actor.GreetSimOnMyLotIfPossible(recipient);
            InteractionPriority priority = actor.CurrentInteraction.GetPriority();
            InteractionInstance entry    = OverridedEnterRelaxing.Singleton.CreateInstance(bed, actor, priority, false, true);

            if (actor.InteractionQueue.Add(entry))
            {
                InteractionInstance instance2 = OverridedEnterRelaxing.Singleton.CreateInstance(bed, recipient, priority, false, true);
                recipient.InteractionQueue.Add(instance2);
                InteractionInstance instance3 = definition.CreateInstance(recipient, actor, priority, actor.CurrentInteraction.Autonomous, true);
                instance3.GroupId = entry.GroupId;
                actor.InteractionQueue.Add(instance3);
            }
        }
Ejemplo n.º 2
0
            protected bool TestUse(BedDouble obj)
            {
                if (!TestRepaired(obj))
                {
                    return(false);
                }

                if (obj.UseCount > 0)
                {
                    return(false);
                }

                if (obj.NumberOfSpots() < 2)
                {
                    return(false);
                }

                return(true);
            }
Ejemplo n.º 3
0
            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);
            }