Exemplo n.º 1
0
        private void GetPatches()
        {
            patches = new SortedSet <GamePatch>();
            foreach (var s in Spreadsheet.Sheets)
            {
                var number = GamePatchNumber.Parse(s.Properties.Title);
                var values = Service.Spreadsheets.Values.Get(Spreadsheet.SpreadsheetId, $"{s.Properties.Title}!A5:A").Execute();

                Console.Write($"\n{number}");

                var patch = new GamePatch(number);
                patches.Add(patch);

                if (values.Values == null)
                {
                    continue;
                }

                var firstDay = DateTime.MaxValue;
                var lastDay  = DateTime.MinValue;
                foreach (var d in values.Values)
                {
                    if (d.Count == 0)
                    {
                        continue;
                    }

                    var day = DateTime.ParseExact(d[0].ToString(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
                    if (day < firstDay)
                    {
                        firstDay = day;
                    }
                    if (day > lastDay)
                    {
                        lastDay = day;
                    }
                }
                patch.FirstPatchDay = firstDay;
                patch.LastPatchDay  = lastDay;
                Console.Write($": {firstDay:dd/MM/yyyy} - {lastDay:dd/MM/yyyy}");
            }
            Console.WriteLine();
        }
Exemplo n.º 2
0
 public GamePatch(GamePatchNumber patchNumber, DateTime firstDay, int patchDuration = DefaultPatchDuration)
     : this(patchNumber, firstDay, firstDay.AddDays(patchDuration - 1))
 {
 }
Exemplo n.º 3
0
 public GamePatch(GamePatchNumber patchNumber, DateTime firstDay, DateTime lastDay)
 {
     PatchNumber   = patchNumber;
     FirstPatchDay = firstDay;
     LastPatchDay  = lastDay;
 }
Exemplo n.º 4
0
 public GamePatch(GamePatchNumber patchNumber)
     : this(patchNumber, default)
 {
 }