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 Import(Persistence.Lookup settings) { mName = settings.GetString("Name"); if (settings.Exists("Autonomous")) { mAutonomous = settings.GetBool("Autonomous", false); mFlags |= Flags.Autonomous; } if (settings.Exists("UserDirected")) { mUserDirected = settings.GetBool("UserDirected", false); mFlags |= Flags.UserDirected; } if (settings.Exists("AgeSpecies")) { mAgeSpecies = settings.GetEnum <CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.AgeSpecies; mAgeSpeciesList = null; } if (settings.Exists("Availability")) { mAvailability = settings.GetEnum <Availability.FlagField>("Availability", Availability.FlagField.None); mFlags |= Flags.Availability; } if (settings.Exists("Advertised")) { mAdvertisedOutputs.Clear(); ParseAdvertised(settings.GetStringList("Advertised")); } }
public ITUNSettings(ITUNSettings setting) : this(setting.mName) { mAutonomous = setting.mAutonomous; mUserDirected = setting.mUserDirected; mAgeSpecies = setting.mAgeSpecies; mAvailability = setting.mAvailability; mAdvertisedOutputs = new Dictionary <CommodityKind, float>(mAdvertisedOutputs); mFlags = setting.mFlags; }
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 ITUNSettings(string name, InteractionTuning tuning, bool isDefault) : this(name) { mAutonomous = !tuning.HasFlags(InteractionTuning.FlagField.DisallowAutonomous); mUserDirected = !tuning.HasFlags(InteractionTuning.FlagField.DisallowUserDirected); mAgeSpecies = tuning.Availability.AgeSpeciesAvailabilityFlags; mAvailability = tuning.Availability.mFlags; if (isDefault) { mFlags = Flags.All; } }
public ITUNSettings(string name, XmlDbRow row) : this(name) { mFlags = Flags.None; if (row.Exists("Autonomous")) { mAutonomous = row.GetBool("Autonomous"); mFlags |= Flags.Autonomous; } if (row.Exists("UserDirected")) { mUserDirected = row.GetBool("UserDirected"); mFlags |= Flags.UserDirected; } if (row.Exists("AgeSpecies")) { mAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None); if (mAgeSpecies == CASAGSAvailabilityFlags.None) { BooterLogger.AddError("Unknown AgeSpecies: " + row.GetString("AgeSpecies")); } else { mFlags |= Flags.AgeSpecies; mAgeSpeciesList = null; } } if (row.Exists("Availability")) { mAvailability = row.GetEnum <Availability.FlagField>("Availability", Availability.FlagField.None); if (mAvailability == Availability.FlagField.None) { BooterLogger.AddError("Unknown Availability: " + row.GetString("Availability")); } else { mFlags |= Flags.Availability; } } if (row.Exists("Advertised")) { ParseAdvertised(row.GetStringList("Advertised", ',')); } }
public void Import(Persistence.Lookup settings) { mName = settings.GetString("Name"); if (settings.Exists("Autonomous")) { mAutonomous = settings.GetBool("Autonomous", false); mFlags |= Flags.Autonomous; } if (settings.Exists("UserDirected")) { mUserDirected = settings.GetBool("UserDirected", false); mFlags |= Flags.UserDirected; } if (settings.Exists("AgeSpecies")) { mAgeSpecies = settings.GetEnum<CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.AgeSpecies; mAgeSpeciesList = null; } if (settings.Exists("Availability")) { mAvailability = settings.GetEnum<Availability.FlagField>("Availability", Availability.FlagField.None); mFlags |= Flags.Availability; } if (settings.Exists("Advertised")) { mAdvertisedOutputs.Clear(); ParseAdvertised(settings.GetStringList("Advertised")); } }
public bool HasAvailability(Availability.FlagField flag, out bool result) { result = ((mAvailability & flag) == flag); return((mFlags & Flags.Availability) != Flags.None); }
public ITUNSettings(string name, XmlDbRow row) : this(name) { mFlags = Flags.None; if (row.Exists("Autonomous")) { mAutonomous = row.GetBool("Autonomous"); mFlags |= Flags.Autonomous; } if (row.Exists("UserDirected")) { mUserDirected = row.GetBool("UserDirected"); mFlags |= Flags.UserDirected; } if (row.Exists("AgeSpecies")) { mAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None); if (mAgeSpecies == CASAGSAvailabilityFlags.None) { BooterLogger.AddError("Unknown AgeSpecies: " + row.GetString("AgeSpecies")); } else { mFlags |= Flags.AgeSpecies; mAgeSpeciesList = null; } } if (row.Exists("Availability")) { mAvailability = row.GetEnum<Availability.FlagField>("Availability", Availability.FlagField.None); if (mAvailability == Availability.FlagField.None) { BooterLogger.AddError("Unknown Availability: " + row.GetString("Availability")); } else { mFlags |= Flags.Availability; } } if (row.Exists("Advertised")) { ParseAdvertised(row.GetStringList("Advertised", ',')); } }
public ITUNSettings(ITUNSettings setting) : this(setting.mName) { mAutonomous = setting.mAutonomous; mUserDirected = setting.mUserDirected; mAgeSpecies = setting.mAgeSpecies; mAvailability = setting.mAvailability; mAdvertisedOutputs = new Dictionary<CommodityKind, float>(mAdvertisedOutputs); mFlags = setting.mFlags; }