TinyLifeExampleMod/Api/TinyLife/Goals/JobType.md

3.7 KiB

JobType

Namespace: TinyLife > Goals

Assembly: Tiny Life.dll

Implements IGenericDataHolder

Summary

A job type is a singleton containing various kinds of data for a TinyLife.Goals.Job instance. New jobs can be registered using TinyLife.Goals.JobType.Register(TinyLife.Goals.JobType).

Constructors

Name Summary
JobType ( String, Single, Range<Int32>, DayOfWeek[] ) Creates a new job type with the given settings

Fields

Type Name Summary
Single HourlyPay The amount of dollars that being at the job for an hour pays. In TinyLife.Actions.WorkAction, this is automatically added to the household funds.
String Name The name of this job type
DayOfWeek[] OffWorkDays A set of System.DayOfWeek values which are days off of this job. On TinyLife.GameImpl.Weekdays contained in this list, the TinyLife.Goals.JobType.WorkHours don't apply.
Range<Int32> WorkHours A System.Range of hours that this job requires each day. Note that the MonoGame.Extended.Range1.Minvalue is inclusive, but theMonoGame.Extended.Range1.Max value is exclusive.

Methods

Return Name Summary
Job Construct ( Person ) Creates a new TinyLife.Goals.Job from this type's information
String GetDisplayName ( Nullable<Int32> ) Returns the display name of this TinyLife.Goals.JobType, based on the given ``. If no level is given, the job's regular name, without the level-based suffix, is returned.
Boolean IsTimeToWork ( Nullable<TimeSpan> ) Returns whether the given time (or the game's current time) is in the bounds of TinyLife.Goals.JobType.WorkHours and outside of the bounds of TinyLife.Goals.JobType.OffWorkDays. If this method returns true, TinyLife.Actions.WorkAction can be started.
String ToScheduleString ( ) Returns a string representation of the schedule. The string includes a line that states the TinyLife.Goals.JobType.WorkHours and a line that states the TinyLife.Goals.JobType.OffWorkDays.

Static Fields

Type Name Summary
IDictionary<String, JobType> Types A registry of all TinyLife.Goals.JobType instances in the game and mods. Register new jobs using TinyLife.Goals.JobType.Register(TinyLife.Goals.JobType).

Static Methods

Return Name Summary
void Register ( JobType ) Registers the given job type to the TinyLife.Goals.JobType.Types registry