Пример #1
0
 // TODO: Fix it to allow more pokemon without breaking current database
 public async Task PopulateDatabase(bool populateWith, bool clearFirst)
 {
     if (clearFirst)
     {
         await caughtDatabase.DeleteAllAsync <CaughtModel>();
     }
     else if (populated)
     {
         return;
     }
     if ((await GetAllPokemonCaught()).Count != PokeData.MAX_DEX_NUM)
     {
         for (int id = 0; id < PokeData.MAX_DEX_NUM; id++)
         {
             var pokemon = new CaughtModel {
                 ID = id, Obtained = populateWith
             };
             await caughtDatabase.InsertAsync(pokemon);
         }
     }
     PokeData.Caught = (await App.CaughtDatabaseInstance.GetAllPokemonCaught()).ToArray();
     populated       = true;
 }
Пример #2
0
 public Task <int> SetCaughtStatus(CaughtModel item)
 {
     return(caughtDatabase.UpdateAsync(item));
 }