コード例 #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;
		}
コード例 #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();
			}
		}
コード例 #3
0
        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;
            }
        }
コード例 #4
0
ファイル: BuildItemManager.cs プロジェクト: tomba/dwarrowdelf
        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();
            }
        }
コード例 #5
0
ファイル: BuildItemManager.cs プロジェクト: tomba/dwarrowdelf
        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;
        }