Example #1
0
		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;
		}
Example #2
0
		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;
            }
        }
Example #4
0
        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();
            }
        }
Example #5
0
        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;
        }