Example #1
0
    public static JObject ToJson(QuestStatisticsUnit qsu)
    {
        JObject jsonQsu = new JObject(
            new JProperty("_idUser", qsu.AssociatedUser.Id),
            new JProperty("comment", qsu.Comment),
            new JProperty("mark", qsu.Mark)
            );

        return(jsonQsu);
    }
 /// <summary>
 /// Adds the comment.
 /// If a comment from the same <see cref="User"/> was already in Collection, previous is erased by the new one.
 /// </summary>
 /// <param name="qsu">The qsu.</param>
 /// <returns>
 /// true if the size of marks increases
 /// false if the size of marks remains
 /// </returns>
 public bool AddComment(QuestStatisticsUnit qsu)
 {
     if (marks.Contains(qsu))
     {
         marks.Remove(qsu);
         marks.Add(qsu);
         return false;
     }
     else
     {
         marks.Add(qsu);
         return true;
     }
 }
Example #3
0
 protected bool Equals(QuestStatisticsUnit other)
 {
     return(associatedUser.Equals(other.associatedUser) && quest.Equals(other.quest));
 }