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

Method initCache

forge-gui-mobile/src/forge/assets/ImageCache.java:86–96  ·  view source on GitHub ↗
(int capacity)

Source from the content-addressed store, hash-verified

84 return imageCache;
85 }
86 private void initCache(int capacity) {
87 //override maxCardCapacity
88 maxCardCapacity = capacity;
89 //init q
90 q = EvictingQueue.create(capacity);
91 //init syncQ for threadsafe use
92 syncQ = Queues.synchronizedQueue(q);
93 //cap
94 int cl = GuiBase.isAndroid() ? maxCardCapacity + (capacity / 3) : 400;
95 cardsLoaded = new HashSet<>(cl);
96 }
97
98 private Set<String> getCardsLoaded() {
99 if (cardsLoaded == null) {

Callers 1

getInstanceMethod · 0.80

Calls 2

isAndroidMethod · 0.95
createMethod · 0.65

Tested by

no test coverage detected