Siblings

From Intrigues Wiki
Revision as of 13:46, 21 December 2023 by Tayfunwiki (talk | contribs) (Created page with "== <code>Siblings</code> Method in Actor Class == === Overview === The <code>Siblings</code> method in the <code>Actor</code> class is designed to retrieve the siblings of an actor. It includes an option to include or exclude deceased siblings based on the provided parameter. === Syntax === <syntaxhighlight lang="c#"> public IEnumerable<Actor> Siblings(bool inclusivePassive = true) </syntaxhighlight> === Parameters === * <code>inclusivePassive</code> (bool): A flag t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Siblings Method in Actor Class

Overview

The Siblings method in the Actor class is designed to retrieve the siblings of an actor. It includes an option to include or exclude deceased siblings based on the provided parameter.

Syntax

public IEnumerable<Actor> Siblings(bool inclusivePassive = true)

Parameters

  • inclusivePassive (bool): A flag that determines whether to include deceased (passive state) siblings in the returned collection. The default value is true.

Returns

  • Return Type: IEnumerable<Actor>. This method returns a collection of Actor objects, each representing a sibling of the actor.
  • When inclusivePassive is set to true, both living and deceased siblings are included in the collection.
  • When inclusivePassive is set to false, only living (active state) siblings are included.

Description

The Siblings method is essential for accessing the siblings of an actor. It allows for the inclusion of siblings who have passed away, depending on the setting of the inclusivePassive parameter. This method is particularly useful for representing family dynamics and relationships within a game.

Usage

This method can be used in game mechanics or narratives where an actor's relationship with their siblings, including those who may have passed away, plays a significant role.

Example:

var allSiblings = someActor.Siblings();
var livingSiblings = someActor.Siblings(false);

In these examples, allSiblings includes both living and deceased siblings, while livingSiblings includes only the living siblings.

Remarks

  • The method's ability to include or exclude deceased siblings provides a realistic portrayal of family relationships in the game.
  • The functionality is vital for storylines involving inheritance, rivalries, alliances, or other sibling-related dynamics.
  • The method contributes to the depth and authenticity of character backstories and interactions within the game world.