Search Results for

    Show / Hide Table of Contents

    Class Relationship

    A relationship is a connection between two Person objects. It should be noted that a relationship is not always the same between a person and the linked OtherPerson. What this means is that A can have a good relationship to B, but B can have a less good relationship to A.

    Inheritance
    System.Object
    Relationship
    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 Relationship

    Fields

    Dating

    This value is set to true if this relationship is a romantic relationship

    Declaration
    [DataMember]
    public bool Dating
    Field Value
    Type Description
    System.Boolean

    Genealogy

    The GenealogyType of this relationship. Note that the genealogy's value works in the following direction: "I am the [Genealogy] of [OtherPerson]". Note that OtherPerson will always have the GenealogyType's GetOpposite(GenealogyType).

    Declaration
    [DataMember]
    public GenealogyType Genealogy
    Field Value
    Type Description
    GenealogyType

    KnownPersonalityTypes

    A set of PersonalityType objects that are known about this relationship's OtherPerson. This collection is populated by AskAboutPersonality.

    Declaration
    [DataMember]
    public readonly HashSet<PersonalityType> KnownPersonalityTypes
    Field Value
    Type Description
    System.Collections.Generic.HashSet<PersonalityType>

    Max

    The maximum value that a relationship level can have

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

    MaxRecentSocialsAmount

    The maximum amount of social actions that are "remembered" in this relationship. This is equivalent to RecentActions, but related to this relationship only.

    Declaration
    public const int MaxRecentSocialsAmount = 10
    Field Value
    Type Description
    System.Int32

    PassiveFriendReduction

    The amount of points (out of Max) that are removed from each relationship's FriendLevel each update frame

    Declaration
    public const float PassiveFriendReduction = 0.01F
    Field Value
    Type Description
    System.Single

    PassiveRomanceReduction

    The amount of points (out of Max) that are removed from each relationship's RomanceLevel each update frame

    Declaration
    public const float PassiveRomanceReduction = 0.015F
    Field Value
    Type Description
    System.Single

    Properties

    DisplayString

    An (unlocalized) string that represents a written version of this relationship's status. If Dating is true, the string "Dating" will be returned. Otherwise, Type is returned as a string.

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

    FriendLevel

    The current amount of friendship points (out of Max) that this relationship has. This value is automatically clamped between -Max and Max.

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

    FriendPercentage

    The FriendLevel of this relationship, divided by Max, yielding a percentage between -1 and 1 of how good this friendship is

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

    OtherPerson

    The System.Guid of the person that this relationship is linked to. To easily retrieve the matching Person instance, see Partner.

    Declaration
    [DataMember]
    public Guid OtherPerson { get; }
    Property Value
    Type Description
    System.Guid

    Partner

    The actual other person involved in the relationship. This is a computed property that returns the Person on the map with the OtherPerson id.

    Declaration
    public Person Partner { get; }
    Property Value
    Type Description
    Person

    RomanceLevel

    The current amount of romance points (out of Max) that this relationship has. This value is automatically clamped between 0 and Max. Note that, for aromantic people, getting and setting this value always gets and sets FriendLevel instead.

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

    RomancePercentage

    The RomanceLevel of this relationship, divided by Max, yielding a percentage between 0 and 1 of how good this relationship's romance level is

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

    Type

    The RelationshipType that this relationship has, based on the current FriendLevel.

    Declaration
    public RelationshipType Type { get; }
    Property Value
    Type Description
    RelationshipType

    Methods

    AddRecentSocial(ActionType)

    Adds the given action to the list of recent social actions for this relationship. If the list's length exceeds MaxRecentSocialsAmount, the least recent socials will be removed. Note that this method is automatically invoked in EvaluateFully(SocialAction).

    Declaration
    public void AddRecentSocial(ActionType action)
    Parameters
    Type Name Description
    ActionType action

    The action to add to the recent socials list

    GetRecentSocialAmount(ActionType)

    Returns the amount of times that the given ActionType has been used out of the last MaxRecentSocialsAmount social actions in this relationship

    Declaration
    public int GetRecentSocialAmount(ActionType action)
    Parameters
    Type Name Description
    ActionType action
    Returns
    Type Description
    System.Int32

    GetSocialEffectiveness(ActionType)

    Returns the effectiveness percentage that the given ActionType has right now, based on the amount of times that it has been used previously. In TalkAction, this effectiveness is used to reduce the friendship and romance gain based on the "boringness" of an action.

    Declaration
    public float GetSocialEffectiveness(ActionType action)
    Parameters
    Type Name Description
    ActionType action

    The action whose effectiveness to query

    Returns
    Type Description
    System.Single

    The social effectiveness, which is a percentage between 0 and 1

    ResetToStatic(Boolean, Boolean)

    Resets this relationship to a more basic, static version. This method is used when a map or household is exported, and by the ExportHousehold cheat.

    Declaration
    public void ResetToStatic(bool thorough, bool sameHousehold)
    Parameters
    Type Name Description
    System.Boolean thorough

    Whether the relationship should be reset thoroughly, causing the friendship level and romance level to be averaged out

    System.Boolean sameHousehold

    Whether the two people that are part of this relationship are in the same household

    Validate(Person)

    Validates this relationship, setting its internal person reference to the given Person. This method is automatically called for all of their relationships in Validate().

    Declaration
    public void Validate(Person person)
    Parameters
    Type Name Description
    Person person

    The person that this relationship belongs to

    Extension Methods

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2022 Ellpeck – Impressum – Privacy – Status
    ☀
    ☾