예제 #1
0
            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"));
                }
            }
예제 #2
0
        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);
        }
예제 #3
0
 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;
 }
예제 #4
0
            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;
                    }
                }
            }
예제 #5
0
            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;
                }
            }
예제 #6
0
            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", ','));
                }
            }
예제 #7
0
            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;
                }
            }
예제 #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;
                }
            }
예제 #9
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;
                }
            }
예제 #10
0
        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);
        }
예제 #11
0
            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;
                }
            }
예제 #12
0
        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);
            }
        }
예제 #13
0
            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);
            }
예제 #14
0
            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;
                }
            }
예제 #15
0
            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;
                    }
                }
            }
예제 #16
0
            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;
                }
            }
예제 #17
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;
                }
            }
예제 #18
0
            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;
                }
            }
예제 #19
0
 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;
 }
예제 #20
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;
                }
            }
예제 #21
0
파일: Retuner.cs 프로젝트: Robobeurre/NRaas
        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;
        }
예제 #22
0
파일: Retuner.cs 프로젝트: Robobeurre/NRaas
        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;
        }
예제 #23
0
            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"));
                }
            }
예제 #24
0
            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", ','));
                }
            }
예제 #25
0
 public ByAgeSpeciesOption(CASAGSAvailabilityFlags ageSpecies, List <InteractionTuning> tuning)
     : base(Common.Localize("AgeSpecies:" + ageSpecies))
 {
     mTuning = tuning;
 }
예제 #26
0
            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);
                            }
                        }
                    }
                }
            }