MCPcopy Create free account
hub / github.com/Card-Forge/forge / getCardView

Method getCardView

forge-gui-mobile/src/forge/card/CardZoom.java:187–216  ·  view source on GitHub ↗
(Object item)

Source from the content-addressed store, hash-verified

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) {

Callers 2

showMethod · 0.95
incrementCardMethod · 0.95

Calls 8

getCardForUiMethod · 0.95
getNameMethod · 0.65
getImageKeyMethod · 0.65
getCardMethod · 0.65
getDisplayNameMethod · 0.65
getKeyMethod · 0.45
getPaperCardMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected