コード例 #1
0
 public Materia(MateriaID materia_id, ItemID item_id, StatusID status_id, GradeID grade_id, int value)
 {
     if (materia_id == MateriaID.None)
     {
         throw new ArgumentException();
     }
     if (item_id == ItemID.None)
     {
         throw new ArgumentException();
     }
     if (status_id == StatusID.None)
     {
         throw new ArgumentException();
     }
     if (grade_id == GradeID.None)
     {
         throw new ArgumentException();
     }
     if (value <= 0)
     {
         throw new ArgumentException();
     }
     MateriaID = materia_id;
     ItemID    = item_id;
     StatusID  = status_id;
     GradeID   = grade_id;
     Value     = value;
 }
コード例 #2
0
 public Grade(GradeID grade_id, MultiLanguageString name, IEnumerable <double> success_rate_nq, IEnumerable <double> success_rate_hq)
 {
     if (grade_id == GradeID.None)
     {
         throw new ArgumentException();
     }
     if (success_rate_nq == null)
     {
         throw new ArgumentNullException();
     }
     if (success_rate_hq == null)
     {
         throw new ArgumentNullException();
     }
     GradeID       = grade_id;
     Name          = name;
     SuccessRateNQ = success_rate_nq.ToArray();
     SuccessRateHQ = success_rate_hq.ToArray();
 }
コード例 #3
0
 /// <summary>
 /// Serves as a hash function for a particular type. GetHashCode() is suitable
 /// for use in hashing algorithms and data structures like a hash table.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(GradeID.GetHashCode());
 }
コード例 #4
0
 ///<summary>
 /// Returns a String that represents the current object.
 ///</summary>
 public override string ToString()
 {
     return("GradeID:" + GradeID.ToString());
 }