mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Code cleanup
This commit is contained in:
@@ -125,9 +125,10 @@ public class DeckProxy implements InventoryItem {
|
||||
if (sbSize == Integer.MIN_VALUE) {
|
||||
CardPool sb = getDeck().get(DeckSection.Sideboard);
|
||||
sbSize = sb == null ? -1 : sb.countAll();
|
||||
if( sbSize == 0 )
|
||||
if (sbSize == 0) {
|
||||
sbSize = -1;
|
||||
}
|
||||
}
|
||||
return sbSize;
|
||||
}
|
||||
|
||||
@@ -179,21 +180,24 @@ public class DeckProxy implements InventoryItem {
|
||||
}
|
||||
|
||||
public void reloadFromStorage() {
|
||||
if( null != storage )
|
||||
if (storage != null) {
|
||||
deck = storage.get(getName());
|
||||
}
|
||||
invalidateCache();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void updateInStorage() {
|
||||
if ( storage instanceof StorageImmediatelySerialized<?> )
|
||||
if (storage instanceof StorageImmediatelySerialized<?>) {
|
||||
((StorageImmediatelySerialized<IHasName>)storage).add(deck);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteFromStorage() {
|
||||
if ( storage instanceof StorageImmediatelySerialized<?> )
|
||||
if (storage instanceof StorageImmediatelySerialized<?>) {
|
||||
storage.delete(getName());
|
||||
}
|
||||
}
|
||||
|
||||
private static class ThemeDeckGenerator extends DeckProxy {
|
||||
private final String name;
|
||||
|
||||
@@ -47,8 +47,7 @@ public class DeckController<T extends DeckBase> {
|
||||
* @param view0 the view0
|
||||
* @param newModelCreator0 the new model creator0
|
||||
*/
|
||||
public DeckController(final IStorage<T> folder0, final ACEditorBase<?, T> view0,
|
||||
final Supplier<T> newModelCreator0) {
|
||||
public DeckController(final IStorage<T> folder0, final ACEditorBase<?, T> view0, final Supplier<T> newModelCreator0) {
|
||||
this.rootFolder = folder0;
|
||||
this.currentFolder = rootFolder;
|
||||
this.view = view0;
|
||||
@@ -142,10 +141,12 @@ public class DeckController<T extends DeckBase> {
|
||||
}
|
||||
|
||||
public void load(final String path, final String name) {
|
||||
if ( StringUtils.isBlank(path))
|
||||
if (StringUtils.isBlank(path)) {
|
||||
currentFolder = rootFolder;
|
||||
else
|
||||
}
|
||||
else {
|
||||
currentFolder = rootFolder.tryGetFolder(path);
|
||||
}
|
||||
load(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -407,7 +407,6 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel {
|
||||
*/
|
||||
public void setPool(final ItemPool<T> poolView, boolean infinite) {
|
||||
this.setPoolImpl(ItemPool.createFrom(poolView, this.genericType), infinite);
|
||||
|
||||
}
|
||||
|
||||
public void setPool(final ItemPool<T> pool0) {
|
||||
|
||||
Reference in New Issue
Block a user