예제 #1
0
파일: SafeStore.cs 프로젝트: yakoder/NRaas
        public SafeStore(SimDescription sim, Flag flags)
        {
            mSim = sim;

            mNeverSelectable       = mSim.IsNeverSelectable;
            mSim.IsNeverSelectable = false;

            mFlags = flags;

            if ((mFlags & Flag.StoreOpportunities) == Flag.StoreOpportunities)
            {
                mOpportunities = new OpportunityStore(mSim, false);
            }

            mRole = mSim.AssignedRole;

            if ((flags & Flag.OnlyAcademic) == Flag.OnlyAcademic)
            {
                if (!GameUtils.IsUniversityWorld())
                {
                    // Bypass for a removal during OnBecameSelectable()
                    mCareer = mSim.OccupationAsAcademicCareer;
                }
            }
            else
            {
                mCareer = mSim.Occupation;
            }

            if (mCareer != null)
            {
                mSim.CareerManager.mJob = null;
            }

            if ((mSim.CareerManager != null) && ((flags & Flag.School) == Flag.School))
            {
                mSchool = mSim.CareerManager.School;
                if (mSchool != null)
                {
                    mSim.CareerManager.mSchool = null;
                }
            }

            mSim.AssignedRole = null;
        }
예제 #2
0
        public SafeStore(SimDescription sim, Flag flags)
        {
            mSim = sim;

            mNeverSelectable = mSim.IsNeverSelectable;
            mSim.IsNeverSelectable = false;

            mFlags = flags;

            if ((mFlags & Flag.StoreOpportunities) == Flag.StoreOpportunities)
            {
                mOpportunities = new OpportunityStore(mSim, false);
            }

            mRole = mSim.AssignedRole;

            if ((flags & Flag.OnlyAcademic) == Flag.OnlyAcademic)
            {
                if (!GameUtils.IsUniversityWorld())
                {
                    // Bypass for a removal during OnBecameSelectable()
                    mCareer = mSim.OccupationAsAcademicCareer;
                }
            }
            else
            {
                mCareer = mSim.Occupation;
            }

            if (mCareer != null)
            {
                mSim.CareerManager.mJob = null;
            }

            if ((mSim.CareerManager != null) && ((flags & Flag.School) == Flag.School))
            {
                mSchool = mSim.CareerManager.School;
                if (mSchool != null)
                {
                    mSim.CareerManager.mSchool = null;
                }
            }

            mSim.AssignedRole = null;
        }