Spouses
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 istrue
.
Returns
- Return Type:
IEnumerable<Actor>
. The method returns a collection ofActor
objects, each representing a spouse of the actor. - When
inclusivePassive
is set totrue
, the collection includes all spouses, regardless of their state (alive or dead). - When
inclusivePassive
is set tofalse
, 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.