Class ShopRules
- Namespace
- SurvivorsMaker.Run
- Assembly
- SurvivorsMaker.Run.dll
Shop generation through the shared pool and atomic acquisition transactions.
public sealed class ShopRules : IShopRules
- Inheritance
-
ShopRules
- Implements
- Inherited Members
Constructors
ShopRules(IOfferPool, IAcquisitionValidator)
public ShopRules(IOfferPool pool = null, IAcquisitionValidator validator = null)
Parameters
poolIOfferPoolvalidatorIAcquisitionValidator
Methods
AcquireItem(RunState, ItemDef, OfferChannel)
public RunResult AcquireItem(RunState run, ItemDef item, OfferChannel channel)
Parameters
runRunStateitemItemDefchannelOfferChannel
Returns
AcquireWeapon(RunState, WeaponItemDef, OfferChannel)
Explicit-channel grant for rewards. No phase, currency or random mutations.
public RunResult AcquireWeapon(RunState run, WeaponItemDef weapon, OfferChannel channel)
Parameters
runRunStateweaponWeaponItemDefchannelOfferChannel
Returns
AddWeapon(RunState, WeaponItemDef)
Adds a weapon following the slot/merge rules. Used by buying and field-mode choices.
public RunResult AddWeapon(RunState run, WeaponItemDef weapon)
Parameters
runRunStateweaponWeaponItemDef
Returns
Buy(RunState, int)
public RunResult Buy(RunState run, int slot)
Parameters
Returns
CanAccept(RunState, WeaponItemDef)
True if the weapon could be added now (free slot, or full slots with a merge partner).
public bool CanAccept(RunState run, WeaponItemDef weapon)
Parameters
runRunStateweaponWeaponItemDef
Returns
Merge(RunState, int)
Merges the weapon at weaponIndex with the first other copy into its next tier.
public RunResult Merge(RunState run, int weaponIndex)
Parameters
Returns
Price(RunState, int)
public int Price(RunState run, int basePrice)
Parameters
Returns
Recycle(RunState, int)
public RunResult Recycle(RunState run, int weaponIndex)
Parameters
Returns
RecycleRefund(RunState, WeaponItemDef)
public int RecycleRefund(RunState run, WeaponItemDef weapon)
Parameters
runRunStateweaponWeaponItemDef
Returns
Reroll(RunState)
public RunResult Reroll(RunState run)
Parameters
runRunState
Returns
RerollCost(RunState)
public int RerollCost(RunState run)
Parameters
runRunState
Returns
Restock(RunState)
Fills unlocked slots (resizing the slot list to Settings.Shop.Slots). Free.
public void Restock(RunState run)
Parameters
runRunState
ToggleLock(RunState, int)
public RunResult ToggleLock(RunState run, int slot)