本文整理汇总了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);
}
示例2: Run
protected override bool Run(SimDescription a, SimDescription b)
{
RockBand skill = a.SkillManager.GetSkill<RockBand>(SkillNames.RockBand);
PrivateAddBandMember(skill, b);
return true;
}
示例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);
}
示例4: CommonCorrections
protected static void CommonCorrections(SimDescription sim)
{
if (sim.AgingState == null)
{
AgingManager.Singleton.AddSimDescription(sim);
}
}
示例5: Restore
// Exported to Traveler
public static void Restore(SimDescription sim)
{
foreach (ITransition setting in Common.DerivativeSearch.Find<ITransition>())
{
setting.Restore(sim);
}
}
示例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));
}
示例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;
}
示例8: SimID
public SimID(SimDescription sim)
{
if (sim != null)
{
mID = sim.SimDescriptionId;
}
}
示例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;
}
示例10: clone
public static Courtesan clone(Role toClone, SimDescription actor)
{
Courtesan newRole = new Courtesan(toClone.Data, actor, toClone.RoleGivingObject);
newRole.StartRole();
return newRole;
}
示例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;
}
示例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);
}
示例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;
}
示例14: SetActors
public override void SetActors(SimDescription actor, SimDescription target)
{
Sim = actor;
mLoser = target;
base.SetActors(actor, target);
}
示例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;
}