public void UnloadBank() { if (bank != null && mBankSave != null) { mBankSave.bankInfo = bank.GetInfo(); application.DB.SaveBank(mBankSave); bank = null; mBankSave = null; } }
public void SetBank(BankSave save) { mBankSave = save; if (mBankSave != null && bank == null) { bank = new Bank.Bank(); bank.ParseInfo(mBankSave.bankInfo); log.InfoFormat("bank loaded max count = {0} [red]", bank.maxSlots); SendBankUpdate(); } }
public BankSave LoadBank(string inlogin) { string login = inlogin.ToLower(); var query = Query <BankSave> .EQ(b => b.login, login); var bank = banks.FindOne(query); if (bank != null) { return(bank); } else { Bank.Bank bankObj = new SelectCharacter.Bank.Bank(); BankSave save = new BankSave { bankInfo = bankObj.GetInfo(), login = login }; banks.Save(save); return(save); } }
public void SaveBank(BankSave save) { banks.Save(save); }