コード例 #1
0
ファイル: GameKey.java プロジェクト: ngocthanh2207/GameMemo
 public static List<Game> loadGames(int gameKey, ContentResolver resolver, List<Long> timestamps) {
   List<Game> gamesToSend = new ArrayList<Game>(timestamps.size());
   switch (gameKey) {
     case GameKey.TICHU:
       try {
         gamesToSend =
             TichuGame.loadGames(
                 resolver, GameStorageHelper.getUriAllItems(gameKey), timestamps, false);
       } catch (CompactedDataCorruptException e) {
         assert false; // load games will not throw as requested by the parameter
       }
       break;
     case DOPPELKOPF:
       try {
         gamesToSend =
             DoppelkopfGame.loadGames(
                 resolver, GameStorageHelper.getUriAllItems(gameKey), timestamps, false);
       } catch (CompactedDataCorruptException e) {
         assert false; // load games will not throw as requested by the parameter
       }
       break;
     default:
       throw new IllegalArgumentException("Game not supported: " + gameKey);
   }
   return gamesToSend;
 }
コード例 #2
0
ファイル: GameKey.java プロジェクト: ngocthanh2207/GameMemo
 public static List<Game> loadGames(int gameKey, ContentResolver resolver, Uri uri)
     throws CompactedDataCorruptException {
   switch (gameKey) {
     case GameKey.TICHU:
       return TichuGame.loadGames(resolver, uri, true);
     case DOPPELKOPF:
       return DoppelkopfGame.loadGames(resolver, uri, true);
     default:
       throw new IllegalArgumentException("Game not supported: " + gameKey);
   }
 }