Example #1
0
        public void CreateColonists()
        {
            colonists.Clear();
            foreach (CustomPawn customPawn in pawns)
            {
                customPawn.Pawn.SetFactionDirect(Faction.OfPlayer);
                if (customPawn.Pawn.workSettings == null)
                {
                    customPawn.Pawn.workSettings = new Pawn_WorkSettings(customPawn.Pawn);
                }
                customPawn.Pawn.workSettings.EnableAndInitialize();
                colonists.Add(customPawn.Pawn);
            }

            pawnLookup.Clear();
            for (int i = 0; i < pawns.Count; i++)
            {
                CustomPawn customPawn = pawns[i];
                Pawn       pawn       = colonists[i];
                pawnLookup[customPawn] = pawn;
            }

            RelationshipBuilder builder = new RelationshipBuilder(RelationshipManager.Relationships.ToList(), RelationshipManager.ParentChildGroups);

            builder.Build();
        }
Example #2
0
        protected void PrepareRelatedPawns()
        {
            // Get all of the related pawns.
            List <CustomPawn> relatedPawns = new RelationshipBuilder(PrepareCarefully.Instance.RelationshipManager.Relationships.ToList(),
                                                                     PrepareCarefully.Instance.RelationshipManager.ParentChildGroups).Build();

            // Add related pawns who are not already in the world to the starting pawns list
            foreach (var customPawn in relatedPawns)
            {
                if (PrepareCarefully.Instance.RelationshipManager.TemporaryPawns.FirstOrDefault((pawn) => {
                    return(pawn == customPawn);
                }) != null)
                {
                    continue;
                }
                AddPawnToWorld(customPawn);
            }
        }