AlertSpeaker.Building_AlertSpeaker.RemoveAnyThoughtBonusFromAllColonists C# (CSharp) Method

RemoveAnyThoughtBonusFromAllColonists() public method

Remove any thought bonus from all colonists.
public RemoveAnyThoughtBonusFromAllColonists ( ) : void
return void
        public void RemoveAnyThoughtBonusFromAllColonists()
        {
            IEnumerable<Pawn> colonistList = Find.MapPawns.FreeColonists;
            foreach (Pawn colonist in colonistList)
            {
                IEnumerable<Thought> thoughts = colonist.needs.mood.thoughts.ThoughtsOfDef(Util_AlertSpeaker.SmallAdrenalineBoostThoughtDef);
                if (thoughts.Count() != 0)
                {
                    (thoughts.First() as Thought_Memory).age = thoughts.First().def.DurationTicks;
                }
                thoughts = colonist.needs.mood.thoughts.ThoughtsOfDef(Util_AlertSpeaker.MediumAdrenalineBoostThoughtDef);
                if (thoughts.Count() != 0)
                {
                    (thoughts.First() as Thought_Memory).age = thoughts.First().def.DurationTicks;
                }
                thoughts = colonist.needs.mood.thoughts.ThoughtsOfDef(Util_AlertSpeaker.ThreatIsFinishedThoughtDef);
                if (thoughts.Count() != 0)
                {
                    (thoughts.First() as Thought_Memory).age = thoughts.First().def.DurationTicks;
                }
            }
        }