Search Results for

    Show / Hide Table of Contents

    Class Need

    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.

    Inheritance
    System.Object
    Need
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: TinyLife
    Assembly: Tiny Life.dll
    Syntax
    [DataContract]
    public class Need

    Constructors

    Need(NeedType)

    Instantiate a new need from the given NeedType

    Declaration
    public Need(NeedType type)
    Parameters
    Type Name Description
    NeedType type

    The type to instantiate the need from

    Fields

    Max

    The maximum value that the Value can have

    Declaration
    public const float Max = 100000F
    Field Value
    Type Description
    System.Single

    Type

    The NeedType that this need instance originates from

    Declaration
    [DataMember]
    public readonly NeedType Type
    Field Value
    Type Description
    NeedType

    Properties

    Percentage

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

    Declaration
    public float Percentage { get; }
    Property Value
    Type Description
    System.Single

    Value

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

    Declaration
    [DataMember]
    public float Value { get; set; }
    Property Value
    Type Description
    System.Single

    Extension Methods

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2023 Ellpeck Games, Top Hat Studios – Impressum – Privacy – Status
    ☀
    ☾