public void SetAvailability(SettingsKey key, InteractionTuning tuning, Availability.FlagField availability, bool set) { if ((mFlags & Flags.Availability) == Flags.None) { mAvailability = tuning.Availability.mFlags; } mFlags |= Flags.Availability; if (set) { mAvailability |= availability; } else { mAvailability &= ~availability; } if (Retuner.StoreDefault(key, tuning)) { if (set) { tuning.Availability.AddFlags(availability); } else { tuning.Availability.RemoveFlags(availability); } } }
public void SetAutonomous(SettingsKey key, ActionData data, bool value) { mAutonomous = value; mFlags |= Flags.Autonomous; if (Retuner.StoreDefault(key, data)) { data.mAutonomous = value; } }
public void SetUserDirected(SettingsKey key, ActionData data, bool value) { mUserDirected = value; mFlags |= Flags.UserDirected; if (Retuner.StoreDefault(key, data)) { data.mUserDirectedOnly = value; } }
protected void SetAvailability(SettingsKey key, InteractionTuning tuning, Availability.FlagField availability) { mAvailability = availability; mFlags |= Flags.Availability; if (Retuner.StoreDefault(key, tuning)) { tuning.Availability.mFlags = mAvailability; } }
public void Apply(SettingsKey key) { try { if (Retuner.StoreDefault(key, Clone().SetToDefault(null))) { PrivateApply(null); } } catch (Exception e) { Common.Exception(ToString(), e); } }
protected void SetAdvertised(SettingsKey key, InteractionTuning tuning, Dictionary <CommodityKind, float> advertised) { if (Retuner.StoreDefault(key, tuning)) { foreach (KeyValuePair <CommodityKind, float> pair in advertised) { foreach (CommodityChange change in tuning.mTradeoff.mOutputs) { if (change.Commodity == pair.Key) { change.mConstantChange = pair.Value; } } } } }
public void SetTargetAgeSpecies(SettingsKey key, ActionData data, List <CASAGSAvailabilityFlags> ageSpeciesList) { mTargetAgeSpeciesList = null; mFlags |= Flags.TargetAgeSpecies; mTargetAgeSpecies = CASAGSAvailabilityFlags.None; foreach (CASAGSAvailabilityFlags ageSpecies in ageSpeciesList) { mTargetAgeSpecies |= ageSpecies; } if (Retuner.StoreDefault(key, data)) { data.mTargetAgeAllowed = mTargetAgeSpecies; } }
public void SetAgeSpecies(SettingsKey key, InteractionTuning tuning, List <CASAGSAvailabilityFlags> ageSpeciesList) { mAgeSpeciesList = null; mFlags |= Flags.AgeSpecies; mAgeSpecies = CASAGSAvailabilityFlags.None; foreach (CASAGSAvailabilityFlags ageSpecies in ageSpeciesList) { mAgeSpecies |= ageSpecies; } if (Retuner.StoreDefault(key, tuning)) { tuning.Availability.AgeSpeciesAvailabilityFlags = mAgeSpecies; } }
public void SetAutonomous(SettingsKey key, InteractionTuning tuning, bool value) { mAutonomous = value; mFlags |= Flags.Autonomous; if (Retuner.StoreDefault(key, tuning)) { if (value) { tuning.RemoveFlags(InteractionTuning.FlagField.DisallowAutonomous); } else { tuning.AddFlags(InteractionTuning.FlagField.DisallowAutonomous); } } }
public void SetUserDirected(SettingsKey key, InteractionTuning tuning, bool value) { mUserDirected = value; mFlags |= Flags.UserDirected; if (Retuner.StoreDefault(key, tuning)) { if (value) { tuning.RemoveFlags(InteractionTuning.FlagField.DisallowUserDirected); } else { tuning.AddFlags(InteractionTuning.FlagField.DisallowUserDirected); } } }
public void SetAllowPregnant(SettingsKey key, ActionData data, bool value) { mAllowPregnant = value; mFlags |= Flags.AllowPregnant; if (Retuner.StoreDefault(key, data)) { // Inverted if (!value) { data.mDataBits |= ActionDataBase.ActionDataBits.DisallowedIfPregnant; } else { data.mDataBits &= ~ActionDataBase.ActionDataBits.DisallowedIfPregnant; } } }