Class Family
Represents a family in the game.
Namespace: Backend
Assembly: cs.temp.dll.dll
Syntax
public class Family : HouseholdAsset
Constructors
Family(string, int, int)
Create a new family with numAdults
adults and NumChildren
children.
Declaration
public Family(string FamilyName, int NumChildren, int numAdults)
Parameters
Type | Name | Description |
---|---|---|
string | FamilyName | Family name. |
int | NumChildren | Number of children. |
int | numAdults | Number of adults. |
Properties
Adults
List of adults in family.
Declaration
public List<Adult> Adults { get; }
Property Value
Type | Description |
---|---|
List<Adult> |
Children
List of children in family.
Declaration
public List<Child> Children { get; }
Property Value
Type | Description |
---|---|
List<Child> |
HiredWorkers
List of hired workers in the family. Disappear after every year.
Declaration
public List<Adult> HiredWorkers { get; }
Property Value
Type | Description |
---|---|
List<Adult> |
Name
Family name. Family members have this as their last name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
CreateAdult()
Add a new adult to the family.
Declaration
public void CreateAdult()
CreateChild(int)
Add a new child to the family.
If age
is -1, then generate random age between 0 and 12 (exclusive).
Declaration
public void CreateChild(int age = -1)
Parameters
Type | Name | Description |
---|---|---|
int | age | Age. |
GetAdultAmount()
Get the number of adults in the family.
Declaration
public int GetAdultAmount()
Returns
Type | Description |
---|---|
int | The number of adults in the family. |
GetChildrenAmount()
Get the number of children in the family.
Declaration
public int GetChildrenAmount()
Returns
Type | Description |
---|---|
int | The number of children in the family. |
GetHiredWorkerAmount()
Get the number of hired workers in the family.
Declaration
public int GetHiredWorkerAmount()
Returns
Type | Description |
---|---|
int | The number of hired workers in the family. |
GetLabourPoints()
Get the total number of labour points that the family generates.
Declaration
public int GetLabourPoints()
Returns
Type | Description |
---|---|
int | The total number of labour points that the family generates. |
GetTotalConsumption()
Calculate family's total wheat consumption for the year.
Declaration
public int GetTotalConsumption()
Returns
Type | Description |
---|---|
int | Family's total wheat consumption for the year. |