mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Removed Lambda0 in favour of guava Supplier<T>
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -12747,7 +12747,6 @@ src/main/java/forge/util/StorageView.java -text
|
||||
src/main/java/forge/util/TextUtil.java -text
|
||||
src/main/java/forge/util/ThreadUtil.java svneol=native#text/plain
|
||||
src/main/java/forge/util/XmlUtil.java -text
|
||||
src/main/java/forge/util/closures/Lambda0.java -text
|
||||
src/main/java/forge/util/closures/Lambda1.java svneol=native#text/plain
|
||||
src/main/java/forge/util/closures/package-info.java svneol=native#text/plain
|
||||
src/main/java/forge/util/package-info.java -text
|
||||
|
||||
@@ -19,6 +19,8 @@ package forge.gui.deckeditor.controllers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.deck.Deck;
|
||||
import forge.gui.deckeditor.SEditorIO;
|
||||
@@ -36,7 +38,6 @@ import forge.item.CardPrinted;
|
||||
import forge.item.InventoryItem;
|
||||
import forge.item.ItemPool;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.closures.Lambda0;
|
||||
|
||||
/**
|
||||
* Child controller for constructed deck editor UI.
|
||||
@@ -69,9 +70,9 @@ public final class CEditorConstructed extends ACEditorBase<CardPrinted, Deck> {
|
||||
this.setTableCatalog(tblCatalog);
|
||||
this.setTableDeck(tblDeck);
|
||||
|
||||
final Lambda0<Deck> newCreator = new Lambda0<Deck>() {
|
||||
final Supplier<Deck> newCreator = new Supplier<Deck>() {
|
||||
@Override
|
||||
public Deck apply() {
|
||||
public Deck get() {
|
||||
return new Deck();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
package forge.gui.deckeditor.controllers;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckGroup;
|
||||
import forge.gui.deckeditor.SEditorIO;
|
||||
@@ -31,7 +33,6 @@ import forge.gui.home.sanctioned.CSubmenuSealed;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.InventoryItem;
|
||||
import forge.util.IStorage;
|
||||
import forge.util.closures.Lambda0;
|
||||
|
||||
/**
|
||||
* Child controller for limited deck editor UI.
|
||||
@@ -62,9 +63,9 @@ public final class CEditorLimited extends ACEditorBase<CardPrinted, DeckGroup> {
|
||||
this.setTableCatalog(tblCatalog);
|
||||
this.setTableDeck(tblDeck);
|
||||
|
||||
final Lambda0<DeckGroup> newCreator = new Lambda0<DeckGroup>() {
|
||||
final Supplier<DeckGroup> newCreator = new Supplier<DeckGroup>() {
|
||||
@Override
|
||||
public DeckGroup apply() {
|
||||
public DeckGroup get() {
|
||||
return new DeckGroup("");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Constant;
|
||||
import forge.deck.Deck;
|
||||
@@ -40,7 +42,6 @@ import forge.item.CardPrinted;
|
||||
import forge.item.InventoryItem;
|
||||
import forge.item.ItemPool;
|
||||
import forge.quest.QuestController;
|
||||
import forge.util.closures.Lambda0;
|
||||
import forge.util.closures.Lambda1;
|
||||
|
||||
//import forge.quest.data.QuestBoosterPack;
|
||||
@@ -97,9 +98,9 @@ public final class CEditorQuest extends ACEditorBase<CardPrinted, Deck> {
|
||||
this.setTableCatalog(tblCatalog);
|
||||
this.setTableDeck(tblDeck);
|
||||
|
||||
final Lambda0<Deck> newCreator = new Lambda0<Deck>() {
|
||||
final Supplier<Deck> newCreator = new Supplier<Deck>() {
|
||||
@Override
|
||||
public Deck apply() {
|
||||
public Deck get() {
|
||||
return new Deck();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,13 +21,14 @@ import java.util.ArrayList;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.deck.DeckBase;
|
||||
import forge.gui.deckeditor.controllers.ACEditorBase;
|
||||
import forge.gui.deckeditor.controllers.CProbabilities;
|
||||
import forge.gui.deckeditor.controllers.CStatistics;
|
||||
import forge.gui.deckeditor.views.VCurrentDeck;
|
||||
import forge.util.IStorage;
|
||||
import forge.util.closures.Lambda0;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
@@ -41,7 +42,7 @@ public class DeckController<T extends DeckBase> {
|
||||
private boolean modelInStore;
|
||||
private final IStorage<T> folder;
|
||||
private final ACEditorBase<?, T> view;
|
||||
private final Lambda0<T> newModelCreator;
|
||||
private final Supplier<T> newModelCreator;
|
||||
|
||||
/**
|
||||
* Instantiates a new deck controller.
|
||||
@@ -51,7 +52,7 @@ public class DeckController<T extends DeckBase> {
|
||||
* @param newModelCreator0 the new model creator0
|
||||
*/
|
||||
public DeckController(final IStorage<T> folder0, final ACEditorBase<?, T> view0,
|
||||
final Lambda0<T> newModelCreator0) {
|
||||
final Supplier<T> newModelCreator0) {
|
||||
this.folder = folder0;
|
||||
this.view = view0;
|
||||
this.model = null;
|
||||
@@ -292,7 +293,7 @@ public class DeckController<T extends DeckBase> {
|
||||
* New model.
|
||||
*/
|
||||
public void newModel() {
|
||||
this.model = this.newModelCreator.apply();
|
||||
this.model = this.newModelCreator.get();
|
||||
this.saved = true;
|
||||
this.view.resetTables();
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Forge: Play Magic: the Gathering.
|
||||
* Copyright (C) 2011 Forge Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package forge.util.closures;
|
||||
|
||||
/**
|
||||
* The Class Lambda1.
|
||||
*
|
||||
* @param <R> the generic type
|
||||
*/
|
||||
public abstract class Lambda0<R> {
|
||||
|
||||
/**
|
||||
* Apply.
|
||||
*
|
||||
* @return the r
|
||||
*/
|
||||
public abstract R apply();
|
||||
}
|
||||
Reference in New Issue
Block a user