private IEntityInfo GenerateEntityInfo(EntityRace race, EntityOccupation occupation) { if (occupation == EntityOccupation.None) { occupation = GetRandomOccupation(); } if (race == EntityRace.None) { race = GetRandomRace(); } string firstName = ""; string lastName = ""; if (race.HasFlag(EntityRace.Male)) { int nameIndex = GameGlobal.RandomInt(0, Names[EntityRace.Human | EntityRace.Male].Length); firstName = Names[EntityRace.Human | EntityRace.Male][nameIndex]; nameIndex = GameGlobal.RandomInt(0, Names[EntityRace.Human | EntityRace.Family].Length); lastName = Names[EntityRace.Human | EntityRace.Family][nameIndex]; } else if (race.HasFlag(EntityRace.Female)) { int nameIndex = GameGlobal.RandomInt(0, Names[EntityRace.Human | EntityRace.Female].Length); firstName = Names[EntityRace.Human | EntityRace.Male][nameIndex]; nameIndex = GameGlobal.RandomInt(0, Names[EntityRace.Human | EntityRace.Family].Length); lastName = Names[EntityRace.Human | EntityRace.Family][nameIndex]; } return(new EntityInfo(race, occupation, 25 * 365, firstName, lastName)); }
public EntityInfo(EntityRace race, EntityOccupation occupation, int daysOld, string firstName, string lastName = null) { this.FirstName = firstName; this.LastName = lastName; this.Race = race; this.Occupation = occupation; this.DayOfBirth = (Globals.WorldDayCurrent - daysOld); // this generates the full name of the entity as it will be referenced in most places within the game if (!string.IsNullOrEmpty(LastName)) { if (Occupation != EntityOccupation.None) { Name = FirstName + " " + LastName + " the " + Occupation.ToString(); } else { Name = FirstName + " " + LastName; } } else { if (Occupation != EntityOccupation.None) { Name = FirstName + " the " + Occupation.ToString(); } else { Name = FirstName; } } }
public EntityProfile(int level, EntityOccupation occupation, EntityRace race, float difficulty) { Level = level; Race = race; Occupation = occupation; Difficulty = difficulty; }