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 static bool Allow(CASAGSAvailabilityFlags value) { switch (value) { case CASAGSAvailabilityFlags.All: case CASAGSAvailabilityFlags.AllAnimalsMask: case CASAGSAvailabilityFlags.AllCatsMask: case CASAGSAvailabilityFlags.AllDogsMask: case CASAGSAvailabilityFlags.AllDomesticAnimalsMask: case CASAGSAvailabilityFlags.AllHorsesMask: case CASAGSAvailabilityFlags.AllLittleDogsMask: case CASAGSAvailabilityFlags.AllWildAnimalsMask: case CASAGSAvailabilityFlags.Female: case CASAGSAvailabilityFlags.GenderMask: case CASAGSAvailabilityFlags.HandednessMask: case CASAGSAvailabilityFlags.HumanAgeMask: case CASAGSAvailabilityFlags.LeftHanded: case CASAGSAvailabilityFlags.Male: case CASAGSAvailabilityFlags.None: case CASAGSAvailabilityFlags.RightHanded: case CASAGSAvailabilityFlags.SimLeadingHorse: case CASAGSAvailabilityFlags.SimWalkingDog: case CASAGSAvailabilityFlags.SimWalkingLittleDog: return(false); } return(true); }
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; }
public ActionDataSetting(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("AllowPregnant")) { mAllowPregnant = row.GetBool("AllowPregnant"); mFlags |= Flags.AllowPregnant; } if (row.Exists("ActorAgeSpecies")) { mActorAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.All); if (mActorAgeSpecies == CASAGSAvailabilityFlags.All) { BooterLogger.AddError("Unknown ActorAgeSpecies: " + row.GetString("ActorAgeSpecies")); } else { mFlags |= Flags.ActorAgeSpecies; mActorAgeSpeciesList = null; } } if (row.Exists("TargetAgeSpecies")) { mTargetAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.All); if (mTargetAgeSpecies == CASAGSAvailabilityFlags.All) { BooterLogger.AddError("Unknown TargetAgeSpecies: " + row.GetString("TargetAgeSpecies")); } else { mFlags |= Flags.TargetAgeSpecies; mTargetAgeSpeciesList = null; } } }
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 ActionDataSetting(ActionData data, bool isDefault) : this(data.Key) { mAutonomous = data.Autonomous; mUserDirected = data.UserDirectedOnly; mAllowPregnant = !data.DisallowedIfPregnant; mActorAgeSpecies = data.ActorAgeSpeciesAllowed; mTargetAgeSpecies = data.TargetAgeSpeciesAllowed; if (isDefault) { mFlags = Flags.All; } }
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 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 static List <CASAGSAvailabilityFlags> AgeSpeciesToList(CASAGSAvailabilityFlags flags) { List <CASAGSAvailabilityFlags> results = new List <CASAGSAvailabilityFlags>(); foreach (CASAGSAvailabilityFlags ageSpecies in Enum.GetValues(typeof(CASAGSAvailabilityFlags))) { if (!Allow(ageSpecies)) { continue; } if ((flags & ageSpecies) == ageSpecies) { results.Add(ageSpecies); } } return(results); }
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("AllowPregnant")) { mAllowPregnant = settings.GetBool("AllowPregnant", false); mFlags |= Flags.AllowPregnant; } if (settings.Exists("ActorAgeSpecies")) { mActorAgeSpecies = settings.GetEnum <CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.ActorAgeSpecies; mActorAgeSpeciesList = null; } if (settings.Exists("TargetAgeSpecies")) { mTargetAgeSpecies = settings.GetEnum <CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.TargetAgeSpecies; mTargetAgeSpeciesList = null; } }
public void AddAncientPortal() { try { if (mPortal.GetRoutingSlots().Length == 0) { return; } Vector3 startPos = Owner.GetPositionOfSlot(mPortal.GetRoutingSlots()[0]); Vector3 endPos = mPortal.PositionOnFloor; CASAGSAvailabilityFlags ageFlags = CASAGSAvailabilityFlags.HumanYoungAdult | CASAGSAvailabilityFlags.HumanTeen | CASAGSAvailabilityFlags.HumanAdult | CASAGSAvailabilityFlags.HumanElder | CASAGSAvailabilityFlags.HumanChild | CASAGSAvailabilityFlags.Male | CASAGSAvailabilityFlags.Female | CASAGSAvailabilityFlags.LeftHanded | CASAGSAvailabilityFlags.RightHanded; //ageFlags |= CASAGSAvailabilityFlags.CatAdult | CASAGSAvailabilityFlags.CatElder | CASAGSAvailabilityFlags.DogAdult | CASAGSAvailabilityFlags.DogElder | CASAGSAvailabilityFlags.LittleDogAdult | CASAGSAvailabilityFlags.LittleDogElder; Route.AddPortal(Owner.ObjectId, startPos, endPos, 1f, PortalType.PortalTypeAnimateThrough, RoutePortalFlags.OneWayPortal, ageFlags); Route.AddPortal(Owner.ObjectId, endPos, startPos, 1f, PortalType.PortalTypeAnimateThrough, RoutePortalFlags.OneWayPortal, ageFlags); } catch (Exception e) { Common.Exception("AddAncientPortal", e); } }
public static List <InteractionObjectPair> GetInteractions(Sim target) { List <InteractionObjectPair> results = new List <InteractionObjectPair>(); List <InteractionObjectPair> list = new List <InteractionObjectPair>(); if (target.IsHuman) { new Sim.PlaySpecificLoopingAnimation.Definition().AddInteractions(null, target, target, list); foreach (InteractionObjectPair pair in list) { PlaySpecificLoopingAnimationEx.Definition definition = new PlaySpecificLoopingAnimationEx.Definition(pair.InteractionDefinition as Sim.PlaySpecificLoopingAnimation.Definition); if (!GameUtils.IsInstalled(definition.mProductVersion)) { continue; } if (!Sim.AnimationClipDataForCAS.SimCanPlayAnimation(target, definition.ClipName)) { continue; } results.Add(new InteractionObjectPair(definition, target)); } } list.Clear(); new Sim.PlaySpecificIdle.Definition().AddInteractions(null, target, target, list); CASAGSAvailabilityFlags flags = target.SimDescription.GetCASAGSAvailabilityFlags(); foreach (InteractionObjectPair pair in list) { PlaySpecificIdleEx.Definition definition = new PlaySpecificIdleEx.Definition(pair.InteractionDefinition as Sim.PlaySpecificIdle.Definition); if ((definition.Idle.AgeSpeciesRestrictions & flags) == flags) { continue; } results.Add(new InteractionObjectPair(definition, target)); } if (target.IsHuman) { foreach (KeyValuePair <string, Sim.AnimationClipDataForCAS[]> animations in Sim.AnimationClipDataForCAS.sCasAnimations) { string name = null; switch (animations.Key) { case "CasFullBodyAnimations": name = Common.LocalizeEAString("Gameplay/Actors/Sim:Cheat_FullBodyAnimationSuite"); break; case "CasFaceAnimations": name = Common.LocalizeEAString("Gameplay/Actors/Sim:Cheat_FaceAnimationSuite"); break; default: name = animations.Key; break; } foreach (Sim.AnimationClipDataForCAS rcas in animations.Value) { if (!Sim.AnimationClipDataForCAS.SimCanPlayAnimation(target, rcas.AnimationClipName)) { continue; } PlaySuiteLoopingAnimationEx.Definition definition = new PlaySuiteLoopingAnimationEx.Definition(rcas, name); results.Add(new InteractionObjectPair(definition, target)); } } } return(results); }
public ActionDataSetting(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("AllowPregnant")) { mAllowPregnant = row.GetBool("AllowPregnant"); mFlags |= Flags.AllowPregnant; } if (row.Exists("ActorAgeSpecies")) { mActorAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.All); if (mActorAgeSpecies == CASAGSAvailabilityFlags.All) { BooterLogger.AddError("Unknown ActorAgeSpecies: " + row.GetString("ActorAgeSpecies")); } else { mFlags |= Flags.ActorAgeSpecies; mActorAgeSpeciesList = null; } } if (row.Exists("TargetAgeSpecies")) { mTargetAgeSpecies = row.GetEnum<CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.All); if (mTargetAgeSpecies == CASAGSAvailabilityFlags.All) { BooterLogger.AddError("Unknown TargetAgeSpecies: " + row.GetString("TargetAgeSpecies")); } else { mFlags |= Flags.TargetAgeSpecies; mTargetAgeSpeciesList = null; } } }
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("AllowPregnant")) { mAllowPregnant = settings.GetBool("AllowPregnant", false); mFlags |= Flags.AllowPregnant; } if (settings.Exists("ActorAgeSpecies")) { mActorAgeSpecies = settings.GetEnum<CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.ActorAgeSpecies; mActorAgeSpeciesList = null; } if (settings.Exists("TargetAgeSpecies")) { mTargetAgeSpecies = settings.GetEnum<CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.None); mFlags |= Flags.TargetAgeSpecies; mTargetAgeSpeciesList = null; } }
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 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; }
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 static bool Allow(CASAGSAvailabilityFlags value) { switch (value) { case CASAGSAvailabilityFlags.All: case CASAGSAvailabilityFlags.AllAnimalsMask: case CASAGSAvailabilityFlags.AllCatsMask: case CASAGSAvailabilityFlags.AllDogsMask: case CASAGSAvailabilityFlags.AllDomesticAnimalsMask: case CASAGSAvailabilityFlags.AllHorsesMask: case CASAGSAvailabilityFlags.AllLittleDogsMask: case CASAGSAvailabilityFlags.AllWildAnimalsMask: case CASAGSAvailabilityFlags.Female: case CASAGSAvailabilityFlags.GenderMask: case CASAGSAvailabilityFlags.HandednessMask: case CASAGSAvailabilityFlags.HumanAgeMask: case CASAGSAvailabilityFlags.LeftHanded: case CASAGSAvailabilityFlags.Male: case CASAGSAvailabilityFlags.None: case CASAGSAvailabilityFlags.RightHanded: case CASAGSAvailabilityFlags.SimLeadingHorse: case CASAGSAvailabilityFlags.SimWalkingDog: case CASAGSAvailabilityFlags.SimWalkingLittleDog: return false; } return true; }
public static List<CASAGSAvailabilityFlags> AgeSpeciesToList(CASAGSAvailabilityFlags flags) { List<CASAGSAvailabilityFlags> results = new List<CASAGSAvailabilityFlags>(); foreach (CASAGSAvailabilityFlags ageSpecies in Enum.GetValues(typeof(CASAGSAvailabilityFlags))) { if (!Allow(ageSpecies)) continue; if ((flags & ageSpecies) == ageSpecies) { results.Add(ageSpecies); } } return results; }
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(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 ByAgeSpeciesOption(CASAGSAvailabilityFlags ageSpecies, List <InteractionTuning> tuning) : base(Common.Localize("AgeSpecies:" + ageSpecies)) { mTuning = tuning; }
public void Load(XmlDbRow row) { sCustomNames = true; CASAGSAvailabilityFlags specieFlags = ParserFunctions.ParseAllowableAgeSpecies(row, "Species"); string totalName = row.GetString("Name"); if (string.IsNullOrEmpty(totalName)) { return; } //BooterLogger.AddError("Names Found: " + totalName); string[] names = totalName.Split(','); bool exclusion = row.GetBool("Exclude"); bool isMale = false; bool isFemale = false; { CASAgeGenderFlags gender = row.GetEnum <CASAgeGenderFlags>("Gender", CASAgeGenderFlags.Male | CASAgeGenderFlags.Female); if ((gender & CASAgeGenderFlags.Male) == CASAgeGenderFlags.Male) { isMale = true; } if ((gender & CASAgeGenderFlags.Female) == CASAgeGenderFlags.Female) { isFemale = true; } } List <CASAgeGenderFlags> species = new List <CASAgeGenderFlags>(); if ((specieFlags & CASAGSAvailabilityFlags.AllCatsMask) != CASAGSAvailabilityFlags.None) { species.Add(CASAgeGenderFlags.Cat); } if ((specieFlags & CASAGSAvailabilityFlags.AllDogsMask) != CASAGSAvailabilityFlags.None) { species.Add(CASAgeGenderFlags.Dog); } if ((specieFlags & CASAGSAvailabilityFlags.AllLittleDogsMask) != CASAGSAvailabilityFlags.None) { species.Add(CASAgeGenderFlags.LittleDog); } if ((specieFlags & CASAGSAvailabilityFlags.AllHorsesMask) != CASAGSAvailabilityFlags.None) { species.Add(CASAgeGenderFlags.Horse); } if ((specieFlags & CASAGSAvailabilityFlags.HumanAgeMask) != CASAGSAvailabilityFlags.None) { species.Add(CASAgeGenderFlags.Human); } foreach (CASAgeGenderFlags specie in species) { Genders genderList; if (!mLoadedNames.TryGetValue(specie, out genderList)) { genderList = new Genders(); mLoadedNames.Add(specie, genderList); } for (int i = 0; i < names.Length; i++) { string name = names[i].Trim(); if (isMale) { if (exclusion) { genderList.GetExclusions(false).Add(name, true); } else { genderList.GetNames(false).Add(name); } } if (isFemale) { if (exclusion) { genderList.GetExclusions(true).Add(name, true); } else { genderList.GetNames(true).Add(name); } } } } }