mmb.content.stn.planner.Procurement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
/**
*
*/
package mmb.content.stn.planner;
import java.util.Objects;
import mmb.NN;
import mmb.engine.craft.RecipeOutput;
/**
* @author oskar
*
*/
public class Procurement {
/** The source for this node*/
@NN public final Source node;
/** Quantity of items */
public final int quantity;
/**
* Creates a recipe node from scratch
* @param node source
* @param quantity quantity of processes
* @throws IllegalArgumentException when quantity is non-positive
* @throws NullPointerException when source is null
*/
public Procurement(Source node, int quantity) {
Objects.requireNonNull(node, "node is null");
if(quantity <= 0) throw new IllegalArgumentException("Non-positive quantity");
this.node = node;
this.quantity = quantity;
}
public static interface Source{
/**
* @return items produced per operation
*/
public RecipeOutput outputs();
/**
* Gets the remaining items to source
* @return remaining items, or -1 if unlimited
*/
public int remaining();
}
}