Beispiel #1
0
        public List <Interfaces.ITask> GenerateTasks()
        {
            List <Interfaces.ITask> result = new List <Interfaces.ITask>();

            Point v;

            List <MapItem> items = ParentMap.GetObjects <MapItem>();

            foreach (MapItem Item in items)
            {
                if (!Item.Reserved && ParentMap.FindStockpile(Item) == null)
                {
                    v = GetFreeSpot();
                    if (v == new Point(-1, -1))
                    {
                        return(result);
                    }
                    Components.Tasks.Haul h = new Tasks.Haul(Item, v);
                    Item.Reserved = true;
                    Reserved.Add(v);
                    result.Add(h);
                }
            }

            return(result);
        }