The Wallet Manager
Overview
The Wallet Manager is dedicated to the management of the currencies and their balance.
Contrary to the Inventory Manager, which manages item instances, the Wallet Manager doesn't create or destroy any object when adding or removing amounts.
It just changes the balance of the related currency.
Currency vs item instance
The Wallet Manager is designed for items that the player can collect plenty of, but don't need individual stats.
You have two swords in your inventory, each having a different
damage
property value.
Swords are item instances in the Inventory Manager.
I have
1500
gold coins, and each coin doesn't have any individual property.
Gold coin is a currency of the Wallet Manager, with a balance of 1500
.
Initialization
The Wallet Manager is initialized with all the available currency types defined in the Catalog.
Only new players can benefit from the Initial Allocation
of a currency.
If a new currency is created between two sessions of an existing player, their balance will be 0
for this new currency.
API
The Wallet Manager comes with a basic set of expected methods to: