本文整理汇总了C#中Lot类的典型用法代码示例。如果您正苦于以下问题:C# Lot类的具体用法?C# Lot怎么用?C# Lot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lot类属于命名空间,在下文中一共展示了Lot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: SetupLotTag
public static void SetupLotTag(Lot lot)
{
Sim active = Sims3.Gameplay.Actors.Sim.ActiveActor;
if (active == null) return;
MapTagManager mtm = active.MapTagManager;
if (mtm == null) return;
try
{
MapTag tag = mtm.GetTag(lot);
if (Tagger.Settings.Filters.Matches(lot.Household.AllSimDescriptions) && Tagger.Settings.mEnableLotTags)
{
if ((tag != null) && (!(tag is TrackedLot)) && (!(tag is HomeLotMapTag)))
{
mtm.RemoveTag(tag);
}
if (!mtm.HasTag(lot))
{
mtm.AddTag(new TrackedLot(lot, mtm.Actor));
}
}
else if (tag is TrackedLot)
{
mtm.RemoveTag(tag);
}
}
catch (Exception exception)
{
Common.DebugException(lot, exception);
}
}
示例4: IsValidResidentialLot
public static string IsValidResidentialLot(Lot lot)
{
if (lot.Household != null)
{
return "Occupied";
}
else if (lot.IsCommunityLot)
{
return "Community lot";
}
else if (lot.ResidentialLotSubType == ResidentialLotSubType.kEP1_PlayerOwnable)
{
return "Vacation Home";
}
else if (lot.ResidentialLotSubType == ResidentialLotSubType.kEP10_PrivateLot)
{
return "Private Lot";
}
else if (lot.IsWorldLot)
{
return "World lot";
}
return null;
}
示例5: Test
public override bool Test(Sim actor, Lot target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
// Stops the dead from leaving the cemetery
if ((actor.SimDescription.IsDead) && (!actor.SimDescription.IsPlayableGhost)) return false;
return base.Test(actor, target, isAutonomous, ref greyedOutTooltipCallback);
}
示例6: OnExitBuildBuy
public void OnExitBuildBuy(Lot lot)
{
foreach (ISprinkler sprinkler in lot.GetObjects<ISprinkler>())
{
this.SetSprinklerAlarm(sprinkler);
}
}
示例7: 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);
}
示例8: AddLot
public static void AddLot(Lot lot, AuctionEntities au)
{
if (lot.IdLot == 0)
{
au.Lots.Add(lot);
}
else
{
Lot dbLot = au.Lots.Find(lot.IdLot);
if (dbLot != null)
{
dbLot.IdSection = lot.IdSection;
dbLot.Name = lot.Name;
dbLot.Description = lot.Description;
dbLot.StartDate = lot.StartDate;
dbLot.EndDate = lot.EndDate;
dbLot.StartPrice = lot.StartPrice;
dbLot.Tick = lot.Tick;
dbLot.CurrentPrice = lot.CurrentPrice;
dbLot.Status = lot.Status;
dbLot.Img = lot.Img;
}
}
}
示例9: OnExitBuildBuy
public void OnExitBuildBuy(Lot lot)
{
foreach(ComboRabbitHole comboRH in lot.GetObjects<ComboRabbitHole>())
{
AddContainedRabbitHolesToLot (comboRH);
}
}
示例10: PayForWorkOut
public static void PayForWorkOut(Sim sim, Lot lot, int fee)
{
if (lot.IsCommunityLot)
{
//Pay if we don't own the lot
Household lotOwner = ReturnLotOwner(lot);
//If we don't own the lot
if (lotOwner != null && lotOwner != sim.Household)
{
lotOwner.ModifyFamilyFunds(fee);
//pay if we have the money, if not add to next bill
if (sim.FamilyFunds >= fee)
{
sim.Household.ModifyFamilyFunds(-fee);
}
else
{
sim.Household.UnpaidBills += fee;
}
}
else
{
//if the lot has no owner, or we don't own the lot
if (lotOwner == null || (lotOwner != null && lotOwner != sim.Household))
{
sim.Household.ModifyFamilyFunds(-fee);
}
}
}
}
示例11: OnExitBuildBuy
public void OnExitBuildBuy(Lot lot)
{
foreach (ShowStage stage in lot.GetObjects<ShowStage>())
{
ShowStageEx.StoreChanges(stage, Overwatch.Log);
}
}
示例12: ReturnLotOwner
public static Household ReturnLotOwner(Lot lot)
{
Household lotOwner = null;
if (lot != null)
{
List<Household> hList = new List<Household>(Sims3.Gameplay.Queries.GetObjects<Household>());
Sims3.Gameplay.RealEstate.PropertyData pd = null;
if (hList != null && hList.Count > 0)
{
foreach (Household h in hList)
{
pd = h.RealEstateManager.FindProperty(lot);
if (pd != null && pd.Owner != null)
{
lotOwner = pd.Owner.OwningHousehold;
break;
}
}
}
}
return lotOwner;
}
示例13: 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;
}
}
}
示例14: 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;
}
示例15: PayForCoffee
public static void PayForCoffee(Sim sim, Lot lot)
{
//Pay for the coffee if we don't own the lot
Household lotOwner = ReturnLotOwner(lot);
if (lot.IsCommunityLot)
{
//If we don't own the lot
int price = ReturnPrice();
if (lotOwner != null && lotOwner != sim.Household)
{
lotOwner.ModifyFamilyFunds(price);
//Can the customer pay,
if (sim.Household.FamilyFunds >= price)
{
sim.Household.ModifyFamilyFunds(-price);
}
else
{
//Add to next bill
sim.Household.UnpaidBills += price;
}
}
else
{
//if the lot has no owner
if (lotOwner == null)
{
sim.Household.ModifyFamilyFunds(-price);
}
}
}
}