Description
Whenever multi-currency support is added (see #4), commands would need work in order to make them compatible. Here's what I have in mind.
1. Add a new currency argument to the current commands
Add a new argument in the existing command which would accept the currency. Example /eco <string:currency> pay ... or eco pay <string:currency> .... I would prefer the latter if this is to be done.
2. Store players active currency
Making another table which would store the current active currency of the player and each time player executes a command that table is queried and results used. Player would be able to change the active currency with the help of another command.
3. Using currency ids for commands
Having a currencies key in a config like so:
currencies: {
"dollars": {
"symbol": "$",
"default": 0,
"max": 1000
//add more stuff
},
"coins": {
"symbol": "coins",
"default": 0,
"max": 1000
//add more stuff
}
};
Using the array keys of currencies, which are the currency ids, a new command (not a subcommand) is registered with the all the subcommands that are currently there for eco command. Essentially the commands would be somewhat like dollars pay ... or coins pay ... etc. Furthermore, the command name can be used to identify the currency the player is wanting to use.
Any suggestion, improvements or thoughts would be appreciated.