Family.ID

From Intrigues Wiki
Revision as of 21:15, 4 January 2024 by Tayfunwiki (talk | contribs) (Created page with "== <code>ID</code> Property in Family Class == === Overview === The <code>ID</code> property in the Family class is used to access the unique identifier of a family within the game. This property is essential for distinguishing one family from another, particularly in games where family lineage, relationships, and dynamics play a crucial role. === Property Definition === <syntaxhighlight lang="c#"> public string ID { get; private set; } </syntaxhighlight> === Descript...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ID Property in Family Class

Overview

The ID property in the Family class is used to access the unique identifier of a family within the game. This property is essential for distinguishing one family from another, particularly in games where family lineage, relationships, and dynamics play a crucial role.

Property Definition

public string ID { get; private set; }

Description

  • Property Type: string
  • Access: Read-only
  • Functionality: Provides the unique identifier (ID) of a family.

Usage

This property is typically used to reference and manage different families within the game's world, enabling the tracking of family-related activities, events, and dynamics. It is particularly valuable in scenarios where the player's actions or choices impact various families or where the game involves complex family trees.

Example of Usage

public class FamilyManager : MonoBehaviour {
    void Start() {
        Family playerFamily = IM.Player.Family;
        if (playerFamily != null) {
            Debug.Log($"Player's family ID: {playerFamily.ID}");
        }
    }
}

Description

  • This example demonstrates how to retrieve and log the unique ID of the player's family.
  • Accessing the ID property helps identify and work with the player's family within the game's narrative and mechanics.

Remarks

  • The ID property is a fundamental part of family management in games with intricate family systems.
  • It facilitates the implementation of features such as family trees, inheritance, alliances, and feuds.