Example #1
0
 public ResultCard(Guid cardId, int heap, DateTime lastLearnUtcTime, DateTime addToDeckUtcTime, int biggestHeapReached, int nbTimesInNotLearnedHeap,
                   string frontSide, string backSide, string additionalInfo, DateTime lastChangeUtcTime, string owner, IEnumerable <string> tags, IEnumerable <string> visibleTo,
                   IEnumerable <ResultImageModel> images, HeapingAlgorithm heapingAlgorithm, int userRating, double averageRating, int countOfUserRatings, bool registeredForNotifications)
 {
     DateServices.CheckUTC(lastLearnUtcTime);
     CardId                     = cardId;
     Heap                       = heap;
     LastLearnUtcTime           = lastLearnUtcTime;
     LastChangeUtcTime          = lastChangeUtcTime;
     AddToDeckUtcTime           = addToDeckUtcTime;
     BiggestHeapReached         = biggestHeapReached;
     NbTimesInNotLearnedHeap    = nbTimesInNotLearnedHeap;
     Owner                      = owner;
     FrontSide                  = frontSide;
     BackSide                   = backSide;
     AdditionalInfo             = additionalInfo;
     Tags                       = tags;
     VisibleTo                  = visibleTo;
     Images                     = images;
     UserRating                 = userRating;
     AverageRating              = averageRating;
     CountOfUserRatings         = countOfUserRatings;
     RegisteredForNotifications = registeredForNotifications;
     MoveToHeapExpiryInfos      = Enumerable.Range(1, MoveCardToHeap.MaxTargetHeapId)
                                  .Where(heapId => heapId != heap)
                                  .Select(targetHeapForMove => new MoveToHeapExpiryInfo(targetHeapForMove, heapingAlgorithm.ExpiryUtcDate(targetHeapForMove, lastLearnUtcTime)))
                                  .Concat(new[] { new MoveToHeapExpiryInfo(0, DateTime.MinValue.ToUniversalTime()) });
 }
Example #2
0
 public ViewModel(Guid cardId, int currentHeap, DateTime lastLearnUtcTime, int biggestHeapReached, int nbTimesInNotLearnedHeap, string frontSide, string backSide /*, IEnumerable<string> tags*/)
 {
     DateServices.CheckUTC(lastLearnUtcTime);
     this.cardId                  = cardId;
     this.currentHeap             = currentHeap;
     this.lastLearnTime           = lastLearnUtcTime.ToString("g");
     this.biggestHeapReached      = biggestHeapReached;
     this.frontSide               = frontSide;
     this.backSide                = backSide;
     this.nbTimesInNotLearnedHeap = nbTimesInNotLearnedHeap.ToString();
 }
Example #3
0
 public SearchResultCard(Guid cardId, string frontSide, IEnumerable <string> tags, DateTime?expiryUtcDate, DateTime lastLearnUtcDate, DateTime addToDeckUtcTime, bool expired,
                         int heap, int nbTimesInNotLearnedHeap, int biggestHeapReached, IEnumerable <string> visibleTo)
 {
     if (expiryUtcDate != null)
     {
         DateServices.CheckUTC(expiryUtcDate.Value);
     }
     CardId                  = cardId;
     FrontSide               = frontSide;
     Tags                    = tags;
     ExpiryUtcDate           = expiryUtcDate;
     LastLearnUtcDate        = lastLearnUtcDate;
     AddToDeckUtcTime        = addToDeckUtcTime;
     Expired                 = expired;
     Heap                    = heap;
     NbTimesInNotLearnedHeap = nbTimesInNotLearnedHeap;
     BiggestHeapReached      = biggestHeapReached;
     VisibleTo               = visibleTo;
 }
Example #4
0
 public ResultModel(Guid cardId, int heap, DateTime lastLearnUtcTime, DateTime addToDeckUtcTime, int biggestHeapReached, int nbTimesInNotLearnedHeap,
                    string frontSide, string backSide, string additionalInfo, DateTime lastChangeUtcTime, string?owner, IEnumerable <string> tags, IEnumerable <string> visibleTo, IEnumerable <ResultImageModel> images)
 {
     DateServices.CheckUTC(lastLearnUtcTime);
     CardId                  = cardId;
     Heap                    = heap;
     LastLearnUtcTime        = lastLearnUtcTime;
     LastChangeUtcTime       = lastChangeUtcTime;
     AddToDeckUtcTime        = addToDeckUtcTime;
     BiggestHeapReached      = biggestHeapReached;
     NbTimesInNotLearnedHeap = nbTimesInNotLearnedHeap;
     Owner                   = owner;
     FrontSide               = frontSide;
     BackSide                = backSide;
     AdditionalInfo          = additionalInfo;
     Tags                    = tags;
     VisibleTo               = visibleTo;
     Images                  = images;
 }