Esempio n. 1
0
        // Token: 0x060026C9 RID: 9929 RVA: 0x0008AFD4 File Offset: 0x000891D4
        public static bool smethod_10(Class177 district, out Struct40?invasion)
        {
            bool result;

            lock (Struct40.object_0)
            {
                invasion = null;
                if (!Struct40.dictionary_3.ContainsKey(district))
                {
                    result = false;
                }
                else
                {
                    Struct40 @struct = Struct40.dictionary_3[district];
                    if (@struct.nullable_0 != null && DateTime.Now.ToUniversalTime() < @struct.nullable_0.Value)
                    {
                        Struct40.smethod_0(district, @struct, null);
                        result = false;
                    }
                    else
                    {
                        invasion = new Struct40?(@struct);
                        result   = true;
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
        // Token: 0x060026C6 RID: 9926 RVA: 0x0008ADC8 File Offset: 0x00088FC8
        private static uint?smethod_7(Class177 district, Class464 cog, uint cogsRemaining)
        {
            uint?num;

            if (Struct40.dictionary_1.ContainsKey(district))
            {
                if (Struct40.dictionary_1[district].ContainsKey(cogsRemaining))
                {
                    num = new uint?(Struct40.dictionary_1[district][cogsRemaining]);
                    uint?num2 = Struct40.smethod_8(district, cog, cogsRemaining);
                    if (num2 != null)
                    {
                        num -= num2.Value;
                    }
                }
                else if (!Struct40.smethod_9(Struct40.dictionary_1[district], cogsRemaining, out num))
                {
                    num = null;
                }
            }
            else
            {
                num = null;
            }
            return(num);
        }
Esempio n. 3
0
 // Token: 0x060026BF RID: 9919 RVA: 0x0008A8D8 File Offset: 0x00088AD8
 private static void smethod_0(Class177 district, Struct40 invasion, DateTime?endTime)
 {
     if (endTime != null)
     {
         List <uint>             list;
         Dictionary <uint, uint> dictionary;
         Dictionary <uint, uint> dictionary2;
         Struct40.smethod_4(district, invasion.uint_0, invasion.class464_0, out list, out dictionary, out dictionary2);
         list.Add((uint)endTime.Value.ToUniversalTime().Subtract(invasion.dateTime_0).TotalSeconds);
         if (list.Count > Struct40.int_0)
         {
             list.RemoveAt(0);
         }
         if (dictionary.ContainsKey(invasion.uint_0))
         {
             dictionary[invasion.uint_0] = Struct40.smethod_5(district, invasion.uint_0, invasion.class464_0);
         }
         else
         {
             dictionary.Add(invasion.uint_0, Struct40.smethod_5(district, invasion.uint_0, invasion.class464_0));
         }
         if (dictionary2.ContainsKey(invasion.uint_0))
         {
             dictionary2[invasion.uint_0] = Struct40.smethod_6(district, invasion.uint_0);
         }
         else
         {
             dictionary2.Add(invasion.uint_0, Struct40.smethod_6(district, invasion.uint_0));
         }
     }
     Struct40.dictionary_3.Remove(district);
 }
Esempio n. 4
0
        // Token: 0x060027BC RID: 10172 RVA: 0x000933C0 File Offset: 0x000915C0
        private void method_8(Class177 district, string cogID, uint cogsRemaining, bool skelecog, DateTime startTime)
        {
            if (district == null)
            {
                throw new ArgumentNullException("district");
            }
            if (string.IsNullOrEmpty(cogID))
            {
                throw new ArgumentNullException("cogID");
            }
            if (!Class464.Cogs.ContainsKey(cogID))
            {
                throw new ArgumentException("The cog type is invalid: " + cogID);
            }
            this.nullable_0 = null;
            uint?num;

            Struct40.smethod_1(district, Class464.Cogs[cogID], cogsRemaining, skelecog, startTime, out num, out startTime);
            startTime = startTime.ToLocalTime();
            if (num != null)
            {
                this.method_6(startTime, num.Value);
            }
            else
            {
                this.lblTimeRemaining.Text = "Unknown";
            }
            this.method_5(startTime);
            this.method_7();
        }
Esempio n. 5
0
 // Token: 0x060026C2 RID: 9922 RVA: 0x0008AB38 File Offset: 0x00088D38
 public static void smethod_3(Class177 district)
 {
     lock (Struct40.object_0)
     {
         if (Struct40.dictionary_3.ContainsKey(district))
         {
             Struct40.smethod_0(district, Struct40.dictionary_3[district], new DateTime?(DateTime.Now));
         }
     }
 }
Esempio n. 6
0
 // Token: 0x060026C1 RID: 9921 RVA: 0x0008AAD8 File Offset: 0x00088CD8
 public static void smethod_2(Class177 district)
 {
     lock (Struct40.object_0)
     {
         if (Struct40.dictionary_3.ContainsKey(district))
         {
             Struct40.smethod_0(district, Struct40.dictionary_3[district], null);
         }
     }
 }
Esempio n. 7
0
 // Token: 0x060026C0 RID: 9920 RVA: 0x0008A9F4 File Offset: 0x00088BF4
 public static void smethod_1(Class177 district, Class464 cog, uint cogsRemaining, bool skelecog, DateTime startTime, out uint?estimatedDuration, out DateTime actualStartTime)
 {
     lock (Struct40.object_0)
     {
         if (Struct40.dictionary_3.ContainsKey(district))
         {
             if (Struct40.dictionary_3[district].class464_0 == cog)
             {
                 actualStartTime   = Struct40.dictionary_3[district].dateTime_0;
                 estimatedDuration = Struct40.dictionary_3[district].nullable_1;
                 return;
             }
             Struct40.smethod_0(district, Struct40.dictionary_3[district], null);
         }
         Struct40 value = new Struct40(cog, cogsRemaining, skelecog, startTime.ToUniversalTime(), estimatedDuration = Struct40.smethod_7(district, cog, cogsRemaining));
         actualStartTime = value.dateTime_0;
         Struct40.dictionary_3.Add(district, value);
     }
 }
Esempio n. 8
0
 // Token: 0x060026CC RID: 9932 RVA: 0x0008B31C File Offset: 0x0008951C
 public static void smethod_13(Stream stream)
 {
     lock (Struct40.object_0)
     {
         Struct40.smethod_11();
         try
         {
             using (Stream3 stream2 = new Stream3(stream))
             {
                 using (BinaryReader binaryReader = new BinaryReader(stream2))
                 {
                     byte[] array = binaryReader.ReadBytes(Struct40.byte_0.Length);
                     if (!array.smethod_9(Struct40.byte_0))
                     {
                         throw new InvalidFileType(Struct40.byte_0, array);
                     }
                     int num = binaryReader.ReadInt32();
                     for (int i = 0; i < num; i++)
                     {
                         Class177 @class = Class177.smethod_0(binaryReader.ReadUInt32());
                         int      num2   = binaryReader.ReadInt32();
                         Dictionary <Class464, Dictionary <uint, uint> > dictionary;
                         if (Struct40.dictionary_0.ContainsKey(@class))
                         {
                             dictionary = Struct40.dictionary_0[@class];
                         }
                         else
                         {
                             Struct40.dictionary_0.Add(@class, dictionary = new Dictionary <Class464, Dictionary <uint, uint> >());
                         }
                         Dictionary <Class464, Dictionary <uint, List <uint> > > dictionary2;
                         if (Struct40.dictionary_2.ContainsKey(@class))
                         {
                             dictionary2 = Struct40.dictionary_2[@class];
                         }
                         else
                         {
                             Struct40.dictionary_2.Add(@class, dictionary2 = new Dictionary <Class464, Dictionary <uint, List <uint> > >());
                         }
                         Dictionary <uint, uint> dictionary3;
                         if (Struct40.dictionary_1.ContainsKey(@class))
                         {
                             dictionary3 = Struct40.dictionary_1[@class];
                         }
                         else
                         {
                             Struct40.dictionary_1.Add(@class, dictionary3 = new Dictionary <uint, uint>());
                         }
                         for (int j = 0; j < num2; j++)
                         {
                             Class464 key  = Class464.Cogs[binaryReader.ReadString()];
                             int      num3 = binaryReader.ReadInt32();
                             Dictionary <uint, uint> dictionary4;
                             if (dictionary.ContainsKey(key))
                             {
                                 dictionary4 = dictionary[key];
                             }
                             else
                             {
                                 dictionary.Add(key, dictionary4 = new Dictionary <uint, uint>());
                             }
                             Dictionary <uint, List <uint> > dictionary5;
                             if (dictionary2.ContainsKey(key))
                             {
                                 dictionary5 = dictionary2[key];
                             }
                             else
                             {
                                 dictionary2.Add(key, dictionary5 = new Dictionary <uint, List <uint> >());
                             }
                             for (int k = 0; k < num3; k++)
                             {
                                 uint        key2 = binaryReader.ReadUInt32();
                                 int         num4 = binaryReader.ReadInt32();
                                 List <uint> list;
                                 if (dictionary5.ContainsKey(key2))
                                 {
                                     list = dictionary5[key2];
                                 }
                                 else
                                 {
                                     dictionary5.Add(key2, list = new List <uint>());
                                 }
                                 uint num5 = 0U;
                                 for (int l = 0; l < num4; l++)
                                 {
                                     uint num6 = binaryReader.ReadUInt32();
                                     list.Add(num6);
                                     num5 += num6;
                                 }
                                 num5 /= (uint)num4;
                                 dictionary4.Add(key2, num5);
                             }
                             foreach (uint num7 in dictionary5.Keys)
                             {
                                 if (dictionary3.ContainsKey(num7))
                                 {
                                     dictionary3[num7] = Struct40.smethod_6(@class, num7);
                                 }
                                 else
                                 {
                                     dictionary3.Add(num7, Struct40.smethod_6(@class, num7));
                                 }
                             }
                         }
                     }
                 }
             }
         }
         catch
         {
             Struct40.smethod_11();
             throw;
         }
     }
 }
Esempio n. 9
0
 // Token: 0x060027BD RID: 10173 RVA: 0x00011F36 File Offset: 0x00010136
 private void method_9(Class177 district)
 {
     Struct40.smethod_3(district);
 }