LotEmployment_Instance - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.World.LotEmployment

LotEmployment.Instance Class

An instance of a LotEmployment.
This is used by LotEmployment to store additional info about their employment.

public class LotEmployment.Instance

Inheritance System.Object 🡒 Instance

Constructors

LotEmployment.Instance.Instance(Person, Lot, LotEmployment) Constructor

Creates a new lot employment instance with the given settings

public Instance(TinyLife.Objects.Person person, TinyLife.World.Lot employmentLot, TinyLife.World.LotEmployment type);

Parameters

person Person
The person to be employed

employmentLot Lot
The lot to be employed on, or null for a MapWideEmployments entry

type LotEmployment
The lot employment

Properties

LotEmployment.Instance.Lot Property

The lot that this employment is active on

public TinyLife.World.Lot Lot { get; }

Property Value

Lot

LotEmployment.Instance.Type Property

The underlying LotEmployment type of this instance

public TinyLife.World.LotEmployment Type { get; }

Property Value

LotEmployment

Methods

LotEmployment.Instance.ShouldWorkRightNow() Method

Returns whether the CurrentTime is in range of this LotEmployment's work hours and it is not IsFinished

public bool ShouldWorkRightNow();

Returns

System.Boolean
Whether work needs to be done right now

LotEmployment.Instance.Validate(Person) Method

This method is called when this object is loaded from disk.
Returning false on this method causes the object to be removed from the map.

public bool Validate(TinyLife.Objects.Person person);

Parameters

person Person
The person to validate this lot employment for

Returns

System.Boolean
false if the object is not valid, true otherwise