Spouses

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

Spouses Method in Actor Class

Overview

The Spouses method in the Actor class is used to retrieve the spouses of an actor. This method provides the option to include or exclude deceased spouses based on the specified parameter.

Syntax

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

Parameters

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

Returns

  • Return Type: IEnumerable<Actor>. The method returns a collection of Actor objects, each representing a spouse of the actor.
  • When inclusivePassive is set to true, the collection includes all spouses, regardless of their state (alive or dead).
  • When inclusivePassive is set to false, only living (active state) spouses are included.

Description

The Spouses method provides access to the marital partners of an actor, allowing for inclusion of those who have passed away depending on the inclusivePassive parameter. This is particularly useful in narratives and game mechanics involving family and marital relationships.

Usage

This method is valuable in scenarios where an actor's current and former marital relationships impact the gameplay or story, such as in inheritance, alliance formation, or narrative development.

Example:

var allSpouses = someActor.Spouses();
var livingSpouses = someActor.Spouses(false);

In the first example, allSpouses includes both living and deceased spouses of the actor. In the second example, livingSpouses includes only the living spouses.

Remarks

  • The ability to include or exclude deceased spouses provides depth to the handling of familial and relational dynamics within the game.
  • The Spouses method is crucial for managing complex relationships and can significantly impact the storylines and character interactions in the game.