private void FindWork() { if (MyHarvest != null || MyWarehouse != null || MyWorkshop != null) { return; // work has found us } if (Proficiencies.Instance.IsHarvester(Me)) { if (ChooseHarvest()) { return; } } else if (Proficiencies.Instance.IsArtisan(Me)) { if (ChooseWorkshop()) { return; } } // No work is available, so see if we can drop anything off despite not having a full load if (ChooseWarehouse()) { Me.Actions.Movement.SetDestination(MyWarehouse.NearestEntranceTo(Me.transform)); } else { Me.Actions.Movement.ClearCurrentDestination(); // nothing to do and nowhere to be } }
static void Main(string[] args) { IReader <MyWarehouse> reader = new FileReader <MyWarehouse>("stocks.txt", '#'); ISorter <MyWarehouse> sorter = new Sorter <MyWarehouse>(); MyWarehouse mw = new MyWarehouse("error-item"); IParser <MyWarehouse> parser = new LineParser <MyWarehouse>(); //var _lineParser = new LineParser(); StockImporter.WarehouseCollector <MyWarehouse> wc = new StockImporter.WarehouseCollector <MyWarehouse>(parser, reader, sorter, mw); wc.LoadData(); wc.Print(); }
private bool Warehouse() { if (!Me.Inventory.HasContents() || MyWarehouse == null || MyWarehouse.Inventory == null) { return(false); } if (Me.Actions.Movement.AtCurrentDestination()) { MyWarehouse.DeliverMaterials(Me); return(true); } return(false); }
private void FindWarehouse() { if (!Me.Inventory.HasContents()) { return; } if (MyWarehouse != null) { if (Warehouse()) { Me.HasTask = false; } return; } if (ChooseWarehouse()) { Me.Actions.Movement.SetDestination(MyWarehouse.NearestEntranceTo(Me.transform)); } }