Class LifeGoal.Instance
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
PersonThe person to work on this life goal
goal
LifeGoalThe life goal information
stage
intThe 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
Properties
Completed
Returns whether this life goal is considered complete, which is when Stage is null.
public bool Completed { get; }
Property Value
CurrentGoals
The GoalSet instance that represents the currently active stage of this life goal instance
[DataMember]
public GoalSet CurrentGoals { get; }
Property Value
Person
The person that is currently working on this life goal
public Person Person { get; }
Property Value
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
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
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
PersonThe person who is working on this life goal
Returns
- bool
Whether this life goal is considered valid