Class LifeGoal
A life goal is a set of GoalSet instances that, when completed, result in a special PersonalityType to be unlocked. When a life goal is applied to a person, the LifeGoal.Instance class is used.
[JsonConverter(typeof(MigratingStaticJsonConverter<LifeGoal>), new object[] { typeof(LifeGoal), "PrivateGoals", false })]
public class LifeGoal
- Inheritance
-
LifeGoal
- Inherited Members
- Extension Methods
Constructors
LifeGoal(string, PersonalityType, params GoalSetInfo[])
Creates a new life goal with the given settings
public LifeGoal(string name, PersonalityType rewardPersonality, params GoalSetInfo[] stages)
Parameters
name
stringThe life goal's name
rewardPersonality
PersonalityTypeThe reward personality that is unlocked when the life goal is completed
stages
GoalSetInfo[]A set of goal set informations that represent the stages of this life goal
Fields
CapableCarpenter
public static readonly LifeGoal CapableCarpenter
Field Value
Chef
public static readonly LifeGoal Chef
Field Value
ComputerAddict
public static readonly LifeGoal ComputerAddict
Field Value
CreativeChild
public static readonly LifeGoal CreativeChild
Field Value
FriendOfEveryone
public static readonly LifeGoal FriendOfEveryone
Field Value
Goals
A registry for all registered life goals in the game and mods
public static readonly ReadOnlyDictionary<string, LifeGoal> Goals
Field Value
GymRat
public static readonly LifeGoal GymRat
Field Value
HouseholdHero
public static readonly LifeGoal HouseholdHero
Field Value
Millionaire
public static readonly LifeGoal Millionaire
Field Value
Name
The name of this life goal, which is used to register it to the Goals registry
public readonly string Name
Field Value
PerfectPainter
public static readonly LifeGoal PerfectPainter
Field Value
RewardPersonality
The reward personality that is unlocked when this life goal is completed. The personality's PersonalityType.TypeCategory should be Hidden so that this is the only way to unlock the personality.
public readonly PersonalityType RewardPersonality
Field Value
SmartKid
public static readonly LifeGoal SmartKid
Field Value
Stages
The stages of this life goal
public readonly GoalSetInfo[] Stages
Field Value
Writer
public static readonly LifeGoal Writer
Field Value
Properties
AllowedAges
A set of allowed age group flags for people that can start this life goal. This value defaults to ChildOrOlder.
public AgeGroup AllowedAges { get; init; }
Property Value
Methods
IsCompleted(Person)
Queries whether the given Person has the RewardPersonality, which indicates that they have completed this life goal
public bool IsCompleted(Person person)
Parameters
person
PersonThe person
Returns
- bool
Whether the person has completed this life goal
Register(LifeGoal)
Registers the given life goal to the Goals registry and returns it
public static LifeGoal Register(LifeGoal goal)
Parameters
goal
LifeGoalThe life goal to register
Returns
- LifeGoal
The passed life goal, for chaining
Events
OnAdvanced
An event that is invoked when a life goal LifeGoal.Instance is advanced in Advance()
public static event Action<LifeGoal.Instance> OnAdvanced
Event Type
OnCompleted
An event that is invoked when a life goal LifeGoal.Instance is completed in Advance()
public static event Action<LifeGoal.Instance> OnCompleted