当前位置: 首页>>代码示例>>C#>>正文


C# SimDescription类代码示例

本文整理汇总了C#中SimDescription的典型用法代码示例。如果您正苦于以下问题:C# SimDescription类的具体用法?C# SimDescription怎么用?C# SimDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimDescription类属于命名空间,在下文中一共展示了SimDescription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Allow

        protected override bool Allow(SimDescription sim)
        {
            Occupation job = Occupation;

            if (!ManagerCareer.ValidCareer(job))
            {
                IncStat("Invalid");
                return false;
            }
            else if (sim.Service != null)
            {
                IncStat("On Call");
                return false;
            }
            else if (sim.Genealogy == null)
            {
                IncStat("No Gene");
                return false;
            }
            else if (SimTypes.IsDead(sim))
            {
                IncStat("Dead");
                return false;
            }

            return base.Allow(sim);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:27,代码来源:OccupationScenario.cs

示例2: Run

        protected override bool Run(SimDescription a, SimDescription b)
        {
            RockBand skill = a.SkillManager.GetSkill<RockBand>(SkillNames.RockBand);

            PrivateAddBandMember(skill, b);
            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:AddBandMember.cs

示例3: EnsureInstantiate

        public static bool EnsureInstantiate(SimDescription sim, Lot lot)
        {
            if (sim.CreatedSim == null)
            {
                if (sim.Household == null)
                {
                    if (!sim.IsValidDescription)
                    {
                        sim.Fixup();
                    }

                    Urnstone urnstone = Urnstones.CreateGrave(sim, SimDescription.DeathType.OldAge, false, true);
                    if (urnstone != null)
                    {
                        Common.Sleep();

                        if (!Urnstones.GhostSpawn(urnstone, lot))
                        {
                            return false;
                        }
                    }
                }
                else
                {
                    Instantiation.Perform(sim, null);
                }
            }

            return (sim.CreatedSim != null);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:30,代码来源:Instantiation.cs

示例4: CommonCorrections

 protected static void CommonCorrections(SimDescription sim)
 {
     if (sim.AgingState == null)
     {
         AgingManager.Singleton.AddSimDescription(sim);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:ServiceCleanup.cs

示例5: Restore

 // Exported to Traveler
 public static void Restore(SimDescription sim)
 {
     foreach (ITransition setting in Common.DerivativeSearch.Find<ITransition>())
     {
         setting.Restore(sim);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:8,代码来源:Transition.cs

示例6: HandlePayments

 // Methods             
 public static void HandlePayments(int price, SimDescription sim)
 {           
    
     //Return lot owner
     Household household = null;
     if (((sim.CreatedSim != null) && (sim.CreatedSim.LotCurrent != null)) && sim.CreatedSim.LotCurrent.IsCommunityLot)
     {
         household = ReturnLotOwner(sim.CreatedSim.LotCurrent);
     }
  
     if ((household == null) || ((household != null) && (sim.Household != household)))
     {
         if (sim.Household.FamilyFunds >= price)
         {
             sim.Household.ModifyFamilyFunds(-price);
         }
         else if (price > 0)
         {
             Household household1 = sim.Household;
             household1.UnpaidBills += price;
             StyledNotification.Show(new StyledNotification.Format(LocalizeString("CantAffordToPay", new object[] { sim.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive));
         }
     }
     //Pay Lot owner
     if ((household != null) && (sim.Household != household))
     {
         household.ModifyFamilyFunds(price);
         StyledNotification.Show(new StyledNotification.Format(LocalizeString("LotOwnerEarned", new object[] { household.Name, price }), StyledNotification.NotificationStyle.kGameMessagePositive));
     }
   //  StyledNotification.Show(new StyledNotification.Format(LocalizeString("ItemsPurchased", new object[] { sim.FullName, itemCount.ToString(), num * itemCount }), StyledNotification.NotificationStyle.kGameMessagePositive));
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:32,代码来源:CommonMethods.cs

示例7: ManualCashTransferScenario

 public ManualCashTransferScenario(SimDescription sim, SimDescription target, int delta, string accountingKey, int minimum, int maximum)
     : base(sim, target, delta)
 {
     mAccountingKey = accountingKey;
     mMinimum = minimum;
     mMaximum = maximum;
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:ManualCashTransferScenario.cs

示例8: SimID

 public SimID(SimDescription sim)
 {
     if (sim != null)
     {
         mID = sim.SimDescriptionId;
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:SimID.cs

示例9: Run

        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!ApplyAll)
            {
                string text = StringInputDialog.Show(Name, Common.Localize("BabyMultiple:Prompt", me.IsFemale, new object[] { me, Pregnancy.kMaxBabyMultiplier }), me.Pregnancy.mMultipleBabiesMultiplier.ToString());
                if (string.IsNullOrEmpty(text)) return false;

                mMultiple = 0;
                if (!float.TryParse(text, out mMultiple))
                {
                    SimpleMessageDialog.Show(Name, Common.Localize("Numeric:Error"));
                    return false;
                }

                if (mMultiple < 0)
                {
                    mMultiple = 0;
                }
                else if (mMultiple > Pregnancy.kMaxBabyMultiplier)
                {
                    mMultiple = Pregnancy.kMaxBabyMultiplier;
                }
            }

            me.Pregnancy.mMultipleBabiesMultiplier = mMultiple;
            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:27,代码来源:BabyMultiple.cs

示例10: clone

        public static Courtesan clone(Role toClone, SimDescription actor)
        {
            Courtesan newRole = new Courtesan(toClone.Data, actor, toClone.RoleGivingObject);
            newRole.StartRole();

            return newRole;
        }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:7,代码来源:Courtesan.cs

示例11: Run

        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (me.CreatedSim != null)
            {
                bool reset = false;
                if (me.CreatedSim.Motives == null)
                {
                    reset = true;
                }
                else
                {
                    foreach (KeyValuePair<int, Motive> motive in me.CreatedSim.Motives.mMotives)
                    {
                        if ((motive.Value == null) || (motive.Value.Tuning == null))
                        {
                            reset = true;
                            break;
                        }
                    }
                }

                if (reset)
                {
                    me.CreatedSim.mAutonomy.RecreateAllMotives();
                }

                foreach (CommodityKind kind in sCommodities)
                {
                    ForceSetMax(me.CreatedSim.Motives, kind);
                }
            }
            return true;
        }
开发者ID:KhArtNJava,项目名称:NRaas,代码行数:33,代码来源:MaxMotives.cs

示例12: Satisfies

        public bool Satisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (!inspecting)
            {
                Occupation career = CareerManager.GetStaticOccupation(mCareer);
                if (career == null) return false;

                if ((GameUtils.IsFutureWorld()) && (!career.AvailableInFutureWorld)) return false;

                if (sim.IsEP11Bot)
                {
                    if (!sim.HasTrait(TraitNames.ProfessionalChip))
                    {
                        return false;
                    }
                }

                if (sim.CreatedSim != null)
                {
                    if ((sim.Occupation == null) || (sim.Occupation.Guid != mCareer))
                    {
                        GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                        if (!career.CanAcceptCareer(sim.CreatedSim.ObjectId, ref greyedOutTooltipCallback)) return false;
                    }
                }
            }

            return PrivateSatisfies(manager, sim, newLot, inspecting);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:29,代码来源:DreamJob.cs

示例13: Run

		protected override bool Run(SimDescription me, bool singleSelection)
		{
			PerformanceCareer performer = me.OccupationAsPerformanceCareer;
			if (performer != null)
			{
				//me.OccupationAsPerformanceCareer.GivePerformerName (me.CreatedSim, false);
				string text2;
				if (string.IsNullOrEmpty(performer.StageName))
				{
					string localizedString = StringTable.GetLocalizedString((!me.IsFemale) ? (performer.MaleGivenNameKeyBase + RandomUtil.GetInt(performer.GetNumberOfMaleGivenNames - 1).ToString()) : (performer.FemaleGivenNameKeyBase + RandomUtil.GetInt(performer.GetNumberFemaleGivenNames - 1).ToString()));
					string text = Common.LocalizeEAString(me.IsFemale, performer.FamilyNameKeyBase + RandomUtil.GetInt(performer.GetNumberOfFamilyNames - 1).ToString());
					if (StringTable.GetLocale() == "ja-jp")
						text2 = text + " " + localizedString;
					else
						text2 = localizedString + " " + text;
				}
				else
				{
					text2 = performer.StageName;
				}
				string text3 = StringInputDialogRandom.Show(Common.LocalizeEAString("Ui/CreateNameUI:Title"), me.FullName + " (" + performer.CareerName + ")", text2, 27, StringInputDialog.Validation.TextOnly, false, new StringInputDialogRandom.RandomDelegate(performer.GetRandomStageName));
				if (!string.IsNullOrEmpty (text3))
				{
					me.OccupationAsPerformanceCareer.StageName = text3;
					me.CareerManager.UpdateCareerUI ();
					return true;
				}
			}
			return false;
		}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:30,代码来源:ChangeStageName.cs

示例14: SetActors

        public override void SetActors(SimDescription actor, SimDescription target)
        {
            Sim = actor;
            mLoser = target;

            base.SetActors(actor, target);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:PropagateWonFightScenario.cs

示例15: PrivateRun

        protected override List<Item> PrivateRun(SimDescription me, IEnumerable<Item> choices)
        {
            string text = StringInputDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":MinPrompt", false, new object[0]), "0");
            if (string.IsNullOrEmpty(text)) return null;

            float min;
            if (!float.TryParse(text, out min))
            {
                SimpleMessageDialog.Show(Name, Common.Localize("Numeric:Error"));
                return null;
            }

            text = StringInputDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":MaxPrompt", false, new object[0]), "0");
            if (string.IsNullOrEmpty(text)) return null;

            float max;
            if (!float.TryParse(text, out max))
            {
                SimpleMessageDialog.Show(Name, Common.Localize("Numeric:Error"));
                return null;
            }

            Vector2 range = new Vector2(min, max);

            List<Item> selection = new List<Item>();
            foreach (Item choice in choices)
            {
                if (choice == null) continue;

                selection.Add(new RandomItem(choice, range));
            }

            return selection;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:34,代码来源:RandomSkills.cs


注:本文中的SimDescription类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。