Role.Inheritance

From Intrigues Wiki
Revision as of 10:32, 5 January 2024 by Tayfunwiki (talk | contribs) (Created page with "=== Role Class - <code>Inheritance</code> Property === ==== Overview ==== The <code>Inheritance</code> property in the Role class indicates whether a role is inheritable, meaning it can be passed down to another actor, typically upon the role holder's death or retirement. ==== Syntax ==== <syntaxhighlight lang="c#"> [field: SerializeField] public bool Inheritance { get; private set; } </syntaxhighlight> ==== Description ==== This property determines whether a role wit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Role Class - Inheritance Property

Overview

The Inheritance property in the Role class indicates whether a role is inheritable, meaning it can be passed down to another actor, typically upon the role holder's death or retirement.

Syntax

[field: SerializeField] public bool Inheritance { get; private set; }

Description

This property determines whether a role within a clan, family, or other entity can be transferred to another member, often as part of succession mechanics. For example, a "Leader" role might be inheritable, allowing for smooth transition of power.

Usage

Inheritance is a key property for roles that are integral to the narrative or organizational structure of the game's world, especially in systems where succession and lineage are important.

Example of Usage

public class CheckRoleInheritance : MonoBehaviour {
    void Start() {
        // Access the current player's role
        var playerRole = IM.Player.Role;

        if (playerRole != null) {
            // Check if the player's role is inheritable
            bool isRoleInheritable = playerRole.Inheritance;
            Debug.Log($"Player's Role Inheritable: {isRoleInheritable}");
        }
    }
}

Remarks

  • The Inheritance property is crucial for narrative-driven and strategy games where lineage and succession play a significant role in the game mechanics.
  • It allows developers to design intricate systems of power transfer, adding depth to clan or family dynamics within the game.