private void DescribeLevelRating(Checkride er, RatingLevel newLevel) { er.Level = newLevel; switch (er.Level) { case RatingLevel.Sport: er.LicenseKind = LicenseKind.Sport; currentLevel = AddToDictionary(currentLevel, newLevel, dictSport, er); break; case RatingLevel.Recreational: er.LicenseKind = LicenseKind.Recreational; currentLevel = AddToDictionary(currentLevel, newLevel, dictRecreational, er); break; case RatingLevel.Private: er.LicenseKind = LicenseKind.Private; currentLevel = AddToDictionary(currentLevel, newLevel, dictPrivate, er); break; case RatingLevel.Commercial: er.LicenseKind = LicenseKind.Commercial; currentLevel = AddToDictionary(currentLevel, newLevel, dictCommercial, er); break; case RatingLevel.ATP: er.LicenseKind = LicenseKind.ATP; currentLevel = AddToDictionary(currentLevel, newLevel, dictATP, er); break; default: break; } }
public Checkride() { FlightID = LogbookEntry.idFlightNone; DateEarned = DateTime.MinValue; CheckrideType = CheckrideType.NewRating; Privilege = string.Empty; LicenseKind = LicenseKind.Unknown; Level = RatingLevel.None; }
public string Description; //tell us why you rated it that way public KnowledgeBaseRating() { this.Rating = RatingLevel.Unknown; this.Language = false; this.Sexual = false; this.Violence = false; this.Other = false; this.Description = ""; }
private static RatingLevel AddToDictionary(RatingLevel currentLevel, RatingLevel newLevel, Dictionary <string, Checkride> dict, Checkride er) { newLevel = ((int)newLevel > (int)currentLevel) ? newLevel : currentLevel; if (!dict.ContainsKey(er.Privilege)) { er.CheckrideType = (dict.Count == 0) ? CheckrideType.NewRating : CheckrideType.AdditionalPrivilege; dict[er.Privilege] = er; } return(newLevel); }
protected KnowledgeBaseRating(SerializationInfo info, StreamingContext context) { this.Rating = (RatingLevel)info.GetValue("r", typeof(RatingLevel)); this.Language = info.GetBoolean("l"); this.Sexual = info.GetBoolean("s"); this.Violence = info.GetBoolean("v"); this.Other = info.GetBoolean("o"); this.Description = info.GetString("d"); //use a try/catch block around any new vales }
public static RatingLevel CreateRatingLevel(string ratingLevelId, string ratingModelId, int factor, global::Microsoft.Dynamics.DataEntities.RatingModel ratingModel) { RatingLevel ratingLevel = new RatingLevel(); ratingLevel.RatingLevelId = ratingLevelId; ratingLevel.RatingModelId = ratingModelId; ratingLevel.Factor = factor; if ((ratingModel == null)) { throw new global::System.ArgumentNullException("ratingModel"); } ratingLevel.RatingModel = ratingModel; return(ratingLevel); }
public bool Violence; //people getting hurt by others (fictional or based on reality?) #endregion Fields #region Constructors public KnowledgeBaseRating() { this.Rating = RatingLevel.Unknown; this.Language = false; this.Sexual = false; this.Violence = false; this.Other = false; this.Description = ""; }