(Object item)
| 185 | } |
| 186 | |
| 187 | private static CardView getCardView(Object item) { |
| 188 | if (item instanceof Entry) { |
| 189 | item = ((Entry<?, ?>) item).getKey(); |
| 190 | } |
| 191 | if (item instanceof CardView cw) { |
| 192 | return cw; |
| 193 | } |
| 194 | if (item instanceof DeckProxy deck) { |
| 195 | if (item instanceof CardThemedDeckGenerator gen) { |
| 196 | return CardView.getCardForUi(gen.getPaperCard()); |
| 197 | } else if (item instanceof CommanderDeckGenerator gen) { |
| 198 | return CardView.getCardForUi(gen.getPaperCard()); |
| 199 | } else if (item instanceof ArchetypeDeckGenerator gen) { |
| 200 | return CardView.getCardForUi(gen.getPaperCard()); |
| 201 | } else { |
| 202 | return new CardView(-1, null, deck.getName(), null, deck.getImageKey(false)); |
| 203 | } |
| 204 | |
| 205 | } |
| 206 | if (item instanceof IPaperCard ipc) { |
| 207 | return CardView.getCardForUi(ipc); |
| 208 | } |
| 209 | if (item instanceof ConquestCommander cc) { |
| 210 | return CardView.getCardForUi(cc.getCard()); |
| 211 | } |
| 212 | if (item instanceof InventoryItem ii) { |
| 213 | return new CardView(-1, null, ii.getDisplayName(), null, ii.getImageKey(false)); |
| 214 | } |
| 215 | return new CardView(-1, null, item.toString()); |
| 216 | } |
| 217 | |
| 218 | @Override |
| 219 | public boolean tap(float x, float y, int count) { |
no test coverage detected