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); }
public void ForceCheck() { foreach (MapItem i in ParentMap.GetObjects <MapItem>()) { if (this.Items.Contains(i) && !this.HasItem(i)) { this.Items.Remove(i); } if (!this.Items.Contains(i) && this.HasItem(i)) { this.Items.Add(i); } } }