本文整理汇总了C#中Household类的典型用法代码示例。如果您正苦于以下问题:C# Household类的具体用法?C# Household怎么用?C# Household使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Household类属于命名空间,在下文中一共展示了Household类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MemberListModel
public MemberListModel(Household household, List<User> users, bool canEditPermissions, bool canEditUser)
{
Household = household;
Users = users;
CanEditPermissions = canEditPermissions;
CanEditUser = canEditUser;
}
示例2: Reset
public override void Reset()
{
base.Reset();
if (SimTypes.IsDead(Sim)) return;
mHouse = Sim.Household;
mNetWorth = 0;
if (mHouse != null)
{
if (mHouse.LotHome != null)
{
if (mHouse.LotHome != mLot)
{
mLot = mHouse.LotHome;
mLotHomeCost = StoryProgression.Main.Lots.GetLotCost(mLot);
}
mNetWorth = mHouse.FamilyFunds + mLotHomeCost;
}
else
{
mNetWorth = mHouse.NetWorth();
mLot = null;
mLotHomeCost = 0;
}
}
}
示例3: Run
protected override OptionResult Run(Lot lot, Household me)
{
if (me == null) return OptionResult.Failure;
string text = StringInputDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Prompt"), me.Name);
if (string.IsNullOrEmpty(text)) return OptionResult.Failure;
if (AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":SimsPrompt", false, new object[] { me.Name, text })))
{
foreach (SimDescription sim in CommonSpace.Helpers.Households.All(me))
{
if (sim.LastName.Trim().ToLower() == me.Name.Trim().ToLower())
{
sim.LastName = text;
if (me == Household.ActiveHousehold)
{
HudModel hudModel = Sims3.UI.Responder.Instance.HudModel as HudModel;
if (sim.CreatedSim != null)
{
Household.AddDirtyNameSimID(sim.SimDescriptionId);
hudModel.NotifyNameChanged(sim.CreatedSim.ObjectId);
}
}
}
}
}
me.Name = text;
return OptionResult.SuccessClose;
}
示例4: CloseHouse
protected static void CloseHouse(Household house)
{
if (house != null)
{
if (house == Household.ActiveHousehold) return;
Dictionary<Lot, bool> lots = new Dictionary<Lot, bool>();
foreach (Sim sim in Households.AllSims(house))
{
if (sim.LotCurrent == null) continue;
if (!lots.ContainsKey(sim.LotCurrent))
{
lots.Add(sim.LotCurrent, true);
}
}
foreach (Lot lot in LotManager.AllLots)
{
if (lots.ContainsKey(lot)) continue;
if (lot.IsResidentialLot)
{
house.RemoveGreetedLotForHousehold(lot, ObjectGuid.InvalidObjectGuid);
}
}
}
}
示例5: ShowSimSelector
/// <summary>
///
/// </summary>
/// <param name="interactionName"></param>
/// <returns></returns>
public static List<IMiniSimDescription> ShowSimSelector(Sim actor, Household currentHousehold, string interactionName)
{
List<IMiniSimDescription> residents = new List<IMiniSimDescription>();
string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]);
List<PhoneSimPicker.SimPickerInfo> list = new List<PhoneSimPicker.SimPickerInfo>();
List<object> list2;
//Create list of sims
foreach (Sim s in currentHousehold.Sims)
{
list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, s.SimDescription));
}
list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, currentHousehold.Sims.Count, false);
if (list2 == null || list2.Count == 0)
{
return null;
}
foreach (var item in list2)
{
residents.Add(item as SimDescription);
}
return residents;
}
示例6: Perform
public static string Perform(Household house, bool ignorePlaceholders)
{
if (house.LotHome == null) return null;
string msg = null;
if (Households.NumSims(house) != Households.AllSims(house).Count)
{
List<SimDescription> sims = new List<SimDescription>(Households.All(house));
foreach (SimDescription description in sims)
{
bool flag = true;
foreach (Sim sim in Households.AllSims(house))
{
if (sim.SimDescription == description)
{
flag = false;
break;
}
}
if (flag)
{
FixInvisibleTask.Perform(description, false);
msg += RecoverMissingSimTask.Perform(description, ignorePlaceholders);
}
}
}
return msg;
}
示例7: Run
protected override OptionResult Run(Lot lot, Household me)
{
if (lot != null)
{
List<Item> allOptions = new List<Item>();
foreach (Household house in Household.sHouseholdList)
{
if (house.RealEstateManager == null) continue;
PropertyData data = house.RealEstateManager.FindProperty(lot);
if (data == null) continue;
allOptions.Add(new Item(house, lot, RealEstate.OwnerType.Full, data.TotalValue));
}
if (allOptions.Count == 0)
{
SimpleMessageDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Failure"));
return OptionResult.Failure;
}
CommonSelection<Item>.Results choices = new CommonSelection<Item>(Name, allOptions).SelectMultiple();
if ((choices == null) || (choices.Count == 0)) return OptionResult.Failure;
foreach (Item item in choices)
{
item.Perform();
}
}
return OptionResult.SuccessClose;
}
示例8: OnWorldLoadFinished
public void OnWorldLoadFinished()
{
new Common.DelayedEventListener(EventTypeId.kSocialInteraction, OnSocialEvent);
new Common.DelayedEventListener(EventTypeId.kHouseholdSelected, OnHouseSelected);
sOldHousehold = Household.ActiveHousehold;
}
示例9: Allow
protected override bool Allow(Lot lot, Household me)
{
if (!base.Allow(lot, me)) return false;
if (lot.IsCommunityLot) return false;
return (new HomeInspection(lot).Satisfies(me).Count > 0);
}
示例10: Allow
protected override bool Allow(Lot lot, Household house)
{
if (!base.Allow(lot, house)) return false;
if (lot is WorldLot) return false;
return (lot != null);
}
示例11: Allow
protected override bool Allow(Lot lot, Household me)
{
if (!base.Allow(lot, me)) return false;
if (lot == null) return false;
return (true);
}
示例12: GetTaxes
protected static void GetTaxes(Household me, out int owed, out int savings, out int vacationHome)
{
owed = (int)(me.ComputeNetWorthOfObjectsInHousehold(true) * Mailbox.kPercentageOfWealthBilled);
vacationHome = 0;
savings = 0;
if (me.RealEstateManager != null)
{
int valueOfAllVacationHomes = me.RealEstateManager.GetValueOfAllVacationHomes();
vacationHome = (int)Math.Round((double)(valueOfAllVacationHomes * RealEstateManager.kPercentageOfVacationHomeValueBilled));
owed += vacationHome;
}
if (me.LotHome != null)
{
Dictionary<int, List<float>> dictionary = new Dictionary<int, List<float>>();
foreach (IReduceBills bills in me.LotHome.GetObjects<IReduceBills>())
{
List<float> list;
int key = bills.ReductionArrayIndex();
float item = bills.PercentageReduction();
if (dictionary.TryGetValue(key, out list))
{
list.Add(item);
}
else
{
List<float> list2 = new List<float>();
list2.Add((float)bills.MaxNumberContributions());
list2.Add(item);
dictionary.Add(key, list2);
}
}
foreach (KeyValuePair<int, List<float>> pair in dictionary)
{
int num5 = (int)pair.Value[0];
pair.Value.RemoveAt(0);
pair.Value.Sort();
int count = pair.Value.Count;
num5 = Math.Min(num5, count);
float num7 = 0f;
for (int i = 1; i <= num5; i++)
{
num7 += pair.Value[count - i];
}
int amount = (int)(owed * num7);
owed -= amount;
savings += amount;
}
}
}
示例13: GhostToPlayableGhost
// Lacks the "greater than eight" restriction
public static bool GhostToPlayableGhost(Urnstone ths, Household newHousehold, Vector3 ghostPosition)
{
SimDescription simDescription = ths.DeadSimsDescription;
if (!simDescription.IsValidDescription)
{
simDescription.Fixup();
}
if (simDescription.Household != null)
{
simDescription.Household.Remove(simDescription, !simDescription.Household.IsSpecialHousehold);
}
if (!newHousehold.Contains(simDescription))
{
newHousehold.Add(simDescription);
}
Sim ghost = Instantiation.Perform(simDescription, ghostPosition, null, null);
if (ghost == null) return false;
ths.GhostSetup(ghost, true);
ths.RemoveMourningRelatedBuffs(ghost);
simDescription.ShowSocialsOnSim = true;
simDescription.IsNeverSelectable = false;
simDescription.Marryable = true;
simDescription.Contactable = true;
if (!simDescription.IsEP11Bot)
{
simDescription.AgingEnabled = true;
simDescription.AgingState.ResetAndExtendAgingStage(0f);
simDescription.PushAgingEnabledToAgingManager();
}
string failureReason;
if (!Inventories.TryToMove(ths, ghost.Inventory, true, out failureReason))
{
Common.DebugNotify(failureReason);
}
//Inventories.TryToMove(ths, ghost);
if (simDescription.Child || simDescription.Teen)
{
simDescription.AssignSchool();
}
if (ghost.IsSelectable)
{
ghost.OnBecameSelectable();
}
return true;
}
示例14: Allow
protected override bool Allow(Household house)
{
if (house.LotHome != null)
{
IncStat("Resident");
return false;
}
return base.Allow(house);
}
示例15: CareerStore
public CareerStore(Household house, SafeStore.Flag flags)
{
mSafeStore = new Dictionary<ulong, SafeStore>();
foreach (SimDescription sim in Households.All(house))
{
mSafeStore[sim.SimDescriptionId] = new SafeStore(sim, flags);
}
}