Proposed Solution: Use a datum for the accounts and account actions, create a savefile for individual accounts.
Account
var
accOwner // Instant access to account
accBank
accNum
accPass
accCash = 0
New(mob/M,bank)
accOwner = M
accBank = bank
accNum = randomlyGenerated()
accPass = randomlyGenerated()
update()
proc
addCash() // Also update the cash display
// of the owner of the account
removeCash()
update()
var/savefile/F = new/savefile("[accBank]/[accNum].sav")
F << src
Then allow access to the account if you have the account number and password.
proc/accessAccount(bank,accountNumber,accountPassword)
if(fexists("[bank]/[accNum].sav")
var/savefile/F = new/savefile("[bank]/[accNum].sav")
var/Account/a = null
F >> a
if(accountPassword==a.accPass)
//access
So yeah, just wondering if this is the best direction to go in for something like this. Perhaps I should be keeping track of which account the user is currently accessing?
I've been out of the programming game for a while and it's taking some time to get my bearings, so I appreciate the input.
If this isn't a mechanic of the game, then why even bother thinking about this? Bank security could easily be tied to overall account security so you could kill two birds with one stone.