Table of Contents

Class LifeGoal.Instance

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

A class used to represent a currently active/ongoing LifeGoal instance

[DataContract]
public class LifeGoal.Instance
Inheritance
LifeGoal.Instance
Inherited Members
Extension Methods

Constructors

Instance(Person, LifeGoal, int)

Creates a new life goal instance from the given LifeGoal

public Instance(Person person, LifeGoal goal, int stage = 0)

Parameters

person Person

The person to work on this life goal

goal LifeGoal

The life goal information

stage int

The stage to start out in, or 0 by default

Fields

Goal

The underlying LifeGoal that this instance is tracking

[DataMember]
public readonly LifeGoal Goal

Field Value

LifeGoal

Properties

Completed

Returns whether this life goal is considered complete, which is when Stage is null.

public bool Completed { get; }

Property Value

bool

CurrentGoals

The GoalSet instance that represents the currently active stage of this life goal instance

[DataMember]
public GoalSet CurrentGoals { get; }

Property Value

GoalSet

Person

The person that is currently working on this life goal

public Person Person { get; }

Property Value

Person

Stage

The GoalSetInfo that the CurrentGoals are created from. If this value is null, this life goal is Completed.

public GoalSetInfo Stage { get; }

Property Value

GoalSetInfo

StageIndex

The index in the Stages array that the CurrentGoals are created from. To get the GoalSetInfo for this stage, use Stage. If this value is greater than the length of Stages, this life goal is Completed.

[DataMember]
public int StageIndex { get; }

Property Value

int

Methods

Advance()

Forces this life goal to be advanced, regardless of whether the CurrentGoals are completed+

public void Advance()

Update()

Updates this life goal, causing Advance() to be called if the CurrentGoals are completed

public void Update()

Validate(Person)

Validates this life goal instance and the underlying CurrentGoals when loading from disk

public bool Validate(Person person)

Parameters

person Person

The person who is working on this life goal

Returns

bool

Whether this life goal is considered valid