Ejemplo n.º 1
0
        public void UpdatePacks()
        {
            if (enableDebug && multiThreaded)
            {
                //Log.Message("Thread started.");
            }
            IEnumerable <Pawn> pawnsOnMap = RimValiUtility.AllPawnsOfRaceInWorld(AvaliDefs.RimVali).Where <Pawn>(x => RimValiUtility.GetPackSize(x) < maxSize);

            foreach (Pawn pawn in pawnsOnMap)
            {
//Log.Message(pawn.Faction.Name);
                //Log.Message(pawn.Name.ToString() + " updatePacks()");
                PackComp comp = pawn.TryGetComp <PackComp>();
                if (!(comp == null))
                {
                    //Pull the comp info from the pawn
                    SimpleCurve ageCurve = comp.Props.packGenChanceOverAge;
                    //Tells us that this pawn has had a pack
                    if (enableDebug)
                    {
                        //Log.Message("Attempting to make pack.. [Base pack]");
                    }
                    //Makes the pack.
                    //Log.Message("EiPackHandlerFromPackDriverMapComp started.");
                    packs = RimValiUtility.EiPackHandler(packs, pawn, racesInPacks, maxSize);
                }
            }
        }