TinyLifeExampleMod/Api/TinyLife/Goals/Job.md

2.7 KiB

Job

Namespace: TinyLife > Goals

Assembly: Tiny Life.dll

Implements IGenericDataHolder

Summary

A job is a kind of work that a TinyLife.Goals.Job.Person can have. The person's current job is accessible using TinyLife.Objects.Person.Job. A job instance is constructed from its underlying TinyLife.Goals.JobType.

Constructors

Name Summary
Job ( JobType, Person ) Creates a new job from the given settings

Fields

Type Name Summary
JobType Type The underlying TinyLife.Goals.JobType that this job results from

Properties

Type Name Summary
Single CurrentHourlyPay The amount of tiny bucks that this job pays per hour. This is based on TinyLife.Goals.JobType.HourlyPay and the current TinyLife.Goals.Job.Level.
Int32 Level The current level that this job is at. Note that the default level is 0, and the level goes up to a maximum of 9.
Single Performance This job's current performance, ranging from 0 to 1, representing the percentage of work performance. The default value is 0.5.
Person Person The TinyLife.Goals.Job.Person that currently has this job

Methods

Return Name Summary
void AddLevel ( Int32 ) Adds (or removes) the given amount of levels to this job's TinyLife.Goals.Job.Level. Note that the level value is automatically clamped between 0 and 9, inclusively.
void AddPerformance ( Single ) Adds (or removes) the given amount of performance to this job's TinyLife.Goals.Job.Performance. If the total TinyLife.Goals.Job.Performance rolls over (below 0 or above 1), TinyLife.Goals.Job.AddLevel(System.Int32) is called and the performace is reset accordingly.
void Update ( TimeSpan ) Updates this job, changing the TinyLife.Goals.Job.Performance and TinyLife.Goals.Job.Level according to this job's person's current actions. This is called in TinyLife.Objects.Person.Update(Microsoft.Xna.Framework.GameTime,System.TimeSpan,TinyLife.GameSpeed).
Boolean Validate ( Person )