public static string RandomDisplayName(GenderEnum genderEnum) { var personGenerator = new PersonNameGenerator(); string displayName = string.Empty; switch (genderEnum) { case GenderEnum.Female: displayName = personGenerator.GenerateRandomFemaleFirstAndLastName(); break; case GenderEnum.Male: displayName = personGenerator.GenerateRandomMaleFirstAndLastName(); break; case GenderEnum.Other: displayName = personGenerator.GenerateRandomFirstAndLastName(); break; default: displayName = personGenerator.GenerateRandomFirstAndLastName(); break; } return(displayName); }
public void UpdateAthleteProfile(int athleteID, string newName, GenderEnum gender, DateTime?dob = null) { if (newName == null) { newName = ""; } if (newName != "" && dob != null) { List <Athlete> existingAthletes = (from a in db.Athletes where string.Compare(a.Name, newName, true) == 0 where a.Gender == (int)gender where a.AthleteID != athleteID where a.DOB == dob select a).ToList(); if (existingAthletes.Count > 0) { throw new Exception("Such athlete already exists"); } } Athlete athlete = db.Athletes.SingleOrDefault(i => i.AthleteID == athleteID); athlete.Name = newName; athlete.DOB = dob; athlete.Gender = (int)gender; athlete.TimeModified = DateTime.UtcNow; db.SaveChanges(); }
public Teacher(string name, string address, int salery, GenderEnum gender) : base(name, address, gender) { Name = name; Address = address; Salery = salery; Gender = gender; }
public PAPICharacter(string _archetype, Species _species, Value _soak, ThresholdValue _health, Defense _defense, CharacteristicSet _characteristics, Equipment _equipment, Inventory _inventory, List <PAPISkill> _skillSet, List <Ability> _abilities, Career _career, CharacterAppearance _appearance, GenderEnum _gender, List <GenderEnum> _genderPreferences) { this._archetype = (_archetype == null || _archetype == "") ? "Townspeople" : _archetype; this._species = (_species == null) ? SpeciesHandler.GetSpecies(SpeciesEnum.HUMAN) : _species; this._soak = (_soak == null) ? new Value(0, null) : _soak; this._characteristics = (_characteristics == null) ? new CharacteristicSet() : _characteristics; this._health = (_health == null) ? new ThresholdValue(SpeciesHandler.GetInitialHealth(this._species._enum)) : _health; this._defense = (_defense == null) ? new Defense(0, null, 0, null) : _defense; this._equipment = (_equipment == null) ? new Equipment(null, null, null, null) : _equipment; this._inventory = (_inventory == null) ? new Inventory(null, null) : _inventory; this._skillSet = (_skillSet == null) ? new List <PAPISkill>() : _skillSet; this._abilities = (_abilities == null) ? new List <Ability>() : _abilities; this._career = _career; this._appearance = (_appearance == null) ? new CharacterAppearance(SpeciesHandler.GetAverageAppearance(this._species._enum)) : _appearance; this._gender = _gender; this._genderPreferences = (_genderPreferences == null || _genderPreferences.Count == 0) ? new List <GenderEnum>() { GenderEnum.NONE } : _genderPreferences; WfLogger.Log(this, LogLevel.DETAILED, "Created new Character (" + this._species._enum + " " + this._archetype + ")"); }
public Person ( int pId, string pName, string pSurname, DateTime dob, GenderEnum pGender, string pAreaCode, string pAddress, string pPhoneNum, bool pUserAccess, string pProvinceName, string pCityName, string pCountryname, string pContinent, string pGpsCoOrdinatesLat, string pGpsCoOrdinatesLong, string pNationAnimalID ) { this.pId = pId; this.pName = pName; this.pSurname = pSurname; this.dob = dob; this.pGender = pGender; this.pAreaCode = pAreaCode; this.pAddress = pAddress; this.pPhoneNum = pPhoneNum; this.pUserAccess = pUserAccess; this.pProvinceName = pProvinceName; this.pCityName = pCityName; this.pCountryname = pCountryname; this.pContinent = pContinent; this.pGpsCoOrdinatesLat = pGpsCoOrdinatesLat; this.pGpsCoOrdinatesLong = pGpsCoOrdinatesLong; this.pNationAnimalID = pNationAnimalID; }
/// <summary> /// Initializes a new instance of the <see cref="Name" /> class. /// </summary> /// <param name="firstName">The first name. (required).</param> /// <param name="gender">The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. (required).</param> /// <param name="infix">The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed..</param> /// <param name="lastName">The last name. (required).</param> public Name(string firstName = default(string), GenderEnum gender = default(GenderEnum), string infix = default(string), string lastName = default(string)) { // to ensure "firstName" is required (not null) if (firstName == null) { throw new InvalidDataException("firstName is a required property for Name and cannot be null"); } else { this.FirstName = firstName; } // to ensure "gender" is required (not null) if (gender == null) { throw new InvalidDataException("gender is a required property for Name and cannot be null"); } else { this.Gender = gender; } // to ensure "lastName" is required (not null) if (lastName == null) { throw new InvalidDataException("lastName is a required property for Name and cannot be null"); } else { this.LastName = lastName; } this.Infix = infix; }
public PrintMeMessage(string name, GenderEnum gender, int capital, string path) { Name = name; Gender = gender; Capital = capital; Path = path; }
public Man(string name, int age, GenderEnum gender, double weight) { Name = name; Age = age; Gender = gender; Weight = weight; }
public Student(string name, string address, int semester, GenderEnum gender) : base(name, address, gender) { Name = name; Address = address; Semester = semester; Gender = gender; }
//Warning! This method causes side-effects... private async Task <Tuple <GenderEnum, double> > ObtainFaceDemographics(Bitmap faceBitmap) { using (MemoryStream stream = new MemoryStream()) { faceBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); stream.Position = 0; try { //Console.WriteLine("Processing Oxford Request beginning"); var faces = await _FaceServiceClient.DetectAsync(stream, false, true, DefaultFaceAttributes); if (faces != null && faces.Count() > 0) { var currentFace = faces[0]; GenderEnum gender = currentFace.FaceAttributes.Gender.ToLower() == "male" ? GenderEnum.Male : GenderEnum.Female; return(Tuple.Create(gender, currentFace.FaceAttributes.Age)); } } catch (Exception ex) { _CurrentFailureCount++; #if DEBUG Console.WriteLine("Processing Oxford Request failed with : {0}", ex.Message); #endif await Task.Delay(3500); } } return(null); }
public static double CalcWma( int age, GenderEnum gender, double distance, int hours, int mins, int secs ) { var standardTime = GetTime( age, gender, distance ); double actualTime = (((hours * 60) + mins) * 60) + secs; var wmaScore = standardTime / actualTime; return wmaScore; }
/// <summary> /// Initializes a new instance of the <see cref="Name" /> class. /// </summary> /// <param name="FirstName">The first name. (required).</param> /// <param name="Gender">The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. (required).</param> /// <param name="Infix">The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed..</param> /// <param name="LastName">The last name. (required).</param> public Name(string FirstName = default(string), GenderEnum Gender = default(GenderEnum), string Infix = default(string), string LastName = default(string)) { // to ensure "FirstName" is required (not null) if (FirstName == null) { throw new InvalidDataException("FirstName is a required property for Name and cannot be null"); } else { this.FirstName = FirstName; } // to ensure "Gender" is required (not null) if (Gender == null) { throw new InvalidDataException("Gender is a required property for Name and cannot be null"); } else { this.Gender = Gender; } // to ensure "LastName" is required (not null) if (LastName == null) { throw new InvalidDataException("LastName is a required property for Name and cannot be null"); } else { this.LastName = LastName; } this.Infix = Infix; }
public bool Register(long uId, GenderEnum gender, string nickName, string avatarUrl, string country, string province, string city) { var sql = @"UPDATE dbo.UserInfo SET Gender =@Gender, NickName = @NickName, Portrait = @Portrait, Country = @Country, Province = @Province, City = @City, IsRegister =1, UpdateTime = @UpdateTime WHERE Uid=@Uid"; using var Db = GetDbConnection(); return(Db.Execute(sql, new { Uid = uId, Gender = gender, NickName = nickName, Portrait = avatarUrl, Country = country, Province = province, City = city, UpdateTime = DateTime.Now }) > 0); }
private string BuildUrlByParams(GenderEnum gender, CountryEnum country, string url) { string genderValue = gender.ToString(); return(string.Format("{0}/gender={1}®ion={2}", url, genderValue, "portugal")); //return string.Format("{0}/gender={1}®ion={2}", url, genderValue, "portugal"); }
public void UpdateSheep(string breedId, GenderEnum gender, GrowthStageEnum growthStage, OriginEnum origin, float?birthWeight, int compatriotNumber, DateTime?birthDay, float?ablactationWeight, DateTime?ablactationDate, string fatherId, string motherId, string sheepfoldId, SheepStatusEnum sheepStatusEnum, string principalId, string remark, string id) { string sql = "update \"T_Sheep\" set \"BreedId\"=:breedId,\"Gender\"=:gender,\"GrowthStage\"=:growthStage,\"SheepfoldId\"=:sheepfoldId,\"BirthWeight\"=:birthWeight,\"CompatriotNumber\"=:compatriotNumber,\"Birthday\"=:birthday,\"Origin\"=:origin, \"AblactationWeight\"=:ablactationWeight,\"AblactationDate\"=:ablactationDate,\"FatherId\"=:fatherId,\"MotherId\"=:motherId,\"Status\"=:status,\"PrincipalId\"=:principalId,\"Remark\"=:remark where \"Id\"=:id"; IDbParameters pms = AdoTemplate.CreateDbParameters(); pms.AddWithValue("breedId", breedId); pms.AddWithValue("gender", (int)gender); pms.AddWithValue("growthStage", (int)growthStage); pms.AddWithValue("sheepfoldId", sheepfoldId); pms.AddWithValue("birthWeight", birthWeight); pms.AddWithValue("compatriotNumber", compatriotNumber); pms.AddWithValue("birthday", birthDay); pms.AddWithValue("origin", (int)origin); pms.AddWithValue("ablactationWeight", ablactationWeight); pms.AddWithValue("ablactationDate", ablactationDate); pms.AddWithValue("fatherId", fatherId); pms.AddWithValue("motherId", motherId); pms.AddWithValue("status", (int)sheepStatusEnum); pms.AddWithValue("principalId", principalId); pms.AddWithValue("remark", remark); pms.AddWithValue("id", id); AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms); }
public void AddSheep(string id, string serialNumber, string breedId, GenderEnum gender, GrowthStageEnum growthStage, OriginEnum origin, float?birthWeight, int compatriotNumber, DateTime?birthDay, string fatherId, string motherId, string sheepfoldId, SheepStatusEnum sheepStatusEnum, string principalId, string operatorId, DateTime createTime, string remark) { string sql = "INSERT into \"T_Sheep\" (\"Id\",\"SerialNumber\",\"BreedId\",\"Gender\",\"GrowthStage\",\"SheepfoldId\",\"BirthWeight\",\"CompatriotNumber\",\"Birthday\",\"Origin\",\"FatherId\",\"MotherId\",\"Status\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:id,:serialNumber,:breedId,:gender,:growthStage,:sheepfoldId,:birthWeight,:compatriotNumber,:birthday,:origin,:fatherId,:motherId,:status,:principalId,:operaterId,:createTime,:remark)"; IDbParameters pms = AdoTemplate.CreateDbParameters(); pms.AddWithValue("id", id); pms.AddWithValue("serialNumber", serialNumber); pms.AddWithValue("breedId", breedId); pms.AddWithValue("gender", (int)gender); pms.AddWithValue("growthStage", (int)growthStage); pms.AddWithValue("sheepfoldId", sheepfoldId); pms.AddWithValue("birthWeight", birthWeight); pms.AddWithValue("compatriotNumber", compatriotNumber); pms.AddWithValue("birthday", birthDay); pms.AddWithValue("origin", (int)origin); pms.AddWithValue("fatherId", fatherId); pms.AddWithValue("motherId", motherId); pms.AddWithValue("status", (int)sheepStatusEnum); pms.AddWithValue("principalId", principalId); pms.AddWithValue("operaterId", operatorId); pms.AddWithValue("createTime", createTime); pms.AddWithValue("remark", remark); AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms); }
/// <summary> /// Initializes a new instance of the <see cref="Name" /> class. /// </summary> /// <param name="firstName">The first name. (required).</param> /// <param name="gender">The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. (required).</param> /// <param name="infix">The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed..</param> /// <param name="lastName">The last name. (required).</param> public Name(string firstName, GenderEnum gender, string infix, string lastName) { // to ensure "FirstName" is required (not null) if (firstName == null) { throw new ArgumentNullException("FirstName is a required property for Name and cannot be null"); } else { this.FirstName = firstName; } this.Gender = gender; // to ensure "LastName" is required (not null) if (lastName == null) { throw new ArgumentNullException("LastName is a required property for Name and cannot be null"); } else { this.LastName = lastName; } this.Infix = infix; }
public Gender(int id, GenderEnum genderEnum, string label, Language language) : base() { ID = id; GenderEnum = genderEnum; Label = label; Language = language; }
public Animal(string name, string color, int age, GenderEnum gender) { Name = name; Color = color; Age = age; Gender = gender; }
/// <summary> /// Initializes a new instance of the <see cref="SynthesizeVoiceType" /> class. /// </summary> /// <param name="Id">Voice id (required).</param> /// <param name="Name">Name of voice (required).</param> /// <param name="Gender">Gender of voice (required).</param> public SynthesizeVoiceType(string Id = default(string), string Name = default(string), GenderEnum Gender = default(GenderEnum)) { // to ensure "Id" is required (not null) if (Id == null) { throw new InvalidDataException("Id is a required property for SynthesizeVoiceType and cannot be null"); } else { this.Id = Id; } // to ensure "Name" is required (not null) if (Name == null) { throw new InvalidDataException("Name is a required property for SynthesizeVoiceType and cannot be null"); } else { this.Name = Name; } // to ensure "Gender" is required (not null) if (Gender == null) { throw new InvalidDataException("Gender is a required property for SynthesizeVoiceType and cannot be null"); } else { this.Gender = Gender; } }
public void Create_InvalidDataShouldFail(GenderEnum gender, int line) { Assert.Throws <Exception>(() => { var actual = new PersonalCodeModel(date, gender, line); }); }
public static List <Cattle> GetUserAnimals(int UId, int AnimalID) { ac.OpenConnection(); List <Cattle> cattle = new List <Cattle>(); //parameter and variable of this Procedure string[] variables = new string[] { "@UID", "@AnimalID" }; string[] values = new string[] { "" + UId, "" + AnimalID }; //get data from database DataTable data = ac.ExecuteDataTableProcedure("GetOneAnimal", variables, values, ac); if (data.Rows.Count != 0) { foreach (DataRow row in data.Rows) { //offspring List <Cattle> offSpring = new List <Cattle>(); //frame size FrameSize frmeSize = (FrameSize)Enum.Parse(typeof(FrameSize), row["CattleFrameSize"].ToString()); //Breeding status BreedingStatus bStatus = (BreedingStatus)Enum.Parse(typeof(BreedingStatus), row["CattleBreedingStatus"].ToString()); //Status Enum StatusEnum sStatus = (StatusEnum)Enum.Parse(typeof(StatusEnum), row["AnimalStatus"].ToString()); //Gender Enum GenderEnum gEnum = (GenderEnum)Enum.Parse(typeof(GenderEnum), row["AnimalGender"].ToString()); //animal type AnimalTypeEnum animalType = (AnimalTypeEnum)Enum.Parse(typeof(AnimalTypeEnum), row["AnimalType"].ToString()); cattle.Add ( new Cattle ( int.Parse(row["AnimalTid"].ToString()), row["AnimalBreed"].ToString(), gEnum, double.Parse(row["AnimalAge"].ToString()), int.Parse(row["AnimalYear"].ToString()), int.Parse(row["AnimalMonth"].ToString()), int.Parse(row["AnimalDay"].ToString()), animalType, row[4].ToString(), row[5].ToString(), (int)(Math.Round(double.Parse(row["AnimalAge"].ToString()) / 24)), int.Parse(row["personid"].ToString()), row["personname"].ToString(), row["personSurname"].ToString(), DateTime.Parse(row["personDOB"].ToString()), int.Parse(row["CattleID"].ToString()), int.Parse(row["CattleParentFatherID"].ToString()), int.Parse(row["CattleParentMotherID"].ToString()), (row["CattleImage"].ToString()) , offSpring, sStatus, double.Parse(row["CattleScotralSize"].ToString()), row["CattleColor"].ToString(), bStatus, frmeSize, double.Parse(row["CattleBirthWeight"].ToString()), double.Parse(row["CattleWeaningWeight"].ToString()), double.Parse(row["CattlePostWeaningWeight"].ToString()), double.Parse(row["CattleAdultSxWeight"].ToString()), double.Parse(row["CattleCurrentAdultWeight"].ToString()), DateTime.Parse(row["CattleCurrentWeightDateTaken"].ToString()), null, null, null )); } } return(cattle); }
public PoemState(TombComponent tombComponent) { Gender = GenderEnum.Undefined; _tombComponent = tombComponent; AudioController.GetInstance().FadeInPercussion(); IconMarkerComponent.HideAll(); }
/// <summary> /// Initializes a new instance of the <see cref="TTSInfoVoices" /> class. /// </summary> /// <param name="gender">Gender of the voice (required).</param> /// <param name="id">Voice id of the voice (required).</param> /// <param name="languageCode">Language code of the voice (required).</param> /// <param name="languageName">Language of the voice (required).</param> /// <param name="name">Name of the voice (required).</param> /// <param name="supportedEngines">Supported engines for the voice. This option will be available only when TTSProvider is Amazon Polly.</param> /// <param name="tTSProvider">TTS provider for the voice (required).</param> /// <param name="speakingStyle">Supported speaking styles for the voice. This option will be available only when TTSProvider is Amazon Polly, engine is neural, and voiceIds are one of the following - Matthew, Joanna, Lupe.</param> public TTSInfoVoices(GenderEnum gender = default(GenderEnum), string id = default(string), string languageCode = default(string), string languageName = default(string), string name = default(string), List <SupportedEnginesEnum> supportedEngines = default(List <SupportedEnginesEnum>), TTSProviderEnum tTSProvider = default(TTSProviderEnum), List <SpeakingStyleEnum> speakingStyle = default(List <SpeakingStyleEnum>)) { this.Gender = gender; // to ensure "id" is required (not null) if (id == null) { throw new ArgumentNullException("id is a required property for TTSInfoVoices and cannot be null"); } this.Id = id; // to ensure "languageCode" is required (not null) if (languageCode == null) { throw new ArgumentNullException("languageCode is a required property for TTSInfoVoices and cannot be null"); } this.LanguageCode = languageCode; // to ensure "languageName" is required (not null) if (languageName == null) { throw new ArgumentNullException("languageName is a required property for TTSInfoVoices and cannot be null"); } this.LanguageName = languageName; // to ensure "name" is required (not null) if (name == null) { throw new ArgumentNullException("name is a required property for TTSInfoVoices and cannot be null"); } this.Name = name; this.TTSProvider = tTSProvider; this.SupportedEngines = supportedEngines; this.SpeakingStyle = speakingStyle; }
private void AddCharacter(string name, GenderEnum gender, StatusEnum status, string statusMessage = null) { var character = GetCharacter(name); character.Gender = gender; character.Status = status; character.StatusMessage = statusMessage; }
private void FilterByGender(GenderEnum gender) { var testers = from tester in TestersList where tester.Gender == gender select tester; testerDataGrid.ItemsSource = testers; }
public void GetEnumDescription_NoDescription_ShouldReturnEnumName() { GenderEnum enumValue = GenderEnum.Undefined; var description = enumValue.GetDescription(); Assert.False(string.IsNullOrEmpty(description)); Assert.Equal(description, "Undefined"); }
public static double CalcWma(int age, GenderEnum gender, double distance, int hours, int mins, int secs) { var standardTime = GetTime(age, gender, distance); double actualTime = (((hours * 60) + mins) * 60) + secs; var wmaScore = standardTime / actualTime; return(wmaScore); }
public Participant(string lastName, string firstName, DateTime birthDate, GenderEnum gender, string ssn) { LastName = lastName; FirstName = firstName; BirthDate = birthDate; Gender = gender; SSN = ssn; }
private GenderEnum ConvertStringToGenderEnum(string gender) { GenderEnum result = new GenderEnum(); Enum.TryParse(gender, out result); return(result); }
public Animal(string kind, string name, string color, int age, GenderEnum gender) { AnimalKind = kind; AnimalName = name; AnimalColor = color; AnimalAge = age; AnimalGender = gender; }
public static String ToString(GenderEnum gender) { switch (gender) { case GenderEnum.Female: return "Female"; case GenderEnum.Male: return "Male"; default: return ""; } }
public PlayerObject createPlayerObject(RaceEnum objectRace, FactionEnum objectFaction, CreatureEnum objectType, GenderEnum objectGender) { PlayerObject playerObject = new PlayerObject(); playerObject.Scale = 1; playerObject.Velocity = new Vector3(0, 0, 0); playerObject.FactionEnum = objectFaction; playerObject.RaceEnum = objectRace; playerObject.Gender = objectGender; playerObject.Name = NameFactory.getName(objectType, objectGender); this.createBodySettings(playerObject, objectRace, objectGender); return playerObject; }
/// <summary> /// 取得顧問報告 /// </summary> /// <param name="bmi">BMI數值</param> /// <param name="gender">性別</param> /// <returns>報告</returns> private string GetConsultantReport(double bmi, GenderEnum gender) { if (bmi <= this.BMILowerBound) { return gender == GenderEnum.Male ? "竹竿身材" : "模特兒身材"; } else if (bmi >= this.BMIUpperBound) { return gender == GenderEnum.Male ? "神豬體型" : "小叮鈴身材"; } else { return "適中"; } }
/// <summary> /// Create a new student record with all available attributes /// </summary> /// <param name="id"></param> /// <param name="lastName"></param> /// <param name="firstName"></param> /// <param name="dob"></param> /// <param name="gender"></param> /// <param name="major"></param> /// <param name="units"></param> /// <param name="gpa"></param> /// <returns></returns> public Student AddStudent(string id, string lastName, string firstName, DateTime dob, GenderEnum gender, string major, float units, float gpa) { var data = DataStore.LoadData(); Student result = null; var student = GetStudent(id); if (student == null) { // Student doesn't exist result = new Student() { ID = id, LastName = lastName, FirstName = firstName, DOB = dob, Gender = gender, Major = major, Units = units, GPA = gpa }; data.Add(result); DataStore.SaveData(); } return result; }
public NpcObject createNpcObject(RaceEnum objectRace, FactionEnum objectFaction, CreatureEnum objectType, GenderEnum objectGender) { NpcObject npcObject = new NpcObject(); npcObject.Scale = 1; npcObject.Velocity = new Vector3(0, 0, 0); npcObject.FactionEnum = objectFaction; npcObject.RaceEnum = objectRace; npcObject.Gender = objectGender; npcObject.Name = NameFactory.getName(objectType, objectGender); this.createBodySettings(npcObject, objectRace, objectGender); npcObject.Tasks.Add(new Model.Object.Task.Tasks.AttackRandomTask(npcObject, Model.Object.Task.Tasks.TaskPriority.Attack_Random)); //npcObject.Tasks.Add(new Model.Object.Task.Tasks.WalkRandomTask(npcObject, Model.Object.Task.Tasks.TaskPriority.Walk_Random)); return npcObject; }
private void createBodySettings(RaceObject _RaceObject, RaceEnum _ObjectRace, GenderEnum _ObjectGender) { switch (_ObjectRace) { case RaceEnum.Ogre: { _RaceObject.Body = new BodyHuman(); ((BodyHuman)_RaceObject.Body).MainBody.TexturePath = "Character/Ogre1"; _RaceObject.Size = new Vector3(80, 96, 0); _RaceObject.Body.setSize(new Vector3(80, 96, 0)); //npcObject.CollisionBounds.Add(new Rectangle(17 + (int)npcObject.Size.X / 2, 69 + (int)npcObject.Size.Y / 2, 49, 25)); break; } case RaceEnum.Human: { _RaceObject.Body = new BodyHuman(); switch (_ObjectGender) { case GenderEnum.Male: ((BodyHuman)_RaceObject.Body).MainBody.TexturePath = "Character/BodyMale"; break; case GenderEnum.Female: ((BodyHuman)_RaceObject.Body).MainBody.TexturePath = "Character/BodyFemale"; break; } _RaceObject.CollisionBounds.Add(new Rectangle(8, 20, 12, 2)); ((BodyHuman)_RaceObject.Body).Hair.TexturePath = "Character/Hair1"; EquipmentObject var_EquipmentObject_Armor = GameLibrary.Factory.EquipmentFactory.equipmentFactory.createEquipmentArmorObject(GameLibrary.Factory.FactoryEnums.ArmorEnum.GoldenArmor); var_EquipmentObject_Armor.PositionInInventory = 0; _RaceObject.Body.setEquipmentObject(var_EquipmentObject_Armor); EquipmentObject var_EquipmentObject_Sword = GameLibrary.Factory.EquipmentFactory.equipmentFactory.createEquipmentWeaponObject(GameLibrary.Factory.FactoryEnums.WeaponEnum.Sword); var_EquipmentObject_Sword.PositionInInventory = 1; _RaceObject.Body.setEquipmentObject(var_EquipmentObject_Sword); break; } } }
public static string GetGender(GenderEnum data) { switch (data) { case GenderEnum.Female: return "女"; case GenderEnum.Hermaphroditic: return "両性"; case GenderEnum.Male: return "男"; case GenderEnum.None: return "なし"; case GenderEnum.NotObvious: return "不明"; case GenderEnum.Other: return "その他"; } return ""; }
public LivingObject(SerializationInfo info, StreamingContext ctxt) : base(info, ctxt) { this.healthPoints = (float)info.GetValue("healthPoints", typeof(float)); this.maxHealthPoints = (float)info.GetValue("maxHealthPoints", typeof(float)); this.aggroRange = (float)info.GetValue("aggroRange", typeof(float)); this.isDead = (bool)info.GetValue("isDead", typeof(bool)); this.canBeEffected = (bool)info.GetValue("canBeEffected", typeof(bool)); this.gender = (GenderEnum)info.GetValue("gender", typeof(GenderEnum)); aggroSystem = new Task.Aggro.AggroSystem<LivingObject>(); //tasks = new List<LivingObjectTask>(); this.interactions = new List<LivingObjectInteraction>(); //this.aggroSystem = (Task.Aggro.AggroSystem<LivingObject>)info.GetValue("aggroSystem", typeof(Task.Aggro.AggroSystem<LivingObject>)); //TODO: Verändere Methoden, sodass Interaction und Tasks nicht mehr den Owner speichern, sonst gibt es eine Kettenspeicherung bei Serialisierung //this.interactions = (List<LivingObjectInteraction>)info.GetValue("interactions", typeof(List<LivingObjectInteraction>)); this.tasks = (List<LivingObjectTask>)info.GetValue("tasks", typeof(List<LivingObjectTask>)); }
/// <summary> /// Create a new teacher record with all available attributes provided /// </summary> /// <param name="id"></param> /// <param name="lastName"></param> /// <param name="firstName"></param> /// <param name="dob"></param> /// <param name="gender"></param> /// <param name="doh"></param> /// <param name="salary"></param> /// <returns></returns> public Teacher AddTeacher(int id, string lastName, string firstName, DateTime dob, GenderEnum gender, DateTime doh, int salary) { var data = DataStore.LoadData(); Teacher result = null; var teacher = GetTeacher(id); if (teacher == null) { // Teacher doesn't exist result = new Teacher() { ID = id, LastName = lastName, FirstName = firstName, DOB = dob, Gender = gender, DateOfHire = doh, Salary = salary, }; data.Add(result); DataStore.SaveData(); } return result; }
/// <summary> /// Updates all attributes of a students record based on their student ID /// </summary> /// <param name="id"></param> /// <param name="lastName"></param> /// <param name="firstName"></param> /// <param name="dob"></param> /// <param name="gender"></param> /// <param name="major"></param> /// <param name="units"></param> /// <param name="gpa"></param> /// <returns></returns> public Student UpdateStudent(string id, string lastName, string firstName, DateTime dob, GenderEnum gender, string major, float units, float gpa) { // Simplest technique is to remove then add DeleteStudent(id); return AddStudent(id, lastName, firstName, dob, gender, major, units, gpa); }
/// <summary> /// Updates all avalable attributes in teacher's record /// </summary> /// <param name="id"></param> /// <param name="lastName"></param> /// <param name="firstName"></param> /// <param name="dob"></param> /// <param name="gender"></param> /// <param name="doh"></param> /// <param name="salary"></param> /// <returns></returns> public Teacher UpdateTeacher(int id, string lastName, string firstName, DateTime dob, GenderEnum gender, DateTime doh, int salary) { // Simplest technique is to remove then add DeleteTeacher(id); return AddTeacher(id, lastName, firstName, dob, gender, doh, salary); }
private static int[] GetStandardTimes(Distance distance, GenderEnum gender) { var mFiveKilometreTimes = new [] { 1186, 1122, 1068, 1021, 981, 947, 918, 892, 870, 851, 835, 822, 810, 800, 791, 782, 777, 774, 774, 774, 774, 774, 774, 774, 775, 776, 778, 780, 783, 787, 791, 796, 801, 807, 813, 819, 825, 831, 838, 844, 851, 857, 864, 871, 878, 885, 892, 899, 907, 914, 922, 930, 938, 946, 954, 962, 971, 979, 988, 997, 1006, 1016, 1025, 1035, 1046, 1058, 1071, 1085, 1101, 1118, 1137, 1157, 1180, 1205, 1232, 1261, 1293, 1329, 1367, 1410, 1458, 1511, 1569, 1635, 1708, 1791, 1886, 1994, 2119, 2266, 2439, 2645, 2898, 3213, 3613, 4143 }; var mSixKilometreTimes = new [] { 1440, 1363, 1297, 1240, 1192, 1150, 1115, 1084, 1057, 1034, 1014, 998, 984, 972, 960, 950, 944, 940, 940, 940, 940, 940, 940, 940, 941, 942, 945, 947, 951, 955, 960, 966, 973, 980, 987, 995, 1002, 1010, 1017, 1025, 1033, 1041, 1049, 1058, 1066, 1075, 1083, 1092, 1101, 1110, 1120, 1129, 1139, 1149, 1159, 1169, 1179, 1190, 1200, 1211, 1222, 1234, 1245, 1257, 1270, 1284, 1300, 1318, 1337, 1358, 1381, 1406, 1433, 1463, 1496, 1531, 1571, 1614, 1661, 1713, 1771, 1835, 1906, 1985, 2075, 2175, 2290, 2422, 2574, 2752, 2962, 3213, 3519, 3902, 4388, 5032 }; var mFourMileTimes = new [] { 1549, 1465, 1394, 1334, 1282, 1237, 1199, 1165, 1137, 1112, 1091, 1073, 1059, 1046, 1033, 1022, 1015, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1012, 1014, 1016, 1019, 1023, 1027, 1033, 1039, 1046, 1054, 1062, 1070, 1078, 1086, 1094, 1103, 1111, 1120, 1129, 1137, 1147, 1156, 1165, 1175, 1184, 1194, 1204, 1215, 1225, 1235, 1246, 1257, 1268, 1279, 1291, 1303, 1315, 1327, 1339, 1352, 1366, 1381, 1398, 1417, 1438, 1460, 1485, 1512, 1541, 1574, 1609, 1647, 1689, 1736, 1786, 1842, 1904, 1973, 2049, 2135, 2231, 2340, 2463, 2605, 2768, 2960, 3185, 3455, 3785, 4197, 4720, 5412 }; var mEightKilometreTimes = new [] { 1949, 1844, 1754, 1678, 1613, 1557, 1508, 1466, 1430, 1399, 1373, 1350, 1332, 1315, 1299, 1286, 1277, 1273, 1272, 1272, 1272, 1272, 1272, 1272, 1273, 1275, 1278, 1282, 1287, 1293, 1300, 1307, 1316, 1326, 1336, 1346, 1356, 1366, 1377, 1387, 1398, 1409, 1420, 1431, 1443, 1454, 1466, 1478, 1490, 1503, 1515, 1528, 1541, 1554, 1568, 1581, 1596, 1610, 1624, 1639, 1654, 1669, 1685, 1701, 1718, 1738, 1759, 1783, 1809, 1837, 1868, 1902, 1939, 1980, 2024, 2072, 2125, 2184, 2247, 2318, 2396, 2482, 2579, 2686, 2807, 2944, 3099, 3278, 3483, 3724, 4008, 4347, 4762, 5280, 5938, 6809 }; var mFiveMileTimes = new [] { 1961, 1855, 1766, 1689, 1623, 1567, 1518, 1476, 1439, 1408, 1381, 1359, 1340, 1324, 1307, 1294, 1285, 1281, 1280, 1280, 1280, 1280, 1280, 1280, 1281, 1283, 1286, 1290, 1295, 1301, 1308, 1316, 1325, 1334, 1344, 1354, 1365, 1375, 1385, 1396, 1407, 1418, 1429, 1440, 1452, 1463, 1475, 1487, 1500, 1512, 1525, 1538, 1551, 1564, 1578, 1591, 1606, 1620, 1634, 1649, 1664, 1680, 1695, 1711, 1729, 1749, 1770, 1794, 1821, 1849, 1880, 1914, 1952, 1992, 2037, 2085, 2139, 2197, 2261, 2332, 2411, 2498, 2595, 2703, 2825, 2962, 3119, 3298, 3505, 3747, 4033, 4375, 4792, 5313, 5976, 6852 }; var mTenKilometreTimes = new [] { 2469, 2335, 2222, 2126, 2043, 1972, 1910, 1857, 1811, 1772, 1739, 1710, 1687, 1666, 1646, 1628, 1617, 1612, 1611, 1611, 1611, 1611, 1611, 1611, 1612, 1615, 1619, 1624, 1630, 1637, 1646, 1656, 1667, 1680, 1692, 1705, 1717, 1730, 1744, 1757, 1771, 1784, 1798, 1813, 1827, 1842, 1857, 1872, 1887, 1903, 1919, 1935, 1952, 1968, 1986, 2003, 2021, 2039, 2057, 2076, 2095, 2114, 2134, 2154, 2176, 2201, 2228, 2258, 2291, 2327, 2366, 2409, 2456, 2507, 2563, 2625, 2692, 2766, 2846, 2935, 3034, 3144, 3266, 3402, 3556, 3728, 3925, 4151, 4411, 4716, 5076, 5506, 6031, 6687, 7521, 8624 }; var mTwelveKilometreTimes = new [] { 2990, 2828, 2691, 2574, 2474, 2388, 2313, 2249, 2194, 2146, 2106, 2071, 2043, 2018, 1993, 1972, 1959, 1952, 1951, 1951, 1951, 1951, 1951, 1951, 1951, 1953, 1956, 1961, 1968, 1976, 1986, 1998, 2012, 2026, 2042, 2057, 2073, 2089, 2105, 2121, 2138, 2155, 2172, 2189, 2207, 2225, 2243, 2262, 2281, 2300, 2320, 2340, 2360, 2381, 2402, 2423, 2445, 2467, 2489, 2513, 2536, 2560, 2584, 2609, 2635, 2665, 2697, 2732, 2772, 2814, 2862, 2913, 2969, 3030, 3097, 3171, 3252, 3340, 3438, 3545, 3665, 3796, 3943, 4107, 4293, 4502, 4739, 5012, 5326, 5695, 6131, 6652, 7291, 8085, 9100, 10444 }; var mFifteenKilometreTimes = new [] { 3793, 3587, 3412, 3263, 3136, 3026, 2931, 2849, 2779, 2718, 2666, 2623, 2586, 2554, 2522, 2496, 2479, 2470, 2469, 2469, 2469, 2469, 2469, 2469, 2469, 2469, 2471, 2476, 2483, 2492, 2503, 2517, 2533, 2552, 2572, 2591, 2611, 2632, 2652, 2674, 2695, 2716, 2738, 2761, 2784, 2807, 2830, 2854, 2879, 2903, 2928, 2954, 2980, 3007, 3034, 3061, 3089, 3118, 3147, 3177, 3207, 3238, 3269, 3301, 3334, 3370, 3410, 3454, 3502, 3556, 3614, 3678, 3748, 3824, 3909, 4000, 4101, 4213, 4335, 4470, 4618, 4784, 4969, 5175, 5407, 5671, 5970, 6313, 6709, 7173, 7723, 8381, 9185, 10186, 11468, 13168 }; var mTenMileTimes = new [] { 4100, 3876, 3687, 3525, 3387, 3267, 3165, 3076, 2999, 2933, 2877, 2830, 2791, 2755, 2721, 2692, 2673, 2664, 2663, 2663, 2663, 2663, 2663, 2663, 2663, 2663, 2665, 2669, 2675, 2684, 2696, 2711, 2728, 2748, 2769, 2791, 2812, 2834, 2857, 2880, 2903, 2926, 2950, 2974, 2999, 3024, 3050, 3075, 3102, 3129, 3156, 3184, 3212, 3241, 3270, 3300, 3330, 3362, 3393, 3425, 3458, 3491, 3525, 3560, 3595, 3634, 3676, 3722, 3774, 3831, 3893, 3962, 4037, 4118, 4208, 4307, 4415, 4534, 4665, 4809, 4969, 5147, 5345, 5568, 5817, 6099, 6420, 6790, 7217, 7717, 8306, 9015, 9881, 10963, 12346, 14180 }; var mTwentyKilometreTimes = new [] { 5247, 4952, 4703, 4491, 4310, 4153, 4019, 3902, 3802, 3716, 3642, 3580, 3527, 3481, 3435, 3397, 3372, 3360, 3358, 3358, 3358, 3358, 3358, 3358, 3358, 3358, 3358, 3360, 3365, 3374, 3387, 3403, 3424, 3448, 3475, 3502, 3530, 3558, 3587, 3616, 3645, 3675, 3706, 3737, 3768, 3800, 3833, 3866, 3900, 3934, 3969, 4004, 4040, 4078, 4115, 4153, 4192, 4232, 4272, 4313, 4355, 4399, 4442, 4487, 4532, 4579, 4630, 4687, 4750, 4820, 4896, 4981, 5073, 5175, 5286, 5408, 5542, 5691, 5853, 6033, 6232, 6454, 6701, 6978, 7290, 7644, 8045, 8508, 9041, 9666, 10409, 11299, 12387, 13745, 15489, 17805 }; var mHalfMarathonTimes = new [] { 5579, 5262, 4995, 4768, 4573, 4406, 4262, 4137, 4030, 3937, 3858, 3791, 3735, 3685, 3636, 3595, 3568, 3555, 3553, 3553, 3553, 3553, 3553, 3553, 3553, 3553, 3553, 3554, 3559, 3567, 3580, 3597, 3618, 3644, 3672, 3701, 3731, 3761, 3791, 3822, 3853, 3885, 3917, 3950, 3983, 4017, 4052, 4087, 4123, 4159, 4196, 4234, 4272, 4311, 4352, 4392, 4433, 4475, 4519, 4562, 4607, 4652, 4699, 4746, 4795, 4845, 4899, 4958, 5025, 5098, 5179, 5268, 5365, 5473, 5590, 5720, 5861, 6017, 6190, 6380, 6591, 6825, 7086, 7379, 7709, 8082, 8506, 8995, 9559, 10222, 11003, 11947, 13096, 14532, 16381, 18829 }; var mTwentyFiveKilometreTimes = new [] { 6771, 6378, 6046, 5765, 5524, 5317, 5139, 4985, 4852, 4737, 4639, 4556, 4486, 4423, 4362, 4311, 4277, 4261, 4259, 4259, 4259, 4259, 4259, 4259, 4259, 4259, 4259, 4259, 4261, 4268, 4280, 4298, 4321, 4351, 4385, 4420, 4455, 4491, 4528, 4565, 4603, 4641, 4680, 4720, 4760, 4802, 4844, 4886, 4929, 4974, 5018, 5064, 5111, 5158, 5207, 5255, 5306, 5357, 5409, 5462, 5517, 5572, 5628, 5686, 5745, 5805, 5869, 5940, 6019, 6106, 6202, 6309, 6425, 6552, 6692, 6846, 7015, 7202, 7407, 7634, 7886, 8165, 8477, 8827, 9221, 9666, 10174, 10758, 11430, 12221, 13157, 14282, 15658, 17377, 19582, 22511 }; var mThirtyKilometreTimes = new [] { 8296, 7807, 7395, 7046, 6748, 6492, 6271, 6080, 5915, 5774, 5652, 5549, 5461, 5383, 5307, 5243, 5202, 5182, 5179, 5179, 5179, 5179, 5179, 5179, 5179, 5179, 5179, 5179, 5179, 5182, 5191, 5209, 5234, 5267, 5309, 5351, 5395, 5439, 5484, 5530, 5575, 5623, 5671, 5719, 5769, 5820, 5871, 5924, 5976, 6031, 6086, 6142, 6199, 6258, 6317, 6378, 6440, 6502, 6567, 6632, 6699, 6767, 6837, 6908, 6981, 7054, 7132, 7217, 7313, 7418, 7534, 7661, 7802, 7955, 8125, 8312, 8515, 8741, 8990, 9265, 9569, 9908, 10286, 10709, 11186, 11725, 12340, 13049, 13866, 14823, 15960, 17321, 18992, 21070, 23746, 27287 }; var mMarathonTimes = new [] { 12067, 11349, 10746, 10233, 9796, 9421, 9097, 8818, 8576, 8369, 8190, 8038, 7910, 7795, 7683, 7590, 7529, 7499, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7495, 7503, 7525, 7563, 7617, 7680, 7744, 7808, 7874, 7940, 8009, 8078, 8149, 8220, 8293, 8368, 8443, 8520, 8598, 8678, 8760, 8843, 8927, 9013, 9100, 9191, 9282, 9375, 9469, 9566, 9666, 9767, 9870, 9975, 10082, 10193, 10307, 10431, 10570, 10722, 10891, 11077, 11281, 11504, 11749, 12019, 12317, 12643, 13003, 13401, 13841, 14334, 14880, 15492, 16181, 16961, 17854, 18874, 20056, 21439, 23076, 25050, 27454, 30455, 34302, 39406 }; var mFiftyKilometreTimes = new [] { 14619, 13749, 13018, 12398, 11868, 11413, 11021, 10682, 10390, 10138, 9922, 9738, 9583, 9444, 9308, 9195, 9121, 9085, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9080, 9089, 9116, 9162, 9228, 9304, 9381, 9459, 9539, 9620, 9703, 9787, 9872, 9958, 10046, 10137, 10229, 10322, 10416, 10513, 10612, 10713, 10815, 10919, 11025, 11134, 11245, 11357, 11472, 11589, 11710, 11832, 11957, 12084, 12214, 12349, 12486, 12637, 12805, 12990, 13194, 13420, 13666, 13937, 14234, 14561, 14922, 15317, 15753, 16235, 16768, 17365, 18027, 18768, 19603, 20548, 21629, 22866, 24298, 25973, 27956, 30348, 33260, 36896, 41556, 47739 }; var mFiftyMileTimes = new [] { 25890, 24349, 23054, 21955, 21017, 20211, 19517, 18918, 18400, 17954, 17572, 17246, 16971, 16724, 16484, 16284, 16153, 16088, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16080, 16096, 16145, 16226, 16341, 16477, 16613, 16752, 16893, 17036, 17183, 17331, 17482, 17635, 17792, 17952, 18114, 18279, 18447, 18618, 18794, 18971, 19152, 19336, 19524, 19718, 19913, 20113, 20316, 20523, 20738, 20954, 21175, 21400, 21630, 21869, 22112, 22380, 22677, 23004, 23365, 23766, 24202, 24682, 25208, 25786, 26426, 27126, 27897, 28750, 29695, 30752, 31924, 33237, 34715, 36388, 38304, 40494, 43029, 45995, 49507, 53743, 58901, 65339, 73593, 84543 }; var mOneHundredKilometreTimes = new [] { 34391, 32344, 30624, 29164, 27918, 26848, 25925, 25129, 24442, 23850, 23342, 22909, 22544, 22215, 21896, 21630, 21457, 21371, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21360, 21381, 21446, 21554, 21707, 21887, 22068, 22252, 22439, 22630, 22825, 23022, 23222, 23426, 23634, 23847, 24062, 24281, 24504, 24731, 24965, 25201, 25441, 25685, 25935, 26193, 26452, 26717, 26987, 27262, 27547, 27834, 28127, 28427, 28733, 29049, 29373, 29729, 30123, 30558, 31037, 31570, 32149, 32786, 33485, 34253, 35103, 36032, 37058, 38191, 39446, 40849, 42406, 44150, 46114, 48337, 50881, 53790, 57158, 61098, 65764, 71390, 78242, 86794, 97757, 112303 }; var mOneHundredAndFiftyKilometreTimes = new [] { 58445, 54967, 52043, 49563, 47445, 45626, 44059, 42706, 41538, 40531, 39668, 38932, 38311, 37754, 37212, 36759, 36464, 36318, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36300, 36336, 36446, 36630, 36890, 37196, 37504, 37816, 38134, 38457, 38790, 39125, 39465, 39811, 40164, 40527, 40892, 41264, 41643, 42028, 42426, 42827, 43235, 43651, 44075, 44513, 44954, 45403, 45862, 46331, 46815, 47303, 47801, 48310, 48830, 49368, 49917, 50522, 51192, 51931, 52746, 53651, 54636, 55718, 56905, 58210, 59655, 61235, 62977, 64903, 67036, 69421, 72067, 75031, 78368, 82145, 86470, 91413, 97137, 103833, 111761, 121324, 132967, 147501, 166133, 190852 }; var mOneHundredMileTimes = new [] { 64160, 60342, 57133, 54410, 52085, 50088, 48368, 46882, 45600, 44495, 43547, 42739, 42058, 41446, 40851, 40354, 40030, 39870, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39850, 39890, 40010, 40212, 40498, 40834, 41172, 41515, 41864, 42218, 42584, 42951, 43325, 43705, 44092, 44490, 44891, 45300, 45715, 46139, 46576, 47015, 47463, 47920, 48385, 48866, 49350, 49844, 50347, 50862, 51393, 51929, 52476, 53034, 53605, 54196, 54799, 55463, 56198, 57010, 57905, 58897, 59979, 61167, 62471, 63903, 65489, 67223, 69136, 71250, 73592, 76210, 79115, 82369, 86032, 90179, 94926, 100353, 106636, 113987, 122691, 133189, 145971, 161926, 182380, 209516 }; var mTwoHundredKilometreTimes = new [] { 85010, 79952, 75699, 72092, 69011, 66365, 64085, 62118, 60419, 58955, 57699, 56628, 55726, 54914, 54126, 53468, 53039, 52826, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52800, 52853, 53012, 53280, 53659, 54104, 54551, 55006, 55468, 55938, 56422, 56909, 57404, 57907, 58420, 58948, 59480, 60020, 60571, 61132, 61711, 62294, 62887, 63492, 64109, 64746, 65387, 66041, 66709, 67390, 68094, 68804, 69529, 70269, 71025, 71807, 72607, 73486, 74461, 75536, 76722, 78037, 79470, 81044, 82772, 84670, 86771, 89069, 91603, 94404, 97507, 100975, 104824, 109136, 113990, 119484, 125774, 132964, 141290, 151030, 162562, 176471, 193407, 214547, 241648, 277603 }; var fFiveKilometreTimes = new [] { 1225, 1172, 1126, 1087, 1053, 1024, 998, 977, 958, 943, 930, 918, 907, 898, 891, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 888, 889, 890, 892, 894, 897, 900, 903, 908, 912, 918, 923, 930, 937, 944, 953, 962, 972, 982, 994, 1006, 1018, 1031, 1045, 1058, 1072, 1086, 1101, 1116, 1132, 1148, 1164, 1181, 1198, 1216, 1235, 1254, 1273, 1293, 1314, 1336, 1358, 1381, 1405, 1429, 1455, 1481, 1509, 1537, 1567, 1599, 1637, 1680, 1729, 1786, 1851, 1926, 2013, 2114, 2233, 2373, 2541, 2744, 2995, 3311, 3720, 4269, 5043, 6210, 8169, 12131 }; var fSixKilometreTimes = new [] { 1480, 1416, 1361, 1313, 1272, 1237, 1206, 1180, 1158, 1139, 1124, 1110, 1096, 1085, 1077, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1074, 1076, 1078, 1080, 1083, 1087, 1092, 1097, 1102, 1109, 1116, 1123, 1132, 1141, 1151, 1162, 1174, 1187, 1201, 1215, 1231, 1246, 1262, 1279, 1295, 1313, 1330, 1349, 1367, 1387, 1406, 1427, 1448, 1469, 1492, 1515, 1538, 1563, 1588, 1614, 1641, 1669, 1698, 1727, 1758, 1790, 1823, 1858, 1893, 1933, 1978, 2030, 2090, 2158, 2237, 2328, 2433, 2555, 2698, 2867, 3070, 3316, 3619, 4001, 4495, 5159, 6093, 7503, 9871, 14658 }; var fFourMileTimes = new [] { 1592, 1523, 1463, 1412, 1368, 1330, 1298, 1269, 1245, 1225, 1208, 1193, 1179, 1166, 1159, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1155, 1157, 1159, 1162, 1165, 1169, 1174, 1179, 1186, 1192, 1200, 1208, 1217, 1227, 1238, 1250, 1263, 1277, 1291, 1307, 1324, 1340, 1357, 1375, 1393, 1412, 1431, 1450, 1471, 1491, 1513, 1535, 1557, 1580, 1604, 1629, 1654, 1681, 1708, 1736, 1765, 1795, 1826, 1858, 1891, 1925, 1961, 1998, 2036, 2079, 2127, 2183, 2247, 2321, 2406, 2503, 2616, 2748, 2902, 3084, 3302, 3566, 3892, 4303, 4835, 5548, 6553, 8070, 10616, 15765 }; var fEightKilometreTimes = new [] { 1993, 1907, 1832, 1768, 1713, 1666, 1625, 1589, 1559, 1534, 1513, 1494, 1476, 1461, 1451, 1446, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1447, 1448, 1451, 1455, 1459, 1464, 1470, 1477, 1484, 1493, 1503, 1513, 1524, 1537, 1551, 1565, 1581, 1598, 1617, 1637, 1657, 1678, 1700, 1722, 1745, 1768, 1792, 1816, 1841, 1867, 1894, 1922, 1950, 1979, 2009, 2040, 2072, 2105, 2139, 2174, 2210, 2247, 2286, 2326, 2368, 2411, 2455, 2502, 2550, 2603, 2664, 2734, 2814, 2906, 3012, 3134, 3276, 3440, 3633, 3862, 4134, 4465, 4874, 5388, 6054, 6947, 8206, 10105, 13293, 19740 }; var fFiveMileTimes = new [] { 2003, 1916, 1841, 1777, 1722, 1674, 1633, 1597, 1567, 1542, 1520, 1502, 1483, 1468, 1458, 1453, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1454, 1455, 1458, 1462, 1466, 1471, 1477, 1484, 1492, 1500, 1510, 1520, 1532, 1544, 1558, 1573, 1589, 1606, 1625, 1645, 1665, 1686, 1708, 1730, 1753, 1776, 1800, 1825, 1850, 1876, 1903, 1931, 1959, 1988, 2019, 2050, 2082, 2115, 2149, 2184, 2221, 2258, 2297, 2337, 2379, 2422, 2467, 2514, 2562, 2615, 2676, 2747, 2828, 2920, 3027, 3150, 3292, 3457, 3651, 3880, 4155, 4487, 4897, 5414, 6083, 6981, 8245, 10154, 13358, 19836 }; var fTenKilometreTimes = new [] { 2510, 2405, 2311, 2230, 2160, 2100, 2048, 2004, 1965, 1933, 1907, 1883, 1859, 1840, 1827, 1821, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1821, 1822, 1824, 1828, 1832, 1838, 1844, 1851, 1860, 1870, 1881, 1892, 1906, 1920, 1936, 1953, 1971, 1991, 2013, 2036, 2062, 2087, 2114, 2141, 2169, 2197, 2227, 2257, 2288, 2319, 2352, 2386, 2420, 2456, 2492, 2530, 2569, 2609, 2651, 2694, 2738, 2783, 2830, 2879, 2930, 2982, 3036, 3093, 3151, 3212, 3278, 3355, 3443, 3544, 3660, 3794, 3948, 4126, 4333, 4576, 4864, 5207, 5624, 6138, 6786, 7625, 8750, 10335, 12727, 16743, 24863 }; var fTwelveKilometreTimes = new [] { 3034, 2927, 2811, 2710, 2624, 2549, 2484, 2429, 2382, 2342, 2308, 2278, 2249, 2225, 2209, 2201, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2200, 2201, 2202, 2205, 2210, 2215, 2221, 2229, 2238, 2248, 2260, 2273, 2288, 2303, 2321, 2340, 2361, 2383, 2407, 2434, 2462, 2492, 2523, 2555, 2588, 2622, 2656, 2691, 2728, 2765, 2804, 2843, 2884, 2926, 2969, 3013, 3059, 3106, 3154, 3204, 3256, 3309, 3364, 3421, 3480, 3542, 3605, 3670, 3738, 3809, 3882, 3963, 4055, 4162, 4284, 4425, 4586, 4772, 4988, 5238, 5532, 5879, 6295, 6799, 7420, 8203, 9217, 10577, 12493, 15385, 20239, 30055 }; var fFifteenKilometreTimes = new [] { 3823, 3785, 3623, 3484, 3364, 3261, 3172, 3095, 3029, 2973, 2926, 2883, 2842, 2807, 2785, 2773, 2772, 2772, 2772, 2772, 2772, 2772, 2772, 2772, 2772, 2773, 2775, 2779, 2784, 2790, 2799, 2809, 2820, 2833, 2848, 2864, 2882, 2902, 2924, 2948, 2975, 3003, 3033, 3066, 3102, 3140, 3179, 3220, 3261, 3303, 3347, 3391, 3437, 3484, 3533, 3582, 3634, 3686, 3740, 3796, 3854, 3913, 3974, 4037, 4102, 4170, 4239, 4311, 4385, 4462, 4542, 4625, 4710, 4799, 4891, 4993, 5110, 5244, 5398, 5575, 5779, 6013, 6284, 6600, 6970, 7408, 7931, 8566, 9349, 10336, 11613, 13327, 15741, 19385, 25501, 37869 }; var fTenMileTimes = new [] { 4112, 4142, 3957, 3798, 3661, 3543, 3441, 3354, 3278, 3213, 3159, 3109, 3061, 3021, 2995, 2982, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2981, 2982, 2984, 2988, 2994, 3001, 3010, 3020, 3033, 3046, 3062, 3080, 3100, 3121, 3145, 3171, 3199, 3229, 3262, 3298, 3336, 3377, 3419, 3462, 3507, 3552, 3599, 3647, 3696, 3747, 3799, 3852, 3907, 3964, 4022, 4082, 4144, 4208, 4274, 4342, 4412, 4484, 4559, 4636, 4716, 4799, 4884, 4973, 5065, 5161, 5260, 5369, 5495, 5639, 5805, 5996, 6214, 6466, 6758, 7098, 7496, 7966, 8529, 9212, 10054, 11115, 12488, 14332, 16928, 20846, 27424, 40724 }; var fTwentyKilometreTimes = new [] { 5156, 5336, 5081, 4863, 4675, 4514, 4374, 4254, 4150, 4061, 3985, 3916, 3849, 3794, 3758, 3740, 3738, 3738, 3738, 3738, 3738, 3738, 3738, 3738, 3738, 3739, 3742, 3747, 3754, 3763, 3774, 3787, 3803, 3820, 3840, 3862, 3887, 3914, 3943, 3976, 4011, 4049, 4090, 4135, 4183, 4234, 4287, 4341, 4397, 4454, 4513, 4573, 4635, 4698, 4764, 4831, 4900, 4971, 5044, 5119, 5197, 5277, 5359, 5444, 5532, 5623, 5716, 5813, 5914, 6017, 6125, 6236, 6352, 6472, 6596, 6733, 6890, 7072, 7279, 7518, 7792, 8108, 8474, 8900, 9399, 9989, 10695, 11551, 12607, 13937, 15660, 17971, 21227, 26140, 34388, 51066 }; var fHalfMarathonTimes = new [] { 5448, 5690, 5412, 5174, 4970, 4795, 4643, 4512, 4399, 4302, 4219, 4144, 4071, 4011, 3972, 3952, 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3950, 3951, 3954, 3960, 3967, 3976, 3988, 4002, 4018, 4037, 4058, 4081, 4107, 4136, 4167, 4201, 4239, 4279, 4322, 4369, 4420, 4474, 4530, 4588, 4647, 4707, 4769, 4832, 4898, 4965, 5034, 5105, 5178, 5253, 5330, 5409, 5491, 5576, 5663, 5753, 5846, 5942, 6041, 6143, 6249, 6359, 6472, 6590, 6712, 6839, 6970, 7115, 7281, 7473, 7692, 7944, 8234, 8568, 8955, 9405, 9932, 10556, 11302, 12206, 13322, 14728, 16548, 18990, 22430, 27622, 36339, 53962 }; var fTwentyFiveKilometreTimes = new [] { 6499, 6915, 6562, 6261, 6003, 5782, 5590, 5425, 5282, 5159, 5053, 4957, 4865, 4789, 4739, 4715, 4712, 4712, 4712, 4712, 4712, 4712, 4712, 4712, 4712, 4713, 4718, 4724, 4734, 4747, 4762, 4780, 4802, 4826, 4854, 4884, 4919, 4957, 4998, 5043, 5093, 5146, 5204, 5267, 5332, 5399, 5467, 5537, 5609, 5683, 5758, 5836, 5916, 5998, 6082, 6169, 6258, 6350, 6445, 6543, 6643, 6747, 6854, 6964, 7078, 7196, 7318, 7444, 7574, 7709, 7849, 7995, 8145, 8303, 8479, 8681, 8912, 9174, 9473, 9815, 10208, 10658, 11179, 11786, 12499, 13345, 14361, 15608, 17153, 19123, 21714, 25265, 30420, 38560, 53243, 87910 }; var fThirtyKilometreTimes = new [] { 7857, 8518, 8063, 7678, 7348, 7064, 6820, 6609, 6426, 6268, 6133, 6010, 5892, 5795, 5731, 5700, 5696, 5696, 5696, 5696, 5696, 5696, 5696, 5696, 5696, 5698, 5703, 5713, 5726, 5743, 5764, 5789, 5818, 5850, 5889, 5930, 5977, 6029, 6085, 6148, 6216, 6289, 6366, 6444, 6525, 6607, 6692, 6779, 6868, 6959, 7053, 7149, 7249, 7351, 7455, 7563, 7674, 7789, 7907, 8028, 8153, 8283, 8416, 8554, 8696, 8843, 8996, 9153, 9316, 9485, 9661, 9843, 10037, 10258, 10507, 10788, 11108, 11468, 11877, 12342, 12872, 13485, 14190, 15017, 15987, 17141, 18536, 20249, 22390, 25159, 28841, 33986, 41668, 54351, 79221, 149895 }; var fMarathonTimes = new [] { 11207, 12388, 11697, 11113, 10615, 10188, 9820, 9502, 9227, 8989, 8784, 8598, 8420, 8273, 8177, 8131, 8125, 8125, 8125, 8125, 8125, 8125, 8125, 8125, 8125, 8128, 8139, 8156, 8180, 8211, 8250, 8295, 8349, 8411, 8480, 8559, 8647, 8744, 8848, 8954, 9063, 9175, 9289, 9406, 9526, 9650, 9776, 9906, 10040, 10177, 10317, 10462, 10611, 10764, 10922, 11085, 11252, 11424, 11602, 11786, 11975, 12170, 12372, 12581, 12797, 13021, 13252, 13492, 13741, 14001, 14289, 14611, 14966, 15362, 15804, 16299, 16853, 17473, 18173, 18966, 19870, 20908, 22103, 23496, 25139, 27101, 29481, 32409, 36111, 40932, 47459, 56778, 71085, 95927, 149632, 351732 }; var fFiftyKilometreTimes = new [] { 13545, 14972, 14138, 13432, 12830, 12313, 11869, 11484, 11151, 10864, 10616, 10392, 10176, 9999, 9883, 9827, 9820, 9820, 9820, 9820, 9820, 9820, 9820, 9820, 9820, 9824, 9837, 9857, 9886, 9924, 9971, 10026, 10090, 10166, 10249, 10344, 10451, 10568, 10694, 10822, 10954, 11089, 11227, 11368, 11514, 11663, 11816, 11973, 12134, 12300, 12470, 12645, 12825, 13010, 13201, 13397, 13599, 13808, 14023, 14244, 14473, 14709, 14954, 15206, 15467, 15737, 16017, 16307, 16607, 16922, 17270, 17659, 18088, 18567, 19101, 19699, 20369, 21118, 21964, 22923, 24016, 25270, 26714, 28398, 30384, 32755, 35631, 39170, 43644, 49471, 57360, 68623, 85914, 115939, 180847, 425108 }; var fFiftyMileTimes = new [] { 24497, 27077, 25569, 24292, 23204, 22270, 21465, 20770, 20168, 19648, 19200, 18794, 18404, 18084, 17874, 17772, 17760, 17760, 17760, 17760, 17760, 17760, 17760, 17760, 17760, 17767, 17790, 17828, 17880, 17948, 18032, 18132, 18249, 18385, 18537, 18709, 18902, 19113, 19340, 19572, 19810, 20054, 20304, 20560, 20823, 21093, 21369, 21653, 21945, 22244, 22552, 22869, 23194, 23529, 23874, 24229, 24595, 24972, 25361, 25762, 26175, 26603, 27044, 27501, 27973, 28462, 28968, 29492, 30036, 30605, 31235, 31937, 32713, 33579, 34546, 35627, 36839, 38194, 39723, 41457, 43434, 45703, 48313, 51359, 54950, 59239, 64441, 70842, 78933, 89471, 103738, 124109, 155381, 209681, 327072, 768831 }; var fOneHundredKilometreTimes = new [] { 32539, 35967, 33963, 32268, 30822, 29581, 28512, 27589, 26790, 26099, 25504, 24964, 24447, 24021, 23743, 23608, 23591, 23591, 23591, 23591, 23591, 23591, 23591, 23591, 23591, 23600, 23631, 23681, 23750, 23841, 23953, 24085, 24241, 24421, 24623, 24851, 25107, 25389, 25690, 25998, 26315, 26638, 26970, 27311, 27660, 28018, 28385, 28762, 29150, 29548, 29957, 30377, 30810, 31255, 31713, 32184, 32670, 33171, 33687, 34220, 34769, 35337, 35924, 36530, 37157, 37806, 38478, 39175, 39897, 40653, 41490, 42422, 43454, 44604, 45888, 47324, 48934, 50733, 52764, 55068, 57694, 60708, 64176, 68222, 72992, 78689, 85599, 94101, 104849, 118846, 137798, 164857, 206395, 278524, 434457, 1021255 }; var fOneHundredAndFiftyKilometreTimes = new [] { 54759, 60528, 57155, 54302, 51868, 49781, 47982, 46427, 45083, 43921, 42919, 42011, 41140, 40424, 39956, 39728, 39700, 39700, 39700, 39700, 39700, 39700, 39700, 39700, 39700, 39716, 39768, 39851, 39968, 40121, 40309, 40531, 40793, 41097, 41436, 41820, 42252, 42725, 43232, 43751, 44283, 44828, 45387, 45960, 46547, 47150, 47768, 48403, 49055, 49724, 50413, 51120, 51848, 52597, 53367, 54161, 54979, 55821, 56690, 57586, 58511, 59467, 60454, 61474, 62530, 63622, 64753, 65925, 67140, 68413, 69821, 71390, 73126, 75061, 77222, 79639, 82348, 85376, 88794, 92670, 97090, 102162, 107998, 114806, 122834, 132422, 144049, 158357, 176444, 200000, 231893, 277428, 347332, 468713, 731123, 1718615 }; var fOneHundredMileTimes = new [] { 60000, 66321, 62626, 59499, 56833, 54545, 52574, 50871, 49398, 48125, 47027, 46032, 45078, 44293, 43780, 43530, 43500, 43500, 43500, 43500, 43500, 43500, 43500, 43500, 43500, 43517, 43574, 43666, 43793, 43962, 44167, 44410, 44698, 45031, 45402, 45823, 46296, 46814, 47370, 47939, 48522, 49119, 49731, 50359, 51002, 51663, 52340, 53036, 53750, 54484, 55238, 56013, 56811, 57631, 58476, 59345, 60241, 61164, 62116, 63098, 64112, 65159, 66240, 67358, 68515, 69712, 70951, 72235, 73567, 74961, 76504, 78223, 80125, 82246, 84614, 87262, 90230, 93548, 97294, 101541, 106383, 111940, 118335, 125795, 134592, 145097, 157837, 173514, 193333, 219144, 254089, 303983, 380577, 513577, 801105, 1883117 }; var fTwoHundredKilometreTimes = new [] { 79448, 87818, 82925, 78785, 75255, 72226, 69616, 67361, 65410, 63724, 62270, 60952, 59689, 58650, 57971, 57640, 57600, 57600, 57600, 57600, 57600, 57600, 57600, 57600, 57600, 57623, 57698, 57820, 57989, 58211, 58483, 58806, 59186, 59627, 60119, 60676, 61303, 61989, 62725, 63478, 64250, 65041, 65851, 66682, 67534, 68409, 69306, 70227, 71173, 72144, 73143, 74169, 75225, 76312, 77430, 78581, 79767, 80990, 82250, 83551, 84893, 86279, 87711, 89192, 90723, 92308, 93949, 95649, 97412, 99259, 101301, 103578, 106097, 108905, 112040, 115547, 119477, 123871, 128830, 134454, 140866, 148224, 156692, 166570, 178218, 192128, 208999, 229757, 256000, 290176, 336449, 402516, 503937, 680047, 1060773, 2493506 }; Int32[] standardTimes = { }; switch (distance) { case Distance.Dist5k: standardTimes = (gender == GenderEnum.Male) ? mFiveKilometreTimes : fFiveKilometreTimes; break; case Distance.Dist6k: standardTimes = (gender == GenderEnum.Male) ? mSixKilometreTimes : fSixKilometreTimes; break; case Distance.Dist4M: standardTimes = (gender == GenderEnum.Male) ? mFourMileTimes : fFourMileTimes; break; case Distance.Dist8k: standardTimes = (gender == GenderEnum.Male) ? mEightKilometreTimes : fEightKilometreTimes; break; case Distance.Dist5M: standardTimes = (gender == GenderEnum.Male) ? mFiveMileTimes : fFiveMileTimes; break; case Distance.Dist10k: standardTimes = (gender == GenderEnum.Male) ? mTenKilometreTimes : fTenKilometreTimes; break; case Distance.Dist12k: standardTimes = (gender == GenderEnum.Male) ? mTwelveKilometreTimes : fTwelveKilometreTimes; break; case Distance.Dist15k: standardTimes = (gender == GenderEnum.Male) ? mFifteenKilometreTimes : fFifteenKilometreTimes; break; case Distance.Dist10M: standardTimes = (gender == GenderEnum.Male) ? mTenMileTimes : fTenMileTimes; break; case Distance.Dist20k: standardTimes = (gender == GenderEnum.Male) ? mTwentyKilometreTimes : fTwentyKilometreTimes; break; case Distance.DistHM: standardTimes = (gender == GenderEnum.Male) ? mHalfMarathonTimes : fHalfMarathonTimes; break; case Distance.Dist25k: standardTimes = (gender == GenderEnum.Male) ? mTwentyFiveKilometreTimes : fTwentyFiveKilometreTimes; break; case Distance.Dist30k: standardTimes = (gender == GenderEnum.Male) ? mThirtyKilometreTimes : fThirtyKilometreTimes; break; case Distance.DistM: standardTimes = (gender == GenderEnum.Male) ? mMarathonTimes : fMarathonTimes; break; case Distance.Dist50k: standardTimes = (gender == GenderEnum.Male) ? mFiftyKilometreTimes : fFiftyKilometreTimes; break; case Distance.Dist50M: standardTimes = (gender == GenderEnum.Male) ? mFiftyMileTimes : fFiftyMileTimes; break; case Distance.Dist100k: standardTimes = (gender == GenderEnum.Male) ? mOneHundredKilometreTimes : fOneHundredKilometreTimes; break; case Distance.Dist150k: standardTimes = (gender == GenderEnum.Male) ? mOneHundredAndFiftyKilometreTimes : fOneHundredAndFiftyKilometreTimes; break; case Distance.Dist100M: standardTimes = (gender == GenderEnum.Male) ? mOneHundredMileTimes : fOneHundredMileTimes; break; case Distance.Dist200k: standardTimes = (gender == GenderEnum.Male) ? mTwoHundredKilometreTimes : fTwoHundredKilometreTimes; break; default: break; } return standardTimes; }
public static void SetRelationshipByChildType(GenderEnum child_gender, RelationshipEnum parentType, RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum parent_bloodline, out string relationshipOfChild, out string relationshipOther, out string bloodlineOfChild) { relationshipOfChild = Relationship.toString(RelationshipEnum.OTHER); relationshipOther = ""; bloodlineOfChild = Bloodline.toString(parent_bloodline); if (child_gender == GenderEnum.Male) { switch (parentType) { case RelationshipEnum.SELF: relationshipOfChild = Relationship.toString(RelationshipEnum.SON); break; case RelationshipEnum.MOTHER: case RelationshipEnum.FATHER: relationshipOfChild = Relationship.toString(RelationshipEnum.BROTHER); bloodlineOfChild = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Both); break; case RelationshipEnum.GRANDMOTHER: case RelationshipEnum.GRANDFATHER: relationshipOfChild = Relationship.toString(RelationshipEnum.UNCLE); break; case RelationshipEnum.AUNT: case RelationshipEnum.UNCLE: relationshipOfChild = Relationship.toString(RelationshipEnum.COUSIN_MALE); break; case RelationshipEnum.DAUGHTER: case RelationshipEnum.SON: relationshipOther = "Grandson"; break; case RelationshipEnum.BROTHER: case RelationshipEnum.SISTER: relationshipOfChild = Relationship.toString(RelationshipEnum.NEPHEW); break; case RelationshipEnum.NIECE: case RelationshipEnum.NEPHEW: relationshipOther = "Grandnephew"; break; case RelationshipEnum.COUSIN_FEMALE: case RelationshipEnum.COUSIN_MALE: case RelationshipEnum.COUSIN: relationshipOther = "First cousin once removed"; break; case RelationshipEnum.HALF_BROTHER: case RelationshipEnum.HALF_SISTER: relationshipOther = "Half Nephew"; break; case RelationshipEnum.GRANDFATHERS_FATHER: case RelationshipEnum.GRANDFATHERS_MOTHER: if (parent_bloodline == RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal) { relationshipOfChild = Relationship.toString(RelationshipEnum.BROTHER_OF_MATERNAL_GF); } else { relationshipOfChild = Relationship.toString(RelationshipEnum.BROTHER_OF_PATERNAL_GF); } break; case RelationshipEnum.GRANDMOTHERS_FATHER: case RelationshipEnum.GRANDMOTHERS_MOTHER: if (parent_bloodline == RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal) { relationshipOfChild = Relationship.toString(RelationshipEnum.BROTHER_OF_MATERNAL_GM); } else { relationshipOfChild = Relationship.toString(RelationshipEnum.BROTHER_OF_PATERNAL_GM); } break; case RelationshipEnum.BROTHER_OF_PATERNAL_GF: case RelationshipEnum.SISTER_OF_PATERNAL_GF: case RelationshipEnum.BROTHER_OF_PATERNAL_GM: case RelationshipEnum.SISTER_OF_PATERNAL_GM: case RelationshipEnum.BROTHER_OF_MATERNAL_GF: case RelationshipEnum.SISTER_OF_MATERNAL_GF: case RelationshipEnum.BROTHER_OF_MATERNAL_GM: case RelationshipEnum.SISTER_OF_MATERNAL_GM: relationshipOther = "Son of " + Relationship.toString(parentType); break; case RelationshipEnum.OTHER_MALE: case RelationshipEnum.OTHER_FEMALE: case RelationshipEnum.OTHER: case RelationshipEnum.SPOUSE: case RelationshipEnum.PLACEHOLDER: case RelationshipEnum.UNKNOWN: relationshipOther = "Son of Other"; break; default: break; } } else if (child_gender == GenderEnum.Female) { switch (parentType) { case RelationshipEnum.SELF: relationshipOfChild = Relationship.toString(RelationshipEnum.DAUGHTER); break; case RelationshipEnum.MOTHER: case RelationshipEnum.FATHER: relationshipOfChild = Relationship.toString(RelationshipEnum.SISTER); bloodlineOfChild = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Both); break; case RelationshipEnum.GRANDMOTHER: case RelationshipEnum.GRANDFATHER: relationshipOfChild = Relationship.toString(RelationshipEnum.AUNT); break; case RelationshipEnum.AUNT: case RelationshipEnum.UNCLE: relationshipOfChild = Relationship.toString(RelationshipEnum.COUSIN_FEMALE); break; case RelationshipEnum.DAUGHTER: case RelationshipEnum.SON: relationshipOther = "Grandson"; break; case RelationshipEnum.BROTHER: case RelationshipEnum.SISTER: relationshipOfChild = Relationship.toString(RelationshipEnum.NIECE); break; case RelationshipEnum.NIECE: case RelationshipEnum.NEPHEW: relationshipOther = "Grandniece"; break; case RelationshipEnum.COUSIN_FEMALE: case RelationshipEnum.COUSIN_MALE: case RelationshipEnum.COUSIN: relationshipOther = "First cousin once removed"; break; case RelationshipEnum.HALF_BROTHER: case RelationshipEnum.HALF_SISTER: relationshipOther = "Half Niece"; break; case RelationshipEnum.GRANDFATHERS_FATHER: case RelationshipEnum.GRANDFATHERS_MOTHER: if (parent_bloodline == RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal) { relationshipOfChild = Relationship.toString(RelationshipEnum.SISTER_OF_MATERNAL_GF); } else { relationshipOfChild = Relationship.toString(RelationshipEnum.SISTER_OF_PATERNAL_GF); } break; case RelationshipEnum.GRANDMOTHERS_FATHER: case RelationshipEnum.GRANDMOTHERS_MOTHER: if (parent_bloodline == RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal) { relationshipOfChild = Relationship.toString(RelationshipEnum.SISTER_OF_MATERNAL_GM); } else { relationshipOfChild = Relationship.toString(RelationshipEnum.SISTER_OF_PATERNAL_GM); } break; case RelationshipEnum.BROTHER_OF_PATERNAL_GF: case RelationshipEnum.SISTER_OF_PATERNAL_GF: case RelationshipEnum.BROTHER_OF_PATERNAL_GM: case RelationshipEnum.SISTER_OF_PATERNAL_GM: case RelationshipEnum.BROTHER_OF_MATERNAL_GF: case RelationshipEnum.SISTER_OF_MATERNAL_GF: case RelationshipEnum.BROTHER_OF_MATERNAL_GM: case RelationshipEnum.SISTER_OF_MATERNAL_GM: relationshipOther = "Daughter of " + Relationship.toString(parentType); break; case RelationshipEnum.OTHER_MALE: case RelationshipEnum.OTHER_FEMALE: case RelationshipEnum.OTHER: case RelationshipEnum.SPOUSE: case RelationshipEnum.PLACEHOLDER: case RelationshipEnum.UNKNOWN: relationshipOther = "Daughter of Other"; break; default: break; } } }
public GenderOption(GenderEnum gender) { _gender = gender; }
/**************************************************************************************************/ public List<Person> AddChild(Person p, bool createNewSpouse, int count, GenderEnum gender) { List<Person> retval = new List<Person>(); Person newSpouse = null; for (int i = 0; i < count; i++) { //int nextID = GetNewRelativeID(); Person newChild = new Person(this); //newChild.owningFHx = this; //newChild.relativeID = nextID; //newChild.vitalStatus = "Alive"; //this.AddToList(newChild, new HraModelChangedEventArgs(null)); if (gender == GenderEnum.Male) newChild.gender = "Male"; else if (gender == GenderEnum.Female) newChild.gender = "Female"; else newChild.gender = "Unknown"; if (p.gender == "Female") { newChild.motherID = p.relativeID; if (createNewSpouse == false) { foreach (Person sib in this) { if (sib.motherID == newChild.motherID) { newChild.fatherID = sib.fatherID; break; } } } if (newChild.fatherID < 1) { if (newSpouse == null) { newSpouse = CreateSpouse(p); this.AddToList(newSpouse, new HraModelChangedEventArgs(null)); } newChild.fatherID = newSpouse.relativeID; } } else if (p.gender == "Male") { newChild.fatherID = p.relativeID; if (createNewSpouse == false) { foreach (Person sib in this) { if (sib.fatherID == newChild.fatherID) { newChild.motherID = sib.motherID; break; } } } if (newChild.motherID < 1) { if (newSpouse == null) { newSpouse = CreateSpouse(p); this.AddToList(newSpouse, new HraModelChangedEventArgs(null)); } newChild.motherID = newSpouse.relativeID; } } int nextID = GetNewRelativeID(); newChild.owningFHx = this; newChild.relativeID = nextID; newChild.vitalStatus = "Alive"; Relationship.SetRelationshipByChildType(Gender.Parse(newChild.gender), Relationship.Parse(p.relationship), Bloodline.Parse(p.bloodline), out newChild.relationship, out newChild.relationshipOther, out newChild.bloodline); if (createNewSpouse) { if (newChild.relationship == Relationship.toString(RelationshipEnum.SISTER)) { newChild.relationship = Relationship.toString(RelationshipEnum.HALF_SISTER); if (p.relationship == Relationship.toString(RelationshipEnum.MOTHER)) { newChild.bloodline = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal); } else if (p.relationship == Relationship.toString(RelationshipEnum.FATHER)) { newChild.bloodline = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Paternal); } } else if (newChild.relationship == Relationship.toString(RelationshipEnum.BROTHER)) { newChild.relationship = Relationship.toString(RelationshipEnum.HALF_BROTHER); if (p.relationship == Relationship.toString(RelationshipEnum.MOTHER)) { newChild.bloodline = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal); } else if (p.relationship == Relationship.toString(RelationshipEnum.FATHER)) { newChild.bloodline = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Paternal); } } } this.AddToList(newChild, new HraModelChangedEventArgs(null)); newChild.HraState = RiskApps3.Model.HraObject.States.Ready; retval.Add(newChild); } if (newSpouse != null) { newSpouse.HraState = RiskApps3.Model.HraObject.States.Ready; retval.Add(newSpouse); } return retval; }
public static void SetRelationshipByParentType(GenderEnum parent_gender, RelationshipEnum childType, RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum child_bloodline, out string relationshipOfParent, out string relationshipOther, out string bloodlineOfParent) { relationshipOfParent = Relationship.toString(RelationshipEnum.OTHER); relationshipOther = ""; bloodlineOfParent = Bloodline.toString(child_bloodline); if (parent_gender == GenderEnum.Male) { switch (childType) { case RelationshipEnum.SELF: relationshipOfParent = Relationship.toString(RelationshipEnum.FATHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Paternal); break; case RelationshipEnum.MOTHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDFATHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal); break; case RelationshipEnum.FATHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDFATHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Paternal); break; case RelationshipEnum.GRANDMOTHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDMOTHERS_FATHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; case RelationshipEnum.GRANDFATHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDFATHERS_FATHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; case RelationshipEnum.AUNT: case RelationshipEnum.UNCLE: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDFATHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; default: break; } } else if (parent_gender == GenderEnum.Female) { switch (childType) { case RelationshipEnum.SELF: relationshipOfParent = Relationship.toString(RelationshipEnum.MOTHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal); break; case RelationshipEnum.MOTHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDMOTHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Maternal); break; case RelationshipEnum.FATHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDMOTHER); bloodlineOfParent = Bloodline.toString(RiskApps3.Model.PatientRecord.FHx.Bloodline.BloodlineEnum.Paternal); break; case RelationshipEnum.GRANDMOTHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDMOTHERS_MOTHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; case RelationshipEnum.GRANDFATHER: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDFATHERS_MOTHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; case RelationshipEnum.AUNT: case RelationshipEnum.UNCLE: relationshipOfParent = Relationship.toString(RelationshipEnum.GRANDMOTHER); bloodlineOfParent = Bloodline.toString(child_bloodline); break; default: break; } } }
private static double GetTime(int age, GenderEnum gender, double distance) { var shorterDistance = 0.0; var longerDistance = 0.0; double[] distances = { 5, 6, ToKilometres(4), 8, ToKilometres(5), 10, 12, 15, ToKilometres(10), 20, 21.1, 25, 30, 42.2, 50, ToKilometres(50), 100, 150, ToKilometres(100), 200 }; for ( var i = 0; i < distances.Length - 1; i++) { if (distances[i + 1] > distance) { shorterDistance = distances[i]; longerDistance = distances[i + 1]; break; } } if (shorterDistance == 0) { shorterDistance = distances[distances.Length - 2]; longerDistance = distances[distances.Length-1]; } var distanceLookup = new Dictionary<double, Distance>() { {5, Distance.Dist5k}, {6, Distance.Dist6k}, {ToKilometres(4), Distance.Dist4M}, {8, Distance.Dist8k}, {ToKilometres(5), Distance.Dist5M}, {10, Distance.Dist10k}, {12, Distance.Dist12k}, {15, Distance.Dist15k}, {ToKilometres(10), Distance.Dist10M}, {20, Distance.Dist20k}, {21.1, Distance.DistHM}, {25, Distance.Dist25k}, {30, Distance.Dist30k}, {42.2, Distance.DistM}, {50, Distance.Dist50k}, {ToKilometres(50), Distance.Dist50M}, {100, Distance.Dist100k}, {150, Distance.Dist150k}, {ToKilometres(100), Distance.Dist100M}, {200, Distance.Dist200k}, }; var shorterStandardTimes = GetStandardTimes(distanceLookup[shorterDistance], gender); var longerStandardTimes = GetStandardTimes(distanceLookup[longerDistance], gender); var shorterTime = shorterStandardTimes[age - 5]; var longerTime = longerStandardTimes[age - 5]; var distanceDifference = longerDistance - shorterDistance; var extraDistance = distance - shorterDistance; var percentageExtra = extraDistance / distanceDifference; var timeDifference = longerTime - shorterTime; var extraTime = percentageExtra * timeDifference; var overallTime = shorterTime + extraTime; return overallTime; }
private Account CreateAccount(string firstName, string lastName, GenderEnum gender, ProfessionalRegistrationTypeEnum professionalResgistrationType, string professionalResgistrationNumber, string email, string password, DateTime birthday, Hospital hospital) { var professionalResgistration = new ProfessionalRegistration { Number = professionalResgistrationNumber, State = hospital.State, Type = professionalResgistrationType }; var account = new Account(false); account.ToApprove(false); account.ToRefuse(false); account.AddProfessionalRegistration(professionalResgistration); account.ToEnterFirstName(firstName); account.ToEnterLastName(lastName); account.ToEnterGender(gender); account.ToEnterEmail(email); account.ToEnterPassword(password); account.ToEnterBirthday(birthday); account.AddHospital(hospital); return account; }
/// <summary> /// 初始化男女BMI標準 /// </summary> /// <param name="gender">性別</param> private void InitBound(GenderEnum gender) { if (gender == GenderEnum.Male) { this.BMIUpperBound = 24d; this.BMILowerBound = 20d; } else { this.BMIUpperBound = 22d; this.BMILowerBound = 19d; } }
/// <summary> /// Gets the winners for a given category. /// </summary> /// <param name="gender">Gender of this category.</param> /// <param name="finishers">The full list of race finishers</param> /// <param name="categories">The age categories to be included.</param> /// <param name="alreadyGotAPrize">If a runner has won a prize in another category, don't give them one in this.</param> /// <param name="numberPrizesInCategory">How many prizes in this category</param> private List<Finisher> GetCategoryWinners( GenderEnum gender, IEnumerable<Finisher> finishers, IList<AgeGroup.AgeGroupEnum> categories, List<Finisher> alreadyGotAPrize, int numberPrizesInCategory) { var catWinners = finishers .Where( f => f.Gender == gender ) .Where( f => categories.Contains( f.CategoryEnum ) ) .Where( f => !alreadyGotAPrize.Contains( f ) ) // Has this person already got a prize? .OrderBy( f => f.Position ).Take( numberPrizesInCategory ).ToList(); alreadyGotAPrize.AddRange( catWinners ); return catWinners; }
public static String getName(CreatureEnum type, GenderEnum gender) { String result = ""; switch (type) { case CreatureEnum.Archer: { if (gender == GenderEnum.Male) { result = "Bogenschütze"; } if (gender == GenderEnum.Female) { result = "Bogenschützin"; } break; } case CreatureEnum.Captain: { if (gender == GenderEnum.Male) { result = "Kapitän"; } if (gender == GenderEnum.Female) { result = "Kapitän"; } break; } case CreatureEnum.Chieftain: { if (gender == GenderEnum.Male) { result = "Anführer"; } if (gender == GenderEnum.Female) { result = "Anführerin"; } break; } case CreatureEnum.Child: { if (gender == GenderEnum.Male) { result = "Junge"; } if (gender == GenderEnum.Female) { result = "Mädchen"; } break; } case CreatureEnum.Commandant: { if (gender == GenderEnum.Male) { result = "Kommandant"; } if (gender == GenderEnum.Female) { result = "Kommandantin"; } break; } case CreatureEnum.Farmer: { if (gender == GenderEnum.Male) { result = "Bauer"; } if (gender == GenderEnum.Female) { result = "Bäuerin"; } break; } case CreatureEnum.Guard: { if (gender == GenderEnum.Male) { result = "Wächter"; } if (gender == GenderEnum.Female) { result = "Wächterin"; } break; } case CreatureEnum.Hunter: { if (gender == GenderEnum.Male) { result = "Jäger"; } if (gender == GenderEnum.Female) { result = "Jägerin"; } break; } case CreatureEnum.Mage: { if (gender == GenderEnum.Male) { result = "Magier"; } if (gender == GenderEnum.Female) { result = "Magierin"; } break; } case CreatureEnum.Peasant: { if (gender == GenderEnum.Male) { result = "Bürger"; } if (gender == GenderEnum.Female) { result = "Bürgerin"; } break; } case CreatureEnum.Priest: { if (gender == GenderEnum.Male) { result = "Priester"; } if (gender == GenderEnum.Female) { result = "Priesterin"; } break; } case CreatureEnum.Slavehunter: { if (gender == GenderEnum.Male) { result = "Sklavenjäger"; } if (gender == GenderEnum.Female) { result = "Sklavenjägerin"; } break; } case CreatureEnum.Soldier: { if (gender == GenderEnum.Male) { result = "Soldat"; } if (gender == GenderEnum.Female) { result = "Soldatin"; } break; } case CreatureEnum.Sorcerer: { if (gender == GenderEnum.Male) { result = "Illusionist"; } if (gender == GenderEnum.Female) { result = "Illusionistin"; } break; } case CreatureEnum.Spearman: { if (gender == GenderEnum.Male) { result = "Lanzenträger"; } if (gender == GenderEnum.Female) { result = "Lanzenträgerin"; } break; } case CreatureEnum.Warlock: { if (gender == GenderEnum.Male) { result = "Hexenmeister"; } if (gender == GenderEnum.Female) { result = "Hexenmeisterin"; } break; } case CreatureEnum.Warlord: { if (gender == GenderEnum.Male) { result = "Kriegsherr"; } if (gender == GenderEnum.Female) { result = "Kriegsherrin"; } break; } case CreatureEnum.Wizard: { if (gender == GenderEnum.Male) { result = "Zauberer"; } if (gender == GenderEnum.Female) { result = "Zauberin"; } break; } default: { result = "Unbekannt"; break; } } return result; }