Class ScriptableGroupItemList
A list whose items are in groups, each with a fixed cost and probability that one of its items will be displayed in the store.
Inherited Members
Namespace: AutoBattleFramework.Shop.ShopList
Assembly: cs.temp.dll.dll
Syntax
public class ScriptableGroupItemList : IShopList
Fields
GroupItemList
Group of items.
Declaration
public List<ShopItemList> GroupItemList
Field Value
Type | Description |
---|---|
List<ShopItemList> |
Methods
AddItemInfo(ShopItemInfo)
Add a item information to a group, based on its cost.
Declaration
public override ShopItemInfo AddItemInfo(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Information to be added. |
Returns
Type | Description |
---|---|
ShopItemInfo | The added info. |
Overrides
Backup()
Make a new instance of the list.
Declaration
public override IShopList Backup()
Returns
Type | Description |
---|---|
IShopList | New instance of the list. |
Overrides
Draw(List<ShopItemInfo>, Boolean)
Retrieve a single item from the list and add it to a list.
Declaration
public override ShopItemInfo Draw(List<ShopItemInfo> items, bool RepeatItems)
Parameters
Type | Name | Description |
---|---|---|
List<ShopItemInfo> | items | List where the item will be added. |
Boolean | RepeatItems | The retrieved item can be repeated in the list. |
Returns
Type | Description |
---|---|
ShopItemInfo |
Overrides
GetRandomItems(Int32, Boolean)
Return a number of items to be shown in ShopUI, based on each group probability.
Declaration
public override List<ShopItemInfo> GetRandomItems(int numberOfItems, bool RepeatItems)
Parameters
Type | Name | Description |
---|---|---|
Int32 | numberOfItems | Number of items to retrieve. |
Boolean | RepeatItems | The items retrieved can be repeated. |
Returns
Type | Description |
---|---|
List<ShopItemInfo> | List of items retrieved. |
Overrides
Initialize()
Each item info is updated with the group information.
Declaration
public override void Initialize()
Overrides
ModifyGameActor(GameActor)
Modify the stats of a GameActor.
Declaration
public override void ModifyGameActor(GameActor actor)
Parameters
Type | Name | Description |
---|---|---|
GameActor | actor | GameActor to modify |
Overrides
OnBuy(ShopItemInfo)
On buy do nothing.
Declaration
public override void OnBuy(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Bought item |
Overrides
RemoveItemInfo(ShopItemInfo)
Remove the item information from its group.
Declaration
public override bool RemoveItemInfo(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Information to be removed. |
Returns
Type | Description |
---|---|
Boolean | If item has been removed. |
Overrides
RestoreItemInfo(ScriptableShopItem)
Restore a ShopItemInfo that has been bought before. Returns true if successful.
Declaration
public override bool RestoreItemInfo(ScriptableShopItem info)
Parameters
Type | Name | Description |
---|---|---|
ScriptableShopItem | info | Item to be restored. |
Returns
Type | Description |
---|---|
Boolean | True if succesful |