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

pool IOfferPool
validator IAcquisitionValidator

Methods

AcquireItem(RunState, ItemDef, OfferChannel)

public RunResult AcquireItem(RunState run, ItemDef item, OfferChannel channel)

Parameters

run RunState
item ItemDef
channel OfferChannel

Returns

RunResult

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

run RunState
weapon WeaponItemDef
channel OfferChannel

Returns

RunResult

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

run RunState
weapon WeaponItemDef

Returns

RunResult

Buy(RunState, int)

public RunResult Buy(RunState run, int slot)

Parameters

run RunState
slot int

Returns

RunResult

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

run RunState
weapon WeaponItemDef

Returns

bool

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

run RunState
weaponIndex int

Returns

RunResult

Price(RunState, int)

public int Price(RunState run, int basePrice)

Parameters

run RunState
basePrice int

Returns

int

Recycle(RunState, int)

public RunResult Recycle(RunState run, int weaponIndex)

Parameters

run RunState
weaponIndex int

Returns

RunResult

RecycleRefund(RunState, WeaponItemDef)

public int RecycleRefund(RunState run, WeaponItemDef weapon)

Parameters

run RunState
weapon WeaponItemDef

Returns

int

Reroll(RunState)

public RunResult Reroll(RunState run)

Parameters

run RunState

Returns

RunResult

RerollCost(RunState)

public int RerollCost(RunState run)

Parameters

run RunState

Returns

int

Restock(RunState)

Fills unlocked slots (resizing the slot list to Settings.Shop.Slots). Free.

public void Restock(RunState run)

Parameters

run RunState

ToggleLock(RunState, int)

public RunResult ToggleLock(RunState run, int slot)

Parameters

run RunState
slot int

Returns

RunResult