private Account CreateNewAccount(string name, string password) { var ac = Account.CreateAccount(name, password, 20); AccountCache.Add(ac); Directory.CreateDirectory(Directory.GetParent(accountFilePath).FullName); GameSerializer.SaveToFile(accountFilePath, AccountCache); return(ac); }
private void ReadAccounts() { if (File.Exists(accountFilePath)) { AccountCache = GameSerializer.ReadFromFile <List <Account> >(accountFilePath); } else { AccountCache = new List <Account>(); GameSerializer.SaveToFile(accountFilePath, AccountCache); } }