Table of Contents

Class LotEmployment.Instance

Namespace
TinyLife.World
Assembly
Tiny Life.dll

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

[DataContract]
public class LotEmployment.Instance
Inheritance
LotEmployment.Instance
Inherited Members
Extension Methods

Constructors

Instance(Person, Map, Lot, LotEmployment, bool)

Creates a new lot employment instance with the given settings

public Instance(Person person, Map map, Lot employmentLot, LotEmployment type, bool setManually)

Parameters

person Person

The person to be employed

map Map

The map that this lot employment is for.

employmentLot Lot

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

type LotEmployment

The lot employment

setManually bool

Whether this person was set manually (by a user) or automatically (using UpdateExternalPeople(ICollection<Map>, Action<string>, Action<float>)

Fields

IsAtWork

Whether this lot employment's employee is currently at work.

[DataMember]
public bool IsAtWork

Field Value

bool

TimeAtWork

The amount of time that this lot employment's employee has been at work for. If IsAtWork is false, this is Zero.

[DataMember]
public TimeSpan TimeAtWork

Field Value

TimeSpan

Properties

EmploymentLot

The lot that this employment is active on. If this is a map-wide employment, this is null. See WorkLot for the lot that this employment is currently working on.

public Lot EmploymentLot { get; }

Property Value

Lot

Map

The map that this lot employment instance's Lot is on.

public Map Map { get; }

Property Value

Map

SetManually

Whether this person was set manually (by a user) or automatically (using UpdateExternalPeople(ICollection<Map>, Action<string>, Action<float>)

[DataMember]
public bool SetManually { get; }

Property Value

bool

Type

The underlying LotEmployment type of this instance

public LotEmployment Type { get; }

Property Value

LotEmployment

WorkLot

The lot that the person with this employment is working on. If this is not a map-wide employment, EmploymentLot is always returned, even if this property has been overwritten.

public Lot WorkLot { get; set; }

Property Value

Lot

Methods

FinishWork(bool)

A method that is invoked while this employment's employee is at work, when there is no more work to be done. This method causes the appropriate money to be deducted and earned if ForHireOnce is true, and causes IsAtWork and TimeAtWork to be set accordingly.

public void FinishWork(bool notify = true)

Parameters

notify bool

Whether events should be invoked and the HourlyFee should be awarded.

ShouldWorkRightNow()

Returns whether the Time is in range of this LotEmployment's WorkHours and OffWorkDays and it is not IsFinished.

public bool ShouldWorkRightNow()

Returns

bool

Whether work needs to be done right now.

Validate(Person)

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(Person person)

Parameters

person Person

The person to validate this lot employment for

Returns

bool

false if the object is not valid, true otherwise