private static bool EvaluateLaborers(Players.Player p)
        {
            var update = false;

            if (TimeCycle.IsDay && Time.SecondsSinceStartDouble > _nextLaborerTime)
            {
                if (p.IsConnected)
                {
                    var unTrack = new List <NPCBase>();
                    var colony  = Colony.Get(p);
                    var state   = PlayerState.GetPlayerState(p);
                    var left    = 0;

                    for (var i = 0; i < colony.LaborerCount; i++)
                    {
                        var npc     = colony.FindLaborer(i);
                        var tmpVals = npc.GetTempValues();

                        if (!tmpVals.Contains(LEAVETIME_JOB))
                        {
                            tmpVals.Set(LEAVETIME_JOB, Time.SecondsSinceStartDouble + LOABOROR_LEAVE_HOURS);
                        }
                        else if (tmpVals.Get <double>(LEAVETIME_JOB) < TimeCycle.TotalTime)
                        {
                            left++;
                            NPCLeaving(npc);
                        }
                    }

                    if (left > 0)
                    {
                        PandaChat.Send(p,
                                       string.Concat(SettlerReasoning.GetNoJobReason(),
                                                     string.Format(" {0} colonists have left your colony.", left)),
                                       ChatColor.red);
                    }

                    update = unTrack.Count != 0;
                    colony.SendUpdate();
                }

                _nextLaborerTime = Time.SecondsSinceStartDouble + Random.Next(4, 6) * TimeCycle.SecondsPerHour;
            }

            return(update);
        }
        private static bool EvaluateLaborers(ColonyState state)
        {
            var update = false;

            if (TimeCycle.IsDay && Time.SecondsSinceStartDouble > _nextLaborerTime)
            {
                if (state.ColonyRef.OwnerIsOnline())
                {
                    var unTrack = new List <NPCBase>();
                    var left    = 0;

                    for (var i = 0; i < state.ColonyRef.LaborerCount; i++)
                    {
                        var npc = state.ColonyRef.FindLaborer(i);

                        if (!npc.CustomData.TryGetAs(LEAVETIME_JOB, out double leaveTime))
                        {
                            npc.CustomData.SetAs(LEAVETIME_JOB, Time.SecondsSinceStartDouble + LOABOROR_LEAVE_HOURS);
                        }
                        else if (leaveTime < Time.SecondsSinceStartDouble)
                        {
                            left++;
                            NPCLeaving(npc);
                        }
                    }

                    if (left > 0)
                    {
                        PandaChat.Send(state.ColonyRef,
                                       string.Concat(SettlerReasoning.GetNoJobReason(),
                                                     string.Format(" {0} colonists have left your colony.", left)),
                                       ChatColor.red);
                    }

                    update = unTrack.Count != 0;
                    state.ColonyRef.SendCommonData();
                }

                _nextLaborerTime = Time.SecondsSinceStartDouble + Random.Next(4, 6) * IN_GAME_HOUR_IN_SECONDS * 24;
            }

            return(update);
        }