PageRenderTime 1340ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/NRaasCareer/CareerSpace/Interactions/BreakIntoHouse.cs

https://gitlab.com/forpdfsending/NRaas
C# | 68 lines | 61 code | 7 blank | 0 comment | 5 complexity | d13d37be52110cfc1511cd967be33cff MD5 | raw file
  1. using NRaas.CareerSpace.Booters;
  2. using NRaas.CareerSpace.Interfaces;
  3. using NRaas.CommonSpace.Helpers;
  4. using NRaas.Gameplay.Careers;
  5. using NRaas.Gameplay.OmniSpace.Metrics;
  6. using Sims3.Gameplay.Abstracts;
  7. using Sims3.Gameplay.ActiveCareer.ActiveCareers;
  8. using Sims3.Gameplay.Actors;
  9. using Sims3.Gameplay.ActorSystems;
  10. using Sims3.Gameplay.ActorSystems.Children;
  11. using Sims3.Gameplay.Autonomy;
  12. using Sims3.Gameplay.Careers;
  13. using Sims3.Gameplay.CAS;
  14. using Sims3.Gameplay.Core;
  15. using Sims3.Gameplay.EventSystem;
  16. using Sims3.Gameplay.Interactions;
  17. using Sims3.Gameplay.Interfaces;
  18. using Sims3.Gameplay.Objects.RabbitHoles;
  19. using Sims3.Gameplay.Utilities;
  20. using Sims3.SimIFace;
  21. using Sims3.UI;
  22. using Sims3.UI.Hud;
  23. using System;
  24. using System.Collections.Generic;
  25. using System.Text;
  26. namespace NRaas.CareerSpace.Interactions
  27. {
  28. public class BreakIntoHouse : Common.IPreLoad, Common.IAddInteraction
  29. {
  30. public static InteractionDefinition Singleton = new Definition();
  31. public void OnPreLoad()
  32. {
  33. Tunings.Inject<Lot, PrivateEyeInteractions.BreakIntoHouse.Definition, Definition>(false);
  34. }
  35. public void AddInteraction(Common.InteractionInjectorList interactions)
  36. {
  37. interactions.Add<Lot>(Singleton);
  38. }
  39. public class Definition : PrivateEyeInteractions.BreakIntoHouse.Definition
  40. {
  41. public override string GetInteractionName(Sim a, Lot target, InteractionObjectPair interaction)
  42. {
  43. return base.GetInteractionName(a, target, new InteractionObjectPair(PrivateEyeInteractions.BreakIntoHouse.Singleton, target));
  44. }
  45. public override bool Test(Sim a, Lot target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
  46. {
  47. if (target.IsCommunityLot)
  48. {
  49. return false;
  50. }
  51. else if (a.IsGreetedOnLot(target))
  52. {
  53. return false;
  54. }
  55. OmniCareer omni = a.Occupation as OmniCareer;
  56. if (omni == null) return false;
  57. return omni.CanBreakIntoHouses();
  58. }
  59. }
  60. }
  61. }