示例#1
0
        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>();
        }
示例#3
0
		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);
		}
示例#4
0
        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;
        }
示例#5
0
        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);
        }
示例#6
0
 void OnDeserialized()
 {
     m_unreachables = new Unreachables(m_environment.World);
 }
示例#7
0
        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);
        }
 void OnDeserialized()
 {
     m_unreachables = new Unreachables(m_environment.World);
 }