Esempio n. 1
0
        public SocialSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Social", Guid))
            {
                mSocial = row.GetString("Social");

                if (mSocial != "Braaaiiins")
                {
                    if (ActionData.Get(mSocial) == null)
                    {
                        BooterLogger.AddError(Guid + " Invalid Social: " + mSocial);
                    }
                }
            }

            if (BooterLogger.Exists(row, "RoomOnly", Guid))
            {
                mRoomOnly = row.GetBool("RoomOnly");
            }

            mScoring = row.GetString("Scoring");

            if (!string.IsNullOrEmpty(mScoring))
            {
                if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Guid + " Invalid Scoring: " + mScoring);
                }

                mMinimum = row.GetInt("Minimum", 0);
            }
        }
Esempio n. 2
0
        public MoodletSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "BuffName", Guid))
            {
                if (!row.TryGetEnum <BuffNames>("BuffName", out mBuff, BuffNames.Undefined))
                {
                    mBuff = (BuffNames)row.GetUlong("BuffName", 0);
                    if (mBuff == 0)
                    {
                        mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName"));
                    }

                    if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff))
                    {
                        BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName"));
                    }
                }
            }

            mMoodValue = row.GetInt("MoodValue", 0);

            mDuration = row.GetInt("Duration", 30);
            if (mDuration <= 0)
            {
                mDuration = -1;
            }

            mOrigin = (Origin)row.GetUlong("Origin", 0);
            if (mOrigin == Origin.None)
            {
                mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin"));
            }
        }
Esempio n. 3
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("AgeGender"))
            {
                error = "AgeGender Missing";
            }
            else
            {
                if (!ParserFunctions.TryParseEnum <CASAgeGenderFlags>(row.GetString("AgeGender"), out mAgeGender, CASAgeGenderFlags.None))
                {
                    error = "Unknown AgeGender " + row.GetString("AgeGender");
                    return(false);
                }
            }

            StringToSpeciesList converter = new StringToSpeciesList();

            mSpecies = converter.Convert(row.GetString("Species"));
            if (mSpecies == null)
            {
                error = converter.mError;
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 4
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!base.Parse(row, ref error))
            {
                return(false);
            }

            if (!row.Exists("Type"))
            {
                error = "Type missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <SimType>(row.GetString("Type"), out mType, SimType.None))
            {
                error = "Unknown Type " + row.GetString("Type");
                return(false);
            }

            if (!row.Exists("OtherType"))
            {
                error = "OtherType missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <SimType>(row.GetString("OtherType"), out mOtherType, SimType.None))
            {
                error = "Unknown OtherType " + row.GetString("OtherType");
                return(false);
            }

            return(true);
        }
Esempio n. 5
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            TagStaticData data = new TagStaticData();

            string name     = row.GetString("TypeName");
            string icon     = row.GetString("Icon");
            string color    = row.GetString("ColorHEX");
            bool   business = row.GetBool("isBusinessType");

            try
            {
                data.SetGUID(name);
            }
            catch (ArgumentException e)
            {
                Common.Exception("", e);
            }

            if (!data.Valid)
            {
                return;
            }

            data.name           = name;
            data.icon           = icon;
            data.isBusinessType = business;
            data.SetColorHex(color);

            if (!Tagger.staticData.ContainsKey(data.GUID))
            {
                Tagger.staticData.Add(data.GUID, data);
                EnumInjection.InjectEnums <CommercialLotSubType>(new string[] { name }, new object[] { data.GUID }, false);
            }
        }
Esempio n. 6
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
            if (dataFile == null)
            {
                return;
            }

            mIndex++;

            string personalityName = row.GetString("Name");

            if (string.IsNullOrEmpty(personalityName))
            {
                BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
                return;
            }

            BooterLogger.AddTrace("Found " + personalityName);

            if (GetPersonality(personalityName) != null)
            {
                BooterLogger.AddError(personalityName + " Name already in use");
                return;
            }

            Type classType = row.GetClassType("FullClassName");

            if (classType == null)
            {
                BooterLogger.AddError(personalityName + " No Class");
                return;
            }

            SimPersonality personality = null;

            try
            {
                personality = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as SimPersonality;
            }
            catch
            { }

            if (personality == null)
            {
                BooterLogger.AddError(personalityName + ": Constructor Fail " + row.GetString("FullClassName"));
            }
            else
            {
                XmlDbTable optionTable = dataFile.GetTable(personalityName);
                if (personality.Parse(row, optionTable))
                {
                    sLookup.Add(personalityName.ToLower(), personality);
                }
                else
                {
                    BooterLogger.AddError(personalityName + ": Parsing Fail");
                }
            }
        }
Esempio n. 7
0
        public override bool Parse(XmlDbRow row, SimPersonality personality, ref string error)
        {
            if (!base.Parse(row, personality, ref error))
            {
                return(false);
            }

            if (!row.Exists("Name"))
            {
                error = "Name missing";
                return(false);
            }
            else if (!row.Exists("Default"))
            {
                error = "Default missing";
                return(false);
            }
            else
            {
                CASAgeGenderFlags ageGender;
                if (!ParserFunctions.TryParseEnum <CASAgeGenderFlags>(row.GetString("AgeGender"), out ageGender, CASAgeGenderFlags.None))
                {
                    error = "Unknown AgeGender " + row.GetString("AgeGender");
                    return(false);
                }

                mAge = ageGender & CASAgeGenderFlags.AgeMask;

                if (mAge == CASAgeGenderFlags.None)
                {
                    mAge = CASAgeGenderFlags.AgeMask;
                }

                mGender = ageGender & CASAgeGenderFlags.GenderMask;

                if (mGender == CASAgeGenderFlags.None)
                {
                    mGender = CASAgeGenderFlags.GenderMask;
                }

                StringToSpeciesList converter = new StringToSpeciesList();
                mSpecies = converter.Convert(row.GetString("Species"));
                if (mSpecies == null)
                {
                    error = converter.mError;
                    return(false);
                }

                if (mSpecies.Count == 0)
                {
                    mSpecies.Add(CASAgeGenderFlags.Human);
                }
            }

            mName = row.GetString("Name");

            SetValue(row.GetBool("Default"));

            return(true);
        }
Esempio n. 8
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!base.Parse(row, ref error))
            {
                return(false);
            }

            if (row.Exists("CustomSkill"))
            {
                mSkill = SkillManager.sSkillEnumValues.ParseEnumValue(row.GetString("CustomSkill"));
                if (mSkill == SkillNames.None)
                {
                    //error = "CustomSkill unknown: " + row.GetString("CustomSkill");
                    return(false);
                }
            }
            else
            {
                mSkill = SkillManager.sSkillEnumValues.ParseEnumValue(row.GetString("Skill"));
                if (mSkill == SkillNames.None)
                {
                    error = "Skill unknown: " + row.GetString("Skill");
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 9
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = row.GetString("Name");

            if (!mMinimum.Parse(row, "Minimum", Manager, ref error))
            {
                return(false);
            }

            if (!mMaximum.Parse(row, "Maximum", Manager, ref error))
            {
                return(false);
            }

            mAllowGoToJail = row.GetBool("AllowGoToJail");

            mKeepObject = row.GetBool("KeepObject");

            mSneakinessScoring = row.GetString("SneakinessScoring");

            mSuccess = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mSuccess.Parse(row, Manager, "Success", ref error))
            {
                return(false);
            }

            mFailure = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mFailure.Parse(row, Manager, "Failure", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 10
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile careerFile = new BooterHelper.DataBootFile(file.ToString(), row.GetString("Careers"), false);
            if (!careerFile.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": Unknown Careers File " + row.GetString("Careers"));
                return;
            }

            BooterHelper.DataBootFile careerEventsFile = new BooterHelper.DataBootFile(careerFile.ToString(), row.GetString("CareerEvents"), false);

            if (careerEventsFile.IsValid)
            {
                foreach (Career career in CareerManager.CareerList)
                {
                    XmlDbTable table3 = careerEventsFile.GetTable(career.Guid.ToString ());
                    if (table3 != null)
                    {
                        LoadCareerEvents(career, careerEventsFile, table3);
                    }
                }
            }

            BooterHelper.DataBootTable table = new BooterHelper.DataBootTable(careerFile, "CareerList");
            if (!table.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": No CareerList " + careerFile.ToString());
                return;
            }

            table.Load(new CareerLoader(careerEventsFile).LoadCareer);
        }
Esempio n. 11
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            TagStaticData data = new TagStaticData();

            string name = row.GetString("TypeName");
            string icon = row.GetString("Icon");
            string color = row.GetString("ColorHEX");
            bool business = row.GetBool("isBusinessType");            

            try
            {
                data.SetGUID(name);
            }
            catch (ArgumentException e)
            {
                Common.Exception("", e);
            }

            if (!data.Valid)
            {
                return;
            }

            data.name = name;
            data.icon = icon;
            data.isBusinessType = business;
            data.SetColorHex(color);

            if (!Tagger.staticData.ContainsKey(data.GUID))
            {                
                Tagger.staticData.Add(data.GUID, data);
                EnumInjection.InjectEnums<CommercialLotSubType>(new string[] { name }, new object[] { data.GUID }, false);
            }
        }
Esempio n. 12
0
        public override bool Parse(XmlDbRow row, string prefix, bool firstPass, ref string error)
        {
            mDelta = row.GetInt(prefix + "PropagateDelta", -25);

            if (row.Exists(prefix + "PropagateEnemy"))
            {
                if (!ParserFunctions.TryParseEnum <WhichSim>(row.GetString(prefix + "PropagateEnemy"), out mEnemySim, WhichSim.Actor))
                {
                    error = prefix + "PropagateEnemy unknown";
                    return(false);
                }
            }

            SimScenarioFilter.RelationshipLevel relationLevel;
            if (ParserFunctions.TryParseEnum <SimScenarioFilter.RelationshipLevel>(row.GetString(prefix + "PropagateRelationshipGate"), out relationLevel, SimScenarioFilter.RelationshipLevel.Neutral))
            {
                mRelationshipGate = (int)relationLevel;
            }
            else
            {
                mRelationshipGate = row.GetInt(prefix + "PropagateRelationshipGate", mRelationshipGate);
            }

            return(base.Parse(row, prefix, firstPass, ref error));
        }
Esempio n. 13
0
        public OmniJournalData(XmlDbRow row, int rowIndex)
            : base(row, "OmniJournal", rowIndex)
        {
            mCareerName     = row.GetString("CareerName");
            mCareerLevel    = ParserFunctions.ParseInt(row.GetString("CareerLevel"), 0);
            mCurrentEdition = ParserFunctions.ParseInt(row.GetString("StartingEdition"), 1);

            mMaxEdition = ParserFunctions.ParseInt(row.GetString("MaxEdition"), 1);

            base.MyType = BookData.BookType.MedicalJournal;

            Dictionary <int, OmniJournalData> levels;

            if (!sJournalDataList.TryGetValue(mCareerName, out levels))
            {
                levels = new Dictionary <int, OmniJournalData>();

                sJournalDataList.Add(mCareerName, levels);
            }

            if (!levels.ContainsKey(mCareerLevel))
            {
                levels.Add(mCareerLevel, this);
            }
        }
Esempio n. 14
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            string toneName = row.GetString("ToneName");
            if (string.IsNullOrEmpty(toneName)) 
            {
                BooterLogger.AddError("Tone found with no name");
                return;
            }

            Type classType = row.GetClassType("FullClassName");
            if (classType == null) 
            {
                BooterLogger.AddError("Tone: " + toneName + " FullClassName no match");
                return;
            }

            string guid = row.GetString("CareerGuid");

            OccupationNames careerGuid = OccupationNames.Undefined;
            ParserFunctions.TryParseEnum<OccupationNames>(guid, out careerGuid, OccupationNames.Undefined);

            if (careerGuid == OccupationNames.Undefined)
            {
                careerGuid = unchecked((OccupationNames)ResourceUtils.HashString64(guid));
            }

            Career staticCareer = CareerManager.GetStaticCareer (careerGuid);
            if (staticCareer == null)
            {
                BooterLogger.AddError("Tone: " + toneName + " CareerGuid no match");
                return;
            }

            staticCareer.SharedData.ToneDefinitions.Add(new CareerBooterToneDefinition(row, classType));
        }
Esempio n. 15
0
        public MoodletSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "BuffName", Guid))
            {
                if (!row.TryGetEnum<BuffNames>("BuffName", out mBuff, BuffNames.Undefined))
                {
                    mBuff = (BuffNames)row.GetUlong("BuffName", 0);
                    if (mBuff == 0)
                    {
                        mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName"));
                    }

                    if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff))
                    {
                        BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName"));
                    }
                }
            }

            mMoodValue = row.GetInt("MoodValue", 0);

            mDuration = row.GetInt("Duration", 30);
            if (mDuration <= 0)
            {
                mDuration = -1;
            }

            mOrigin = (Origin)row.GetUlong("Origin", 0);
            if (mOrigin == Origin.None)
            {
                mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin"));
            }
        }
Esempio n. 16
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("Score"))
            {
                error = "Score missing";
                return(false);
            }

            mScore = row.GetInt("Score", 0);

            if (row.Exists("CustomSkill"))
            {
                mSkill = SkillManager.sSkillEnumValues.ParseEnumValue(row.GetString("CustomSkill"));
                if (mSkill == SkillNames.None)
                {
                    //error = "CustomSkill unknown: " + row.GetString("CustomSkill");
                    return(false);
                }
            }
            else
            {
                mSkill = SkillManager.sSkillEnumValues.ParseEnumValue(row.GetString("Skill"));
                if (mSkill == SkillNames.None)
                {
                    error = "Skill Unknown: " + row.GetString("Skill");
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 17
0
            protected void LoadStage(BooterHelper.BootFile file, XmlDbRow row)
            {
                Type type = row.GetClassType("FullClassName");

                if (type == null)
                {
                    BooterLogger.AddError("Invalid FullClassName: " + row.GetString("FullClassName"));
                    return;
                }

                Stage stage = null;

                try
                {
                    stage = type.GetConstructor(new Type[] { typeof(XmlDbRow) }).Invoke(new object[] { row }) as Stage;
                }
                catch (Exception e)
                {
                    BooterLogger.AddError("Contructor Fail: " + row.GetString("FullClassName"));

                    Common.Exception(file + Common.NewLine + row.GetString("FullClassName") + " Fail", e);
                }

                if (stage != null)
                {
                    mStages.Add(stage);
                }
            }
Esempio n. 18
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mInjuredStory = row.GetString("InjuredStory");

            if (!ParserFunctions.TryParseEnum <SimDescription.DeathType>(row.GetString("Type"), out mType, SimDescription.DeathType.None))
            {
                error = "Type not valid";
                return(false);
            }

            if (mType == SimDescription.DeathType.None)
            {
                error = "Type cannot be None";
                return(false);
            }

            mSuccess = new WeightScenarioHelper(Origin.FromWatchingSimSuffer);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 19
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            string worldName = row.GetString("WorldName");

            if (string.IsNullOrEmpty(worldName))
            {
                return;
            }

            worldName = worldName.ToLower().Replace(".world", "").Replace(".World", "").Replace(".WORLD", "");

            if (sLoadedNames.ContainsKey(worldName))
            {
                return;
            }

            string fileName = row.GetString("FileName");

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            fileName = fileName.Replace(".nhd", "").Replace(".Nhd", "").Replace(".NHD", "");

            sLoadedNames.Add(worldName, fileName);
        }
Esempio n. 20
0
        public ScoringStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Scoring", Name))
            {
                mScoring = row.GetString("Scoring");
                if (string.IsNullOrEmpty(mScoring))
                {
                    BooterLogger.AddError(Name + " Empty Scoring");
                }
                else if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Name + " Invalid Scoring: " + mScoring);
                }
            }

            if (row.GetString("Minimum") == "Strength")
            {
                mMinimum = int.MinValue;
            }
            else
            {
                mMinimum = row.GetInt("Minimum", int.MinValue);
            }

            mMinMutation = row.GetString("MinMutation");
        }
Esempio n. 21
0
        public ScoringStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Scoring", Name))
            {
                mScoring = row.GetString("Scoring");
                if (string.IsNullOrEmpty(mScoring))
                {
                    BooterLogger.AddError(Name + " Empty Scoring");
                }
                else if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Name + " Invalid Scoring: " + mScoring);
                }
            }

            if (row.GetString("Minimum") == "Strength")
            {
                mMinimum = int.MinValue;
            }
            else
            {
                mMinimum = row.GetInt("Minimum", int.MinValue);
            }

            mMinMutation = row.GetString("MinMutation");
        }
Esempio n. 22
0
            public Data(XmlDbRow row, VectorBooter.Test test)
            {
                mGuid = row.GetString("GUID");

                mStory = row.GetString("Story");

                mTest = test;
            }
Esempio n. 23
0
        public override bool Parse(XmlDbRow row, SimPersonality personality, ref string error)
        {
            if (!base.Parse(row, personality, ref error)) return false;

            if (!row.Exists("Name"))
            {
                error = "Name missing";
                return false;
            }
            else if (!row.Exists("Default"))
            {
                error = "Default missing";
                return false;
            }
            else
            {
                CASAgeGenderFlags ageGender;
                if (!ParserFunctions.TryParseEnum<CASAgeGenderFlags>(row.GetString("AgeGender"), out ageGender, CASAgeGenderFlags.None))
                {
                    error = "Unknown AgeGender " + row.GetString("AgeGender");
                    return false;
                }

                mAge = ageGender & CASAgeGenderFlags.AgeMask;

                if (mAge == CASAgeGenderFlags.None)
                {
                    mAge = CASAgeGenderFlags.AgeMask;
                }

                mGender = ageGender & CASAgeGenderFlags.GenderMask;

                if (mGender == CASAgeGenderFlags.None)
                {
                    mGender = CASAgeGenderFlags.GenderMask;
                }

                StringToSpeciesList converter = new StringToSpeciesList();
                mSpecies = converter.Convert(row.GetString("Species"));
                if (mSpecies == null)
                {
                    error = converter.mError;
                    return false;
                }

                if (mSpecies.Count == 0)
                {
                    mSpecies.Add(CASAgeGenderFlags.Human);
                }
            }

            mName = row.GetString("Name");

            SetValue (row.GetBool("Default"));

            return true;
        }
Esempio n. 24
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
            if (dataFile == null) return;

            mIndex++;

            string personalityName = row.GetString("Name");
            if (string.IsNullOrEmpty(personalityName))
            {
                BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
                return;
            }

            BooterLogger.AddTrace("Found " + personalityName);

            if (GetPersonality(personalityName) != null)
            {
                BooterLogger.AddError(personalityName + " Name already in use");
                return;
            }

            Type classType = row.GetClassType("FullClassName");
            if (classType == null) 
            {
                BooterLogger.AddError(personalityName + " No Class");
                return;
            }

            SimPersonality personality = null;
            try
            {
                personality = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as SimPersonality;
            }
            catch
            { }

            if (personality == null)
            {
                BooterLogger.AddError(personalityName + ": Constructor Fail " + row.GetString("FullClassName"));
            }
            else
            {
                XmlDbTable optionTable = dataFile.GetTable(personalityName);
                if (personality.Parse(row, optionTable))
                {
                    sLookup.Add(personalityName.ToLower(), personality);
                }
                else
                {
                    BooterLogger.AddError(personalityName + ": Parsing Fail");
                }
            }
        }
Esempio n. 25
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;
                    }
                }
            }
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            SkillNames skill;
            if (!ParserFunctions.TryParseEnum<SkillNames>(row.GetString("Skill"), out skill, SkillNames.None))
            {
                BooterLogger.AddError("Invalid Skill: " + row.GetString("Skill"));
                return;
            }

            sData.Add(skill, true);

            BooterLogger.AddTrace(" Child Skill: " + row.GetString("Skill"));
        }
Esempio n. 27
0
        public HitMissTimedStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "SuccessStage", Name))
            {
                mSuccessStage.First = row.GetString("SuccessStage");
            }

            if (BooterLogger.Exists(row, "FailureStage", Name))
            {
                mFailureStage.First = row.GetString("FailureStage");
            }
        }
Esempio n. 28
0
        public HitMissStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "SuccessStage", Name))
            {
                mSuccessStage.First = row.GetString("SuccessStage");
            }

            if (BooterLogger.Exists(row, "FailureStage", Name))
            {
                mFailureStage.First = row.GetString("FailureStage");
            }
        }
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BuffNames buff;
            if (!ParserFunctions.TryParseEnum<BuffNames>(row.GetString("Moodlet"), out buff, BuffNames.Undefined))
            {
                BooterLogger.AddError("Invalid Moodlet: " + row.GetString("Moodlet"));
                return;
            }

            sData.Add(buff, true);

            BooterLogger.AddTrace(" Good Lot Moodlet: " + row.GetString("Moodlet"));
        }
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            Type type = row.GetClassType("Type");
            if (type == null)
            {
                BooterLogger.AddError("Invalid Type: " + row.GetString("Type"));
                return;
            }

            sData.Add(type, true);

            BooterLogger.AddTrace(" Discount Type: " + row.GetString("Type"));
        }
Esempio n. 31
0
        protected bool ParseBuffs(XmlDbRow row, string prefix1, string prefix2, Dictionary <BuffNames, Origin> buffs, ref string error)
        {
            if ((!string.IsNullOrEmpty(prefix2)) && (!ParseBuffs(row, prefix1, null, buffs, ref error)))
            {
                return(false);
            }

            string prefix = prefix1 + prefix2;

            int index = 0;

            while (true)
            {
                if (!row.Exists(prefix + "Buff" + index))
                {
                    break;
                }

                BuffNames buff;
                if (!ParserFunctions.TryParseEnum <BuffNames>(row.GetString(prefix + "Buff" + index), out buff, BuffNames.Undefined))
                {
                    error = prefix + "Buff" + index + " unknown";
                    return(false);
                }

                if (buffs.ContainsKey(buff))
                {
                    error = prefix + "Buff " + buff + " already found";
                    return(false);
                }

                if (!row.Exists(prefix + "Origin" + index))
                {
                    error = prefix + "Origin" + index + " missing";
                    return(false);
                }

                Origin origin;
                if (!ParserFunctions.TryParseEnum <Origin>(row.GetString(prefix + "Origin" + index), out origin, Origin.None))
                {
                    error = prefix + "Origin" + index + " unknown";
                    return(false);
                }

                buffs.Add(buff, origin);

                index++;
            }

            return(true);
        }
Esempio n. 32
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            SkillNames skill;

            if (!ParserFunctions.TryParseEnum <SkillNames>(row.GetString("Skill"), out skill, SkillNames.None))
            {
                BooterLogger.AddError("Invalid Skill: " + row.GetString("Skill"));
                return;
            }

            sData.Add(skill, true);

            BooterLogger.AddTrace(" Child Skill: " + row.GetString("Skill"));
        }
Esempio n. 33
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            Type type = row.GetClassType("Type");

            if (type == null)
            {
                BooterLogger.AddError("Invalid Type: " + row.GetString("Type"));
                return;
            }

            sData.Add(type, true);

            BooterLogger.AddTrace(" Discount Type: " + row.GetString("Type"));
        }
Esempio n. 34
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BuffNames buff;

            if (!ParserFunctions.TryParseEnum <BuffNames>(row.GetString("Moodlet"), out buff, BuffNames.Undefined))
            {
                BooterLogger.AddError("Invalid Moodlet: " + row.GetString("Moodlet"));
                return;
            }

            sData.Add(buff, true);

            BooterLogger.AddTrace(" Bad Lot Moodlet: " + row.GetString("Moodlet"));
        }
Esempio n. 35
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", ','));
                }
            }
Esempio n. 36
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("Occupation"))
            {
                error = "Occupation missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <OccupationNames>(row.GetString("Occupation"), out mOccupation, OccupationNames.Undefined))
            {
                error = "Unknown Occupation " + row.GetString("Occupation");
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 37
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("OtherTrait"))
            {
                error = "OtherTrait missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <TraitNames>(row.GetString("OtherTrait"), out mOtherTrait, TraitNames.Unknown))
            {
                error = "Unknown OtherTrait " + row.GetString("OtherTrait");
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 38
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            if (!row.Exists("RabbitHoleType"))
            {
                error = "RabbitHoleType missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <RabbitHoleType>(row.GetString("RabbitHoleType"), out mType, RabbitHoleType.None))
            {
                error = "Unknown RabbitHoleType " + row.GetString("RabbitHoleType");
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Esempio n. 39
0
        public CareerTransfer(XmlDbRow row, Dictionary <string, Dictionary <int, CareerLevel> > careerLevels, string careerName)
            : base(row, careerLevels, null)
        {
            mStringKey = "NRaas.CareerTransfer:" + row.GetString("EventType");

            if (row.Exists("TransferCareer"))
            {
                string guid = row.GetString("TransferCareer");

                ParserFunctions.TryParseEnum <OccupationNames>(guid, out mTransferCareer, OccupationNames.Undefined);

                if (mTransferCareer == OccupationNames.Undefined)
                {
                    mTransferCareer = unchecked ((OccupationNames)ResourceUtils.HashString64(guid));
                }
            }

            if (row.Exists("TransferBranch"))
            {
                mTransferBranch = row.GetString("TransferBranch");
            }

            if (row.Exists("TransferLevelAbsolute"))
            {
                mAbsoluteLevel = row.GetInt("TransferLevelAbsolute");
            }

            if (row.Exists("TransferLevelRelative"))
            {
                string relativeLevel = row.GetString("TransferLevelRelative");

                List <string> relativeLevels = new List <string>(relativeLevel.Split(new char[] { ':' }));

                mRelativeLevelMin = int.Parse(relativeLevels[0]);
                if (relativeLevels.Count > 1)
                {
                    mRelativeLevelMax = int.Parse(relativeLevels[1]);
                }
                else
                {
                    if (mRelativeLevelMin > 0)
                    {
                        mRelativeLevelMax = mRelativeLevelMin;
                        mRelativeLevelMin = 0;
                    }
                }
            }
        }
Esempio n. 40
0
        public CareerTransfer(XmlDbRow row, Dictionary<string, Dictionary<int, CareerLevel>> careerLevels, string careerName)
            : base(row, careerLevels, null)
        {
            mStringKey = "NRaas.CareerTransfer:" + row.GetString("EventType");

            if (row.Exists("TransferCareer"))
            {
                string guid = row.GetString("TransferCareer");

                ParserFunctions.TryParseEnum<OccupationNames>(guid, out mTransferCareer, OccupationNames.Undefined);

                if (mTransferCareer == OccupationNames.Undefined)
                {
                    mTransferCareer = unchecked((OccupationNames)ResourceUtils.HashString64(guid));
                }
            }

            if (row.Exists("TransferBranch"))
            {
                mTransferBranch = row.GetString("TransferBranch");
            }

            if (row.Exists("TransferLevelAbsolute"))
            {
                mAbsoluteLevel = row.GetInt("TransferLevelAbsolute");
            }

            if (row.Exists("TransferLevelRelative"))
            {
                string relativeLevel = row.GetString("TransferLevelRelative");

                List<string> relativeLevels = new List<string>(relativeLevel.Split(new char[] { ':' }));
                
                mRelativeLevelMin = int.Parse(relativeLevels[0]);
                if (relativeLevels.Count > 1)
                {
                    mRelativeLevelMax = int.Parse(relativeLevels[1]);
                }
                else
                {
                    if (mRelativeLevelMin > 0)
                    {
                        mRelativeLevelMax = mRelativeLevelMin;
                        mRelativeLevelMin = 0;
                    }
                }
            }
        }
Esempio n. 41
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            string worldName = row.GetString("WorldName");
            if (string.IsNullOrEmpty(worldName)) return;

            worldName = worldName.ToLower().Replace(".world", "").Replace(".World", "").Replace(".WORLD","");

            if (sLoadedNames.ContainsKey(worldName)) return;

            string fileName = row.GetString("FileName");
            if (string.IsNullOrEmpty(fileName)) return;

            fileName = fileName.Replace(".nhd", "").Replace(".Nhd", "").Replace(".NHD", "");

            sLoadedNames.Add(worldName, fileName);
        }
Esempio n. 42
0
        public OccultSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Occult", Guid))
            {
                if (!row.TryGetEnum<OccultTypes>("Occult", out mOccult, OccultTypes.None))
                {
                    BooterLogger.AddError(" Unknown Occult: " + row.GetString("Occult"));
                }
            }

            if (BooterLogger.Exists(row, "Remove", Guid))
            {
                mRemove = row.GetBool("Remove");
            }

            if (BooterLogger.Exists(row, "DropOthers", Guid))
            {
                mDropOthers = row.GetBool("DropOthers");
            }

            if (BooterLogger.Exists(row, "AllowIfOthers", Guid))
            {
                mAllowIfOthers = row.GetBool("AllowIfOthers");
            }
        }
Esempio n. 43
0
        public void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            WorldName world;

            row.TryGetEnum <WorldName>("World", out world, WorldName.Undefined);

            List <DaysOfTheWeek> days = ParserFunctions.ParseDayList(row.GetString("Days"));

            if ((days == null) || (days.Count == 0))
            {
                days = ParserFunctions.ParseDayList("MTWRFSU");
            }

            int startHour = row.GetInt("StartHour");
            int endHour   = row.GetInt("EndHour");

            if (startHour > endHour)
            {
                return;
            }

            int speed = row.GetInt("Speed");

            if (speed <= 0)
            {
                speed = Relativity.sOneMinute;
            }

            mIntervals.Add(new SpeedInterval(world, days, startHour, endHour, speed));
        }
Esempio n. 44
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile careerFile = new BooterHelper.DataBootFile(file.ToString(), row.GetString("Careers"), false);
            if (!careerFile.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": Unknown Careers File " + row.GetString("Careers"));
                return;
            }

            BooterHelper.DataBootFile careerEventsFile = new BooterHelper.DataBootFile(careerFile.ToString(), row.GetString("CareerEvents"), false);

            if (careerEventsFile.IsValid)
            {
                foreach (Career career in CareerManager.CareerList)
                {
                    XmlDbTable table3 = careerEventsFile.GetTable(career.Guid.ToString());
                    if (table3 != null)
                    {
                        LoadCareerEvents(career, careerEventsFile, table3);
                    }
                }
            }

            BooterHelper.DataBootTable table = new BooterHelper.DataBootTable(careerFile, "CareerList");
            if (!table.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": No CareerList " + careerFile.ToString());
                return;
            }

            table.Load(new CareerLoader(careerEventsFile).LoadCareer);
        }
Esempio n. 45
0
 // Methods
 public MetricSkillX(XmlDbRow row, int metricNumber)
     : base(row, metricNumber)
 {
     if (SkillGuid == SkillNames.None)
     {
         SkillGuid = unchecked((SkillNames)ResourceUtils.HashString64(row.GetString("Args" + metricNumber)));
     }
 }
Esempio n. 46
0
 public TestSettingStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "Setting", Name))
     {
         mSetting = row.GetString("Setting");
     }
 }
Esempio n. 47
0
        public TimedStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "MinDuration", Name))
            {
                mMinDuration = row.GetInt("MinDuration", 0);
            }

            mMinMutation = row.GetString("MinMutation");

            if (BooterLogger.Exists(row, "MaxDuration", Name))
            {
                mMaxDuration = row.GetInt("MaxDuration", 0);
            }

            mMaxMutation = row.GetString("MaxMutation");
        }
Esempio n. 48
0
 public SimpleStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "NextStage", Name))
     {
         mNextStage.First = row.GetString("NextStage");
     }
 }
Esempio n. 49
0
 public CounterStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "Counter", Name))
     {
         mCounter = row.GetString("Counter");
     }
 }
Esempio n. 50
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DocumentBootFile socialData = new BooterHelper.DocumentBootFile(file.ToString(), row.GetString("SocialData"), false);
            if (!socialData.IsValid)
            {
                BooterLogger.AddTrace(file + ": No SocialData");
                return;
            }

            BooterHelper.DataBootFile availability = new BooterHelper.DataBootFile(file.ToString(), row.GetString("SocializingActionAvailability"), false);
            if (!availability.IsValid)
            {
                BooterLogger.AddTrace(file + ": No SocializingActionAvailability");
                return;
            }

            Load(socialData, availability);
        }
Esempio n. 51
0
        public IncrementalStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Maximum", Name))
            {
                mMaximum = row.GetInt("Maximum", 0);
            }

            mMaxMutation = row.GetString("MaxMutation");
        }
Esempio n. 52
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            Homemaker.StipendValue key;
            if (!ParserFunctions.TryParseEnum<Homemaker.StipendValue>(row.GetString("Key"), out key, Homemaker.StipendValue.Undefined))
            {
                BooterLogger.AddError("Stipend Key Missing: " + row.GetString("Key"));
                return;
            }

            int maximum = row.GetInt("Maximum");

            int factor = row.GetInt("Factor");

            bool positive = row.GetBool("Positive");

            sData.Add(key, new Data (maximum, factor, positive));

            BooterLogger.AddTrace(" Stipend Loaded: " + row.GetString("Key"));
        }
Esempio n. 53
0
        public IdleAnimationSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Mood", Guid))
            {
                if (!row.TryGetEnum<MoodFlavor>("Mood", out mMood, MoodFlavor.Uncomfortable))
                {
                    BooterLogger.AddError(" Unknown Mood: " + row.GetString("Mood"));
                }
            }

            if (BooterLogger.Exists(row, "Priority", Guid))
            {
                if (!row.TryGetEnum<IdleAnimationPriority>("Priority", out mPriority, IdleAnimationPriority.NonDistress))
                {
                    BooterLogger.AddError(" Unknown Priority: " + row.GetString("Priority"));
                }
            }
        }
Esempio n. 54
0
        public ReactionSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Type", Guid))
            {
                if (!row.TryGetEnum<ReactionTypes>("Type", out mType, ReactionTypes.None))
                {
                    BooterLogger.AddError(Guid + " Unknown Type: " + row.GetString("Type"));
                }
            }

            if (BooterLogger.Exists(row, "Speed", Guid))
            {
                if (!row.TryGetEnum<ReactionSpeed>("Speed", out mSpeed, ReactionSpeed.None))
                {
                    BooterLogger.AddError(Guid + " Unknown Speed: " + row.GetString("Speed"));
                }
            }
        }
Esempio n. 55
0
        protected WeatherSettings GetSeason(XmlDbRow row)
        {
            Season season = row.GetEnum<Season>("Season", Season.Spring | Season.Summer | Season.Fall | Season.Winter);
            if (season == (Season.Spring | Season.Summer | Season.Fall | Season.Winter))
            {
                BooterLogger.AddError("Unknown Season: " + row.GetString("Season"));
                return null;
            }

            return Tempest.Settings.GetWeather(season, false);
        }
Esempio n. 56
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mOccult = row.GetEnum<OccultTypes>("Occult", OccultTypes.None);
            if (mOccult == OccultTypes.None)
            {
                error = "Occult Fail: " + row.GetString("Occult");
                return false;
            }

            mAllowHybrid = row.GetBool("AllowHybrid");

            return base.Parse(row, ref error);
        }
Esempio n. 57
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            string guid = row.GetString("GUID");
            if (string.IsNullOrEmpty(guid))
            {
                BooterLogger.AddError("Invalid GUID: " + guid);
                return;
            }
            else if (sInstigators.ContainsKey(guid))
            {
                BooterLogger.AddError("Duplicate GUID: " + guid);
                return;
            }

            Type type = row.GetClassType("FullClassName");
            if (type == null)
            {
                BooterLogger.AddError(guid + " Invalid FullClassName: " + row.GetString("FullClassName"));
                return;
            }

            Data symptom = null;

            try
            {
                symptom = type.GetConstructor(new Type[] { typeof(XmlDbRow) }).Invoke(new object[] { row }) as Data;
            }
            catch (Exception e)
            {
                BooterLogger.AddError("Contructor Fail: " + row.GetString("FullClassName"));

                Common.Exception(guid + Common.NewLine + row.GetString("FullClassName") + " Fail", e);
            }

            if (symptom != null)
            {
                sInstigators.Add(guid, symptom);
            }
        }
Esempio n. 58
0
        protected WeatherProfile GetProfile(XmlDbRow row)
        {
            WeatherSettings settings = GetSeason(row);
            if (settings == null) return null;

            string name = row.GetString("Name");
            if (string.IsNullOrEmpty(name))
            {
                BooterLogger.AddError("Missing Name");
                return null;
            }

            return settings.AddProfile(name);
        }
Esempio n. 59
0
        public GenericTest(XmlDbRow row)
        {
            string name = row.GetString("GUID");

            foreach (string e in row.GetStringList("Event", ','))
            {
                EventTypeId id;
                if (!ParserFunctions.TryParseEnum<EventTypeId>(e, out id, EventTypeId.kEventNone))
                {
                    BooterLogger.AddError(name + " Unknown Event: " + e);
                }

                mEvents.Add(id);
            }
        }
Esempio n. 60
0
        public OmniJournalData(XmlDbRow row, int rowIndex) 
            : base(row, "OmniJournal", rowIndex)
        {
            mCareerName = row.GetString("CareerName");
            mCareerLevel = ParserFunctions.ParseInt(row.GetString("CareerLevel"), 0);
            mCurrentEdition = ParserFunctions.ParseInt(row.GetString("StartingEdition"), 1);

            mMaxEdition = ParserFunctions.ParseInt(row.GetString("MaxEdition"), 1);

            base.MyType = BookData.BookType.MedicalJournal;

            Dictionary<int, OmniJournalData> levels;
            if (!sJournalDataList.TryGetValue(mCareerName, out levels))
            {
                levels = new Dictionary<int, OmniJournalData>();

                sJournalDataList.Add(mCareerName, levels);
            }

            if (!levels.ContainsKey(mCareerLevel))
            {
                levels.Add(mCareerLevel, this);
            }
        }