Пример #1
0
 internal static void RemoveObject(TimeCheckObject obj)
 {
     $"Removing object {obj.Name} to time check".AddLog(true);
     if (_objList.Contains(obj))
     {
         _objList.Remove(obj);
     }
 }
Пример #2
0
        private static void EvidenceTestCompleted(TimeCheckObject obj)
        {
            $"{obj.Name} testing completed; datetime.compare = {DateTime.Compare(obj.CompletionTime, DateTime.Now)}".AddLog(true);

            if (obj.CheckType == TimeCheckObject.Type.Evidence)
            {
                var eList = Serializer.LoadItemFromXML <List <EvidenceData> >(Main.EDataPath);
                if (eList.Count < 1)
                {
                    return;
                }

                foreach (var val in eList)
                {
                    if (val.Name != obj.Name || !val.IsTested)
                    {
                        continue;
                    }
                    val.IsTested = true;
                    "~b~Police Laboratory".DisplayNotification($"Evidence testing ~g~completed~w~ for ~y~{obj.Name}~w~\nView the details in the ~b~SAJRS ~w~computer", Serializer.LoadItemFromXML <CaseData>(Main.CDataPath).Number);
                    break;
                }
                Serializer.SaveItemToXML(eList, Main.EDataPath);
            }
            else
            {
                "Hearing warrant".AddLog(true);
                var data = Serializer.LoadItemFromXML <CaseData>(Main.CDataPath);
                data.WarrantHeard = true;
                if (data.WarrantReason == "Gut Feeling" || data.WarrantReason == "None")
                {
                    data.WarrantApproved = MathHelper.GetRandomInteger(10) != 1;
                }
                else
                {
                    data.WarrantApproved = MathHelper.GetRandomInteger(250) != 1;
                }
                Serializer.SaveItemToXML <CaseData>(data, Main.CDataPath);
            }
            RemoveObject(obj);
        }
Пример #3
0
 internal static void AddObject(TimeCheckObject obj)
 {
     $"Adding object {obj.Name} to time check".AddLog(true);
     _objList.Add(obj);
 }