Search Results for

    Show / Hide Table of Contents

    Class NeedType

    A need is a desire that a Person can have to a given extent. To register a custom need type, use Register(NeedType).

    Inheritance
    System.Object
    NeedType
    Implements
    IEmotionSource
    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
    [JsonConverter(typeof(NeedType.Converter))]
    public class NeedType : IEmotionSource

    Constructors

    NeedType(String, Func<Person, Single>, Func<Person, ActionType>, Func<Person, TimeSpan>, Single, Single)

    Instantiates a new need type with the given settings

    Declaration
    public NeedType(string name, Func<Person, float> passiveReduction, Func<Person, ActionType> needLowAction = null, Func<Person, TimeSpan> needLowTime = null, float solveImportance = 0F, float solvePercentage = 0.5F)
    Parameters
    Type Name Description
    System.String name

    The name of this need

    System.Func<Person, System.Single> passiveReduction

    The amount that this need instance's Value is reduced by automatically every update frame

    System.Func<Person, ActionType> needLowAction

    The action that is executed when this need's value is very low

    System.Func<Person, System.TimeSpan> needLowTime

    The amount of in-game time until needLowAction is enqueued

    System.Single solveImportance

    The priority for solving this need over other needs, where higher numbers are more urgent

    System.Single solvePercentage

    Fields

    Energy

    Declaration
    public static readonly NeedType Energy
    Field Value
    Type Description
    NeedType

    Entertainment

    Declaration
    public static readonly NeedType Entertainment
    Field Value
    Type Description
    NeedType

    Hunger

    Declaration
    public static readonly NeedType Hunger
    Field Value
    Type Description
    NeedType

    Hygiene

    Declaration
    public static readonly NeedType Hygiene
    Field Value
    Type Description
    NeedType

    Name

    The name of this need. Used for Localization purposes and saving to disk.

    Declaration
    public readonly string Name
    Field Value
    Type Description
    System.String

    NeedLowAction

    The ActionType that is constructed and executed when this need type's Value is very low

    Declaration
    public readonly Func<Person, ActionType> NeedLowAction
    Field Value
    Type Description
    System.Func<Person, ActionType>

    NeedLowTime

    The amount of in-game time that needs to pass until NeedLowAction is constructed and enqueued

    Declaration
    public readonly Func<Person, TimeSpan> NeedLowTime
    Field Value
    Type Description
    System.Func<Person, System.TimeSpan>

    PassiveReduction

    The amount that a need instance's Value is reduced by automatically every update frame

    Declaration
    public readonly Func<Person, float> PassiveReduction
    Field Value
    Type Description
    System.Func<Person, System.Single>

    Social

    Declaration
    public static readonly NeedType Social
    Field Value
    Type Description
    NeedType

    SolveImportance

    The priority for solving this need over other needs, where higher numbers represent a more urgent need. This value defaults to 0, meaning it has no special importance.

    Declaration
    public readonly float SolveImportance
    Field Value
    Type Description
    System.Single

    SolvePercentage

    Declaration
    public readonly float SolvePercentage
    Field Value
    Type Description
    System.Single

    Toilet

    Declaration
    public static readonly NeedType Toilet
    Field Value
    Type Description
    NeedType

    Types

    A list of all of the need types that are currently registered. Register custom need types using Register(NeedType).

    Declaration
    public static readonly ReadOnlyCollection<NeedType> Types
    Field Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<NeedType>

    Properties

    SourceString

    A (localized) string that is displayed when hovering over an EmotionModifier that has this source

    Declaration
    public string SourceString { get; }
    Property Value
    Type Description
    System.String

    Methods

    Register(NeedType)

    Register the NeedType specified to the Types dictionary

    Declaration
    public static NeedType Register(NeedType type)
    Parameters
    Type Name Description
    NeedType type

    The need type to register

    Returns
    Type Description
    NeedType

    The need typep passed, for chaining

    Implements

    IEmotionSource

    Extension Methods

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