this post was submitted on 17 Nov 2024
24 points (100.0% liked)

Factorio

1031 readers
96 users here now

A Lemmy community for the game Factorio made by Wube Software.

Rules

founded 1 year ago
MODERATORS
 

I've often seen Factorio compared to software development. I'm not a software dev, only a casual programming hobbyist at best. In that context, Gleba spoilage feels like error handling: if things go wrong, do this. If the line spoils, grab it and burn/convert-to-nutrients.

you are viewing a single comment's thread
view the rest of the comments
[–] RustyNova 1 points 5 days ago* (last edited 5 days ago)

I feel like it's more analogous to enum pattern. Your belt is just a array, and your items are enums that may be part of that enum

So to go back to gleba, nutrient belts are just Vec<Result<Nutriment, Spoilage>>