Siblings
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 istrue
.
Returns
- Return Type:
IEnumerable<Actor>
. This method returns a collection ofActor
objects, each representing a sibling of the actor. - When
inclusivePassive
is set totrue
, both living and deceased siblings are included in the collection. - When
inclusivePassive
is set tofalse
, 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.