Class LotEmployment
A lot employment is a job that a Person executes somewhat perpetually. A person with a LotEmployment does not live on a Lot or in a Household, but instead either works at their lot employment or "leaves the city" through an TinyLife.Actions.BeAwayFromLotEmploymentAction. Lot employments can be added to lots using Employments or to a map using MapWideEmployments.
Inheritance
Inherited Members
Namespace: TinyLife.World
Assembly: Tiny Life.dll
Syntax
public class LotEmployment
Constructors
LotEmployment(String, Range<Int32>, Func<ActionType[]>)
Creates a new lot employment with the given settings
Declaration
public LotEmployment(string name, Range<int> workHours, Func<ActionType[]> actions)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The lot employment's name |
MonoGame.Extended.Range<System.Int32> | workHours | The lot employment's work hours |
System.Func<ActionType[]> | actions | The actions that lot employees should execute |
Fields
Actions
A set of ActionType instances that a person working in this employment should execute. Using actions with the Nothing category will cause any instances of the action to act as if they had the Self category instead.
Declaration
public readonly Func<ActionType[]> Actions
Field Value
Type | Description |
---|---|
System.Func<ActionType[]> |
MapWideEmployments
A list of lot employments that are map-wide, that is, that aren't bound to a Lot. To add more map-wide lot employments, just add additional entries to this list.
Declaration
public static readonly List<LotEmployment> MapWideEmployments
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<LotEmployment> |
Name
The name of this lot employment
Declaration
public readonly string Name
Field Value
Type | Description |
---|---|
System.String |
WorkHours
The range of hours that this lot employment is active in. During times outside of these hours, people with this employment will automatically enqueue and execute a TinyLife.Actions.BeAwayFromLotEmploymentAction.
Declaration
public readonly Range<int> WorkHours
Field Value
Type | Description |
---|---|
MonoGame.Extended.Range<System.Int32> |
Properties
IdleObjects
A set of ObjectCategory flags that represent the item types that a person with this lot employment will idle around if they have nothing else to do. If this is set to a non-Nothing category, people with this lot employment will automatically enqueue the LotEmploymentIdle action if there is nothing else to do currently.
Declaration
public ObjectCategory IdleObjects { get; set; }
Property Value
Type | Description |
---|---|
ObjectCategory |
IsFinished
A function that can be used to finish the lot employment's work hours before the current time is outside of WorkHours. This is used by the mail carrier to make them stop working once all mail is delivered.
Declaration
public Func<Person, bool> IsFinished { get; set; }
Property Value
Type | Description |
---|---|
System.Func<Person, System.Boolean> |
Methods
GetCurrentPerson(Map, Lot)
Returns the Person that is currently in charge of this lot employment To check for MapWideEmployments, a null lot can be passed.
Declaration
public Person GetCurrentPerson(Map map, Lot lot)
Parameters
Type | Name | Description |
---|---|---|
Map | map | The map |
Lot | lot | The lot, or null for a MapWideEmployments entry |
Returns
Type | Description |
---|---|
Person | The person that currently works in this lot employment, or null if there is none |
SetCurrentPerson(Map, Lot, Person, Boolean)
Sets the current person for this lot employment on the given Map and Lot.
If this employment is a MapWideEmployments entry, the lot
should be null.
Declaration
public void SetCurrentPerson(Map map, Lot lot, Person person, bool manual = true)
Parameters
Type | Name | Description |
---|---|---|
Map | map | The map |
Lot | lot | The lot, or null if this is a map wide employment |
Person | person | The person to set, or null to remove the currently employed person. |
System.Boolean | manual | Whether this person was set manually (by a user) or automatically (using UpdateExternalPeople(Action<Single>) |