public ConstructManager(EnvironmentObject env) { m_environment = env; m_unreachables = new Unreachables(m_environment.World); m_jobDataList = new List<ConstructJobData>(); }
public ConstructManager(EnvironmentObject env) { m_environment = env; m_unreachables = new Unreachables(m_environment.World); m_jobDataList = new List <ConstructJobData>(); }
void Init() { trace.Header = String.Format("BuildItemManager({0})", this.Workbench.ObjectID.Value); this.Workbench.Destructed += OnWorkbenchDestructed; ItemObject.IsInstalledChanged += OnIsInstalledChanged; this.BuildOrderQueue = new ReadOnlyObservableCollection<BuildOrder>(m_buildOrderQueue); m_unreachables = new Unreachables(this.Workbench.World); this.Environment.World.JobManager.AddJobSource(this); }
public ItemObject GetReachableItemByDistance(IntPoint3 location, IItemFilter filter, Unreachables unreachables) { var items = m_items .Where(i => i.IsReserved == false && i.IsInstalled == false && unreachables.IsUnreachable(i.Location) == false) .Where(i => filter.Match(i)) .OrderBy(i => (i.Location - location).ManhattanLength); foreach (var item in items) { var found = AStar.AStarFinder.CanReach(m_env, location, item.Location, DirectionSet.Exact); if (found) return item; unreachables.Add(item.Location); } return null; }
public ItemObject GetReachableItemByDistance(IntVector3 location, IItemFilter filter, Unreachables unreachables) { var items = m_items .Where(i => i.IsReserved == false && i.IsInstalled == false && unreachables.IsUnreachable(i.Location) == false) .Where(i => filter.Match(i)) .OrderBy(i => (i.Location - location).ManhattanLength); foreach (var item in items) { var found = AStar.CanReach(m_env, location, item.Location, DirectionSet.Exact); if (found) { return(item); } unreachables.Add(item.Location); } return(null); }
void OnDeserialized() { m_unreachables = new Unreachables(m_environment.World); }