Class IUpgradeRegistry.Builder
java.lang.Object
me.desht.pneumaticcraft.api.upgrade.IUpgradeRegistry.Builder
- Enclosing interface:
- IUpgradeRegistry
Helper class to collect a list of upgrades for adding to an object via one of the
addApplicableUpgrades()
methods-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IUpgradeRegistry.BuildercopyOf(IUpgradeRegistry.Builder builder) Create a new builder object which is a copy of an existing builderGet the upgrades already added.static IUpgradeRegistry.Builderof(PNCUpgrade upgrade, int amount) Convenience method: Create a builder object with the given upgrade and count added as an initial entrywith(PNCUpgrade upgrade, int amount) Add another upgrade to an existing builder object.
-
Constructor Details
-
Builder
public Builder()Create a new blank builder object
-
-
Method Details
-
copyOf
Create a new builder object which is a copy of an existing builder- Parameters:
builder- the existing builder- Returns:
- a new builder object
-
of
Convenience method: Create a builder object with the given upgrade and count added as an initial entry- Parameters:
upgrade- the upgradeamount- the maximum number of that upgrade accepted by the subject- Returns:
- a builder object
-
with
Add another upgrade to an existing builder object.- Parameters:
upgrade- the upgradeamount- the maximum number of that upgrade accepted by the subject- Returns:
- a builder object
-
getUpgrades
Get the upgrades already added.- Returns:
- a map of upgrade -> maximum number accepted
-