예제 #1
0
        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);
        }
예제 #2
0
 private void ReadAccounts()
 {
     if (File.Exists(accountFilePath))
     {
         AccountCache = GameSerializer.ReadFromFile <List <Account> >(accountFilePath);
     }
     else
     {
         AccountCache = new List <Account>();
         GameSerializer.SaveToFile(accountFilePath, AccountCache);
     }
 }