Table of Contents

Class StudentJobType

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

A JobType for school students

public class StudentJobType : JobType, IGenericDataHolder, IEmotionSource
Inheritance
GenericDataHolder
StudentJobType
Implements
IGenericDataHolder
Inherited Members
GenericDataHolder.GetDataKeys()
Extension Methods

Constructors

StudentJobType(string, TextureRegion, float, (int Start, int End), params DayOfWeek[])

Creates a new job type with the given settings

public StudentJobType(string name, TextureRegion icon, float hourlyPay, (int Start, int End) workHours, params DayOfWeek[] offWorkDays)

Parameters

name string

The name of the job

icon TextureRegion

This job type's icon.

hourlyPay float

The hourly wage that this job yields

workHours (int Start, int End)

A range of hours to work each day

offWorkDays DayOfWeek[]

The days of the week that are off work

Fields

Schedule

The schedule of a Person that has a StudentJobType-based job type. The schedule contains information about what skills should be learned on what days, and is used in UpdateWorking(Job, WorkAction, TimeSpan, float) to award those skills. To add new skills to a given day, simply add to this dictionary's List<T> entries.

public static readonly Dictionary<DayOfWeek, List<SkillType>> Schedule

Field Value

Dictionary<DayOfWeek, List<SkillType>>

Methods

OnLevelChanged(Job, int)

A method that is called when a Person is promoted or demoted for this job. By default, some emotion modifiers are applied.

public override void OnLevelChanged(Job job, int levelDifference)

Parameters

job Job

The job instance

levelDifference int

The level difference that was applied. If the person was demoted, this value is -1, else it is 1.

OnWorkFinished(Job, WorkAction)

A method that is called when a Person finishes a WorkAction for this job. By default, some emotion modifiers are randomly applied.

public override void OnWorkFinished(Job job, WorkAction action)

Parameters

job Job

The job instance

action WorkAction

The work action that was completed

UpdateWorking(Job, WorkAction, TimeSpan, float)

Updates this job type's Job instance. By default, this method causes students to gain skills in StudentJobType. This is called in UpdateWorking(WorkAction, TimeSpan, float).

public override void UpdateWorking(Job job, WorkAction action, TimeSpan passedInGame, float speedMultiplier)

Parameters

job Job

The job instance.

action WorkAction

The action that is currently being executed.

passedInGame TimeSpan

The amount of time that has passed in game since the last update.

speedMultiplier float

The game's current speed multiplier.