Need - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife

Need Class

A need is a desire that a Person can have to a given extent, defined by Value.
Each need is instantiated through its associated NeedType.

public class Need

Inheritance System.Object 🡒 Need

Constructors

Need.Need(NeedType) Constructor

Instantiate a new need from the given NeedType

public Need(TinyLife.NeedType type);

Parameters

type NeedType
The type to instantiate the need from

Fields

Need.Max Field

The maximum value that the Value can have

public const float Max = 100000;

Field Value

System.Single

Need.Type Field

The NeedType that this need instance originates from

public readonly NeedType Type;

Field Value

NeedType

Properties

Need.Percentage Property

The Value divided by Max, yielding a floating point number between 0 and 1, representing the percentage fullness of this need

public float Percentage { get; }

Property Value

System.Single

Need.Value Property

The current value of this need.
Automatically gets clamped to a number between 0 and Max.

public float Value { get; set; }

Property Value

System.Single