From Intrigues Wiki
Revision as of 14:43, 21 December 2023 by Tayfunwiki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Grandchildren Method in Actor Class


The Grandchildren method in the Actor class is designed to retrieve the grandchildren of an actor. It offers the option to include or exclude deceased grandchildren based on a specified parameter.


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


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


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


The Grandchildren method provides a means to access the actor's grandchildren, allowing for inclusion of those who have passed away, depending on the inclusivePassive parameter. The method uses LINQ's SelectMany function to collate grandchildren from the actor's children, ensuring a comprehensive collection.


This method is particularly useful in game mechanics or narratives where an actor's relationship with their grandchildren, including those who may have passed away, is significant.


var allGrandchildren = someActor.Grandchildren();
var livingGrandchildren = someActor.Grandchildren(false);

In the first example, allGrandchildren includes both living and deceased grandchildren, while livingGrandchildren includes only the living ones.


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