Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IHoldMultipleThings suggestions #24

Open
DoctorVanGogh opened this issue Apr 16, 2019 · 2 comments
Open

IHoldMultipleThings suggestions #24

DoctorVanGogh opened this issue Apr 16, 2019 · 2 comments

Comments

@DoctorVanGogh
Copy link

DoctorVanGogh commented Apr 16, 2019

To keep things centralized, some suggestions for interfaces here:

class StorageOption {
    IEnumerable<ThingDefCount> Storage { get; set; }
    int Priority { get; set; }
}

...
IEnumerable<StorageOption> GetStorageOptions(
    IEnumerable<Thing> thingsToConsiderForHauling, 
    IntVec3 storeCell, 
    Map map)
...
IEnumerable<StorageOption> GetStorageOptions(
    IEnumerable<ThingDef> thingsToConsiderForHauling, 
    IntVec3 storeCell, 
    Map map)
...

Basically you ask "I'd like to store X & Y & Z - what options for storage are valid for you?".
The return result would be alternative options for storage. Even extended to allow priorities on each option.
Selection of any option from the return would then be up to P&H (with "just the first" or "highest priority" being as valid an option as any other - if storage mods don't like this, they are free to only return what they prefer).

Such a signature should allow storage(s) which follow a pattern of

  • A or B or C
  • A and B
  • "Anything"
  • '15 A and 3.5657 B' or '3.14159 X and 360 Y'
@Mehni
Copy link
Owner

Mehni commented Apr 16, 2019

That's a good suggestion, thanks for the help on the design. The extension to allow priorities on each option would come in handy for Stockpile Ranking

@DoctorVanGogh
Copy link
Author

Correction - Needs to be

class StorageOption {
    IEnumerable<ThingDefCount> Storage { get; set; }
    int Priority { get; set; }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants