Esempio n. 1
0
            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);
                    }
                }
            }
Esempio n. 2
0
            public void SetAutonomous(SettingsKey key, ActionData data, bool value)
            {
                mAutonomous = value;

                mFlags |= Flags.Autonomous;

                if (Retuner.StoreDefault(key, data))
                {
                    data.mAutonomous = value;
                }
            }
Esempio n. 3
0
            public void SetUserDirected(SettingsKey key, ActionData data, bool value)
            {
                mUserDirected = value;

                mFlags |= Flags.UserDirected;

                if (Retuner.StoreDefault(key, data))
                {
                    data.mUserDirectedOnly = value;
                }
            }
Esempio n. 4
0
            protected void SetAvailability(SettingsKey key, InteractionTuning tuning, Availability.FlagField availability)
            {
                mAvailability = availability;

                mFlags |= Flags.Availability;

                if (Retuner.StoreDefault(key, tuning))
                {
                    tuning.Availability.mFlags = mAvailability;
                }
            }
Esempio n. 5
0
 public void Apply(SettingsKey key)
 {
     try
     {
         if (Retuner.StoreDefault(key, Clone().SetToDefault(null)))
         {
             PrivateApply(null);
         }
     }
     catch (Exception e)
     {
         Common.Exception(ToString(), e);
     }
 }
Esempio n. 6
0
 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;
                 }
             }
         }
     }
 }
Esempio n. 7
0
            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;
                }
            }
Esempio n. 8
0
            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;
                }
            }
Esempio n. 9
0
            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);
                    }
                }
            }
Esempio n. 10
0
            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);
                    }
                }
            }
Esempio n. 11
0
            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;
                    }
                }
            }