[Automate] Refactor to support global inventory chests#1081
Conversation
Replaced all references to "Junimo chests" with "global inventory chests." Renamed `JunimoMachineGroup` to `GlobalMachineGroup` and updated related properties and methods. Introduced a `GlobalInventoryId` property in the `IContainer` interface for improved management of global inventory chests. These changes enhance the system's capability to handle various inventory types while ensuring compatibility with existing functionality.
|
@Pathoschild this not 100% working yet, but I wanted to submit an early draft to get your thoughts on the overall implementation so that I can make adjustments before I get too deep into it. |
- Removed unnecessary `using` directive from `GlobalMachineGroup.cs`. - Changed `globalChanged` type to `HashSet<IMachineGroup>` for broader compatibility. - Introduced `globalAdded` to track newly added global machine groups. - Updated logic to utilize `globalAdded` for adding groups. - Filtered `globalChanged` in the rebuild loop to include only `GlobalMachineGroup` types.
|
@Pathoschild as a proof of concept, this now works in the few basic tests I have done. I setup a Chest with a GlobalInventoryId in one location, and setup another chest with the same GlobalInventoryId in a different location. I then connected a regular chest next to one of them with resources, and setup a machine next to the other one. The resources began to process as expected. There are still a lot of changes needed for reporting the right stats and such, and some more testing to verify whether it can merge multiple groups into a single group when more than one GlobalInventoryId is associated with it. |
48da0dd to
27900b1
Compare
This is an early draft of the changes to implement Global Inventory support for Automate.