Quote:
Originally Posted by Twinny
Ok: How would you two do it?
|
Well, the way that my system works is that I have a collection of public functions in a class which is joined to the player.
PHP Code:
public function bankCreate();
public function bankDeposit();
public function bankWithdraw();
I also have other functions for checking if they have an account, checking the balance, etc.
I also have a DB NPC for storing the bank data, i.e.
PHP Code:
DB_Bank.("bank_" @ this.account) = ...;
However, but it doesn't do any functioning itself.
Then, instead of having to pass the account name, I can just use the this. object to access the player so that you can just do this to deposit 30g:
PHP Code:
player.bankDeposit(30);
It makes it:
- Easier to type, and remember.
- Easier for other people to pick up and use.
- So that you don't have to pass the account name.