kylekellogg / fuckthisjam-2014-05

Fuck This Jam 2014-05-31 repo for Farmzilla (working title)
0 stars 0 forks source link

Job scheduling #9

Open kylekellogg opened 10 years ago

kylekellogg commented 10 years ago

Job Scheduling

Job scheduling will be broken down into the following pieces:

  1. Job data object
  2. An ongoing job queue
  3. Progress tracking for each job in job queue
    Job Data Object

This will represent a single job. Each job must have (at least) the following items:

When scheduling a job you will:

  1. Create the Job Data Object
  2. Assign it the appropriate plot/building
  3. Assign it the game time corrected DateTime.Now
  4. Assign it the game time corrected Begin DateTime + TimeSpan for job as the Projected end DateTime
  5. Assign it's progress level a value of 0f
    Ongoing Job Queue

For every job in the job queue, which itself will be a mutable List, you must do the following:

Get progress from the difference of (current game time - Begin DateTime for Job) and (game time corrected Projected end DateTime for Job - Begin DateTime for Job) via TotalDays or TotalHours method of corresponding TimeSpans.

This will not be necessary for already completed Jobs.

Reference
kylekellogg commented 10 years ago

Updated to remove completion flag from Job Data Object