package metadata; import simulation.BuildingState; import java.util.Collection; import java.util.Map; import java.util.Objects; public class FactoryMetadata extends BuildingMetadata { private final int productionInterval; private final Collection inputs; private final FactoryOutput output; public FactoryMetadata(String type, Map iconsPaths, int productionInterval, Collection inputs, FactoryOutput output) { super(type, iconsPaths); this.productionInterval = productionInterval; this.inputs = inputs; this.output = output; } public int getProductionInterval() { return productionInterval; } public Collection getInputs() { return inputs; } public FactoryOutput getOutput() { return output; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; FactoryMetadata that = (FactoryMetadata) o; return productionInterval == that.productionInterval && inputs.equals(that.inputs) && output.equals(that.output); } @Override public int hashCode() { return Objects.hash(super.hashCode(), productionInterval, inputs, output); } @Override public String toString() { return "FactoryMetadata{" + "productionInterval=" + productionInterval + ", inputs=" + inputs + ", output=" + output + "} " + super.toString(); } }