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; }
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(); }
/// <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()); }
///<summary> /// Returns a String that represents the current object. ///</summary> public override string ToString() { return("GradeID:" + GradeID.ToString()); }