Open PizzaCrust opened 8 years ago
I don't know if I like going through the server to create them. An InventoryManager or another proxy class would make things cleaner.
I also think making a builder for everything is overkill. What if I want to create the inventory while iterating through a loop? I'd have to cache my items in an array and then add it to the builder.
Fountain.getInventoryBuilder("Microwave").build();
You don't have to cache, you could do this:
InventoryBuilder builder = Fountain.getInventoryBuilder("Microwave");
for (SomeItem item : itemList) {
builder.item(item);
}
builder.build();
Inventories shouldn't be immutable. Thats going to involve massive amounts of overhead and copying, and is pretty confusing.
Possibly: