IAssignment IJobSource.FindAssignment(ILivingObject _living) { var living = (LivingObject)_living; if (this.CurrentBuildOrder == null) return null; if (m_currentJob == null) { var job = CreateJob(this.CurrentBuildOrder); if (job == null) { trace.TraceWarning("XXX failed to create job, removing build order"); RemoveBuildOrder(this.CurrentBuildOrder); return null; } m_currentJob = job; trace.TraceInformation("new build job created"); } foreach (var a in m_currentJob.GetAssignments(living)) { if (a.LaborID == LaborID.None || living.GetLaborEnabled(a.LaborID)) return m_currentJob.FindAssignment(living); } return null; }
void StopCurrentJob() { var job = m_currentJob; if (job != null) { m_currentJob = null; this.Environment.World.Jobs.Remove(job); if (job.Status == JobStatus.Ok) job.Abort(); } }
public JobGroupViewModel(IJobGroup group) { this.id = group.id; this.description = group.description; this.date_updated = group.date_updated; this.date_created = group.date_created; this.sequence = group.sequence; if (!string.IsNullOrEmpty(group.path)) { this.path = group.path; } if (!string.IsNullOrEmpty(group.alt_text)) { this.alt_text = group.alt_text; } }