Table of Contents

Struct Household.RandomConstellation

Namespace
TinyLife.World
Assembly
Tiny Life.dll

A struct that is used for the RandomConstellations list and ultimately by Generate(Random).

public readonly struct Household.RandomConstellation
Inherited Members
Extension Methods

Constructors

RandomConstellation(IEnumerable<(AgeGroup Age, int Min, int Max)>, IEnumerable<RandomRelation>)

Creates a new random constellation with the given settings.

public RandomConstellation(IEnumerable<(AgeGroup Age, int Min, int Max)> possibleMembers, IEnumerable<Household.RandomRelation> possibleRelations)

Parameters

possibleMembers IEnumerable<(AgeGroup Age, int Min, int Max)>

The set of possible members that can be generated for this constellation. The dictionary maps an AgeGroup to a tuple of the minimum and maximum amount of people that can be generated with that age.

possibleRelations IEnumerable<Household.RandomRelation>

The set of possible relations that can be generated for this constellation. The dictionary maps two people of the given age groups to a set of Household.RandomRelation instances they can be generated with.

Fields

PossibleMembers

The set of possible members that can be generated for this constellation. The dictionary maps an AgeGroup to a tuple of the minimum and maximum amount of people that can be generated with that age.

public readonly Dictionary<AgeGroup, (int Min, int Max)> PossibleMembers

Field Value

Dictionary<AgeGroup, (int Min, int Max)>

PossibleRelations

The set of possible relations that can be generated for this constellation. The dictionary maps two people of the given age groups to a set of Household.RandomRelation instances they can be generated with.

public readonly Dictionary<(AgeGroup, AgeGroup), Household.RandomRelation[]> PossibleRelations

Field Value

Dictionary<(AgeGroup, AgeGroup), Household.RandomRelation[]>

Methods

Generate(Random)

Generates raw household data for the given constellation, which can then be passed to Generate(Map, Random, List<AgeGroup>, Dictionary<(int Person, int Other), Relation>) to generate the actual people. This method returns the list of people that should be generated (referenced only by their age group), as well as a dictionary of relations between those people.

public (List<AgeGroup>, Dictionary<(int Person, int Other), Household.Relation>) Generate(Random random)

Parameters

random Random

The random instance to use.

Returns

(List<AgeGroup>, Dictionary<(int Person, int Other), Household.Relation>)

The generated household data.