public interface VillagerRegistry
Multimap<Integer,TradeOfferListMutator> getTradeOfferLevelMap(Career career)
Multimap
of the Career
's registered
{code level} to TradeOfferListMutator
s. Note that the map is
immutable and cannot be modified directly.career
- The careerdefault Collection<TradeOfferListMutator> getMutatorsForCareer(Career career, int level)
career
- The careerlevel
- The levelVillagerRegistry addMutator(Career career, int level, TradeOfferListMutator mutator)
TradeOfferListMutator
for the given
Career
and level
. Note that the level
must be at least 1. There can be multiple TradeOfferListMutator
s
per level.career
- The careerlevel
- The levelmutator
- The mutator to registerVillagerRegistry addMutators(Career career, int level, TradeOfferListMutator mutator, TradeOfferListMutator... mutators)
TradeOfferListMutator
s for the given
Career
and level
. Note that the level
must be at least 1. There can be multiple TradeOfferListMutator
s
per level.career
- The careerlevel
- The levelmutator
- The mutator to registermutators
- The additional mutatorsVillagerRegistry setMutators(Career career, int level, List<TradeOfferListMutator> mutators)
TradeOfferListMutator
for the given
Career
and level
. Note that the level
must be at least 1. There can be multiple TradeOfferListMutator
s
per level. Any previously provided TradeOfferListMutator
s will
be erased.career
- The careerlevel
- The levelmutators
- The mutators to registerVillagerRegistry setMutators(Career career, Multimap<Integer,TradeOfferListMutator> mutatorMap)
TradeOfferListMutator
for the given
Career
and level
. Note that the level
must be at least 1. There can be multiple TradeOfferListMutator
s
per level. Any previously provided TradeOfferListMutator
s will
be erased.career
- The careermutatorMap
- The mutator mapdefault Collection<TradeOffer> generateTradeOffers(Merchant merchant, Career career, int level, Random random)
merchant
- The merchantcareer
- The careerlevel
- The levelrandom
- The randomdefault List<TradeOffer> populateOffers(Merchant merchant, List<TradeOffer> currentOffers, Career career, int level, Random random)
List
of TradeOffer
s with
potentially new TradeOffer
s based on the
TradeOfferListMutator
s and level
. If there are no
TradeOfferListMutator
s registered for the desired level
and Career
, the list remains unmodified.merchant
- The merchantcurrentOffers
- The current offerscareer
- The careerlevel
- The levelrandom
- The random to use