public void UpdateCareerSettings(CareerSettings settings) { if (mCareerSettings.ContainsKey(settings.mName)) { mCareerSettings[settings.mName] = settings; } else { mCareerSettings.Add(settings.mName, settings); } SetCareerData(settings); }
public void SetDefaults() { Career career = CareerManager.GetStaticCareer(mName); if (career != null) { CareerSettings settings = new CareerSettings(); settings.mName = mName; settings.mMinCoworkers = career.SharedData.MinCoworkers; settings.mMaxCoworkers = career.SharedData.MaxCoworkers; mDefaults = settings; } }
public void SetCareerData(CareerSettings settings) { if (settings != null) { if (settings.mName == OccupationNames.Any) { foreach (Career career in CareerManager.CareerList) { career.SharedData.MinCoworkers = settings.mMinCoworkers; career.SharedData.MaxCoworkers = settings.mMaxCoworkers; } } else { Career career = CareerManager.GetStaticCareer(settings.mName); if (career != null) { career.SharedData.MinCoworkers = settings.mMinCoworkers; career.SharedData.MaxCoworkers = settings.mMaxCoworkers; foreach (string branch in career.CareerLevels.Keys) { foreach (KeyValuePair <int, Sims3.Gameplay.Careers.CareerLevel> levelData in career.CareerLevels[branch]) { CareerLevelSettings levelSettings = settings.GetSettingsForLevel(branch, levelData.Key, false); if (levelSettings != null) { levelData.Value.PayPerHourBase = levelSettings.mPayPerHourBase; levelData.Value.CarpoolType = levelSettings.mCarpoolType; } } } } } foreach (Sim sim in LotManager.Actors) { if (sim.Occupation != null) { sim.Occupation.RescheduleCarpool(); } } } }
public CareerSettings GetCareerSettings(OccupationNames name, bool create) { CareerSettings result; if (mCareerSettings.TryGetValue(name, out result)) { return(result); } else { if (create) { CareerSettings settings = new CareerSettings(name); CareerSettings cloned = settings.mDefaults.Clone(); cloned.SetDefaults(); return(cloned); } } return(null); }
public void SetCareerData(CareerSettings settings) { if (settings != null) { if (settings.mName == OccupationNames.Any) { foreach (Career career in CareerManager.CareerList) { career.SharedData.MinCoworkers = settings.minCoworkers; career.SharedData.MaxCoworkers = settings.maxCoworkers; } } else { Career career = CareerManager.GetStaticCareer(settings.mName); if (career != null) { career.SharedData.MinCoworkers = settings.minCoworkers; career.SharedData.MaxCoworkers = settings.maxCoworkers; } } } }