Example #1
0
        public static void RemoveInvalidCoworkers(Occupation ths)
        {
            if (ths.Coworkers != null)
            {
                // Custom
                for (int i = ths.Coworkers.Count - 1; i >= 0; i--)
                {
                    if ((ths.Coworkers[i] == null) || (ths.Coworkers[i] == ths.OwnerDescription))
                    {
                        ths.Coworkers.RemoveAt(i);
                    }
                }

                List <SimDescription> list = new List <SimDescription>(ths.Coworkers);
                foreach (SimDescription description in list)
                {
                    if ((!description.IsValidDescription || ((description.DeathStyle != SimDescription.DeathType.None) && !description.IsPlayableGhost)) || !description.IsHuman)
                    {
                        ths.RemoveCoworker(description);
                    }
                }
            }
        }
Example #2
0
        public static void RemoveInvalidCoworkers(Occupation ths)
        {
            if (ths.Coworkers != null)
            {
                // Custom
                for (int i = ths.Coworkers.Count - 1; i >= 0; i--)
                {
                    if ((ths.Coworkers[i] == null) || (ths.Coworkers[i] == ths.OwnerDescription))
                    {
                        ths.Coworkers.RemoveAt(i);
                    }
                }

                List<SimDescription> list = new List<SimDescription>(ths.Coworkers);
                foreach (SimDescription description in list)
                {
                    if ((!description.IsValidDescription || ((description.DeathStyle != SimDescription.DeathType.None) && !description.IsPlayableGhost)) || !description.IsHuman)
                    {
                        ths.RemoveCoworker(description);
                    }
                }
            }
        }