public Character() { name = ""; gender = Constants.Gender.Male; agility = new PrimaryStat(Constants.StatType.Agility, 10, 0, 20); might = new PrimaryStat(Constants.StatType.Might, 10, 0, 20); stamina = new PrimaryStat(Constants.StatType.Stamina, 10, 0, 20); knowledge = new PrimaryStat(Constants.StatType.Knowledge, 10, 0, 20); perception = new PrimaryStat(Constants.StatType.Perception, 10, 0, 20); willpower = new PrimaryStat(Constants.StatType.Willpower, 10, 0, 20); unspentPoints = 0; calculateDerivedStats(); initializeSkills(); }
private object gender; // will be female or male set at instantiation public Person(Constants.Gender g, string n, int h, int w, Constants.HairColor hc, Constants.EyeColor ec, decimal ss, int dscs, bool m = false, int nk = 0) { // create a gender based object switch (g) { case Constants.Gender.Female: gender = new Female(n, h, w, hc, ec, ss, dscs); break; case Constants.Gender.Male: gender = new Male(n, h, w, hc, ec, ss, dscs); break; default: throw new Exception("invalid gender"); } // set person specific fields married = m; numKids = nk; // get a new id idNum = nextIdNum++; }
public void setGender(Constants.Gender newGender) { gender = newGender; }