Table of Contents

Class LifeGoal

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

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 string

The life goal's name

rewardPersonality PersonalityType

The 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

LifeGoal

Chef

public static readonly LifeGoal Chef

Field Value

LifeGoal

ComputerAddict

public static readonly LifeGoal ComputerAddict

Field Value

LifeGoal

CreativeChild

public static readonly LifeGoal CreativeChild

Field Value

LifeGoal

FriendOfEveryone

public static readonly LifeGoal FriendOfEveryone

Field Value

LifeGoal

Goals

A registry for all registered life goals in the game and mods

public static readonly ReadOnlyDictionary<string, LifeGoal> Goals

Field Value

ReadOnlyDictionary<string, LifeGoal>

GymRat

public static readonly LifeGoal GymRat

Field Value

LifeGoal

HouseholdHero

public static readonly LifeGoal HouseholdHero

Field Value

LifeGoal

Millionaire

public static readonly LifeGoal Millionaire

Field Value

LifeGoal

Name

The name of this life goal, which is used to register it to the Goals registry

public readonly string Name

Field Value

string

PerfectPainter

public static readonly LifeGoal PerfectPainter

Field Value

LifeGoal

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

PersonalityType

SmartKid

public static readonly LifeGoal SmartKid

Field Value

LifeGoal

Stages

The stages of this life goal

public readonly GoalSetInfo[] Stages

Field Value

GoalSetInfo[]

Writer

public static readonly LifeGoal Writer

Field Value

LifeGoal

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

AgeGroup

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 Person

The 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 LifeGoal

The 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

Action<LifeGoal.Instance>

OnCompleted

An event that is invoked when a life goal LifeGoal.Instance is completed in Advance()

public static event Action<LifeGoal.Instance> OnCompleted

Event Type

Action<LifeGoal.Instance>