public override void Work() { if (SubJob == null) { Logger.Log("Construct.Work doing self work", Logger.DEBUG); WorkRequired--; if (WorkRequired <= 0) { Logger.Log("Construct.Work Finishing", Logger.DEBUG); Finish(); } } else { Logger.Log("Construct.Work doing SubJob.Work", Logger.DEBUG); SubJob.Work(); Location = SubJob.GetLocation(); if (SubJob.Completed) { Logger.Log("Construct.Work SubJob Completed", Logger.DEBUG); var j = (Haul)SubJob; foreach (var c in j.Carried) { CapturedResources.Add(c); } j.Carried = new List <Entity>(); j.ReleaseOwnership(); SubJob = null; GenerateNextStep(); } } }
public override Point GetLocation() { if (SubJob == null) { Logger.Log("Construct job returning it's own location", Logger.DEBUG); return(Location); } Logger.Log("Construct job returning Subjob Location", Logger.DEBUG); return(SubJob.GetLocation()); }