Пример #1
0
    public static void AddToReview(int pointId)
    {
        //Server.GetInstance().Submit(pointId,false);
        ReviewRecord reviewRecord;

        if (currentRole.reviews.ContainsKey(pointId))
        {
            reviewRecord        = currentRole.reviews[pointId];
            reviewRecord.times += 1;
        }
        else
        {
            reviewRecord         = new ReviewRecord();
            reviewRecord.times   = 1;
            reviewRecord.pointId = pointId;
            currentRole.reviews.Add(pointId, reviewRecord);
        }
        reviewRecord.ticks = GetReviewTicks(reviewRecord.times);

        reviewRecord.ticks = GetReviewTicks(reviewRecord.times);
        Review review = new Review(Role.currentRole.id, Role.sn, reviewRecord);
        string msg    = review.id + "|" + JsonMapper.ToJson(review);

        Debug.LogError(msg);
        (StudentLogin.GetInstance()).SendMsg(msg);
    }
Пример #2
0
 public static void AddToReviewByDialog(int sentenceId)
 {
     Dictionary <int, Point> .Enumerator iter = Point.points.GetEnumerator();
     while (iter.MoveNext())
     {
         if (iter.Current.Value.sentenceId == sentenceId)
         {
             ReviewRecord reviewRecord;
             if (currentRole.reviews.ContainsKey(iter.Current.Value.id))
             {
                 reviewRecord        = currentRole.reviews[iter.Current.Value.id];
                 reviewRecord.times += 1;
             }
             else
             {
                 reviewRecord         = new ReviewRecord();
                 reviewRecord.times   = 1;
                 reviewRecord.pointId = iter.Current.Value.id;
                 currentRole.reviews.Add(reviewRecord.pointId, reviewRecord);
             }
             //Server.GetInstance().Submit(iter.Current.Value.id,Role.currentRole.isReview);
             reviewRecord.ticks = GetReviewTicks(reviewRecord.times);
             Review review = new Review(Role.currentRole.id, Role.sn, reviewRecord);
             string msg    = review.id + "|" + JsonMapper.ToJson(review);
             Debug.LogError(msg);
             (StudentLogin.GetInstance()).SendMsg(msg);
         }
     }
 }