forked from External/mage
Interfaces and abstract classes for Mage.Card.Plugin. Replaced creating permanent by calling plugin manager that returns old implementation but new is also possible since now.
This commit is contained in:
parent
ce4537c6c4
commit
9eb8b0e487
18 changed files with 258 additions and 41 deletions
|
|
@ -2,15 +2,23 @@ package mage.client.plugins.impl;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.Permanent;
|
||||
import mage.client.plugins.MagePlugins;
|
||||
import mage.client.util.Constants;
|
||||
import mage.client.util.Config;
|
||||
import mage.constants.Constants;
|
||||
import mage.interfaces.plugin.CardPlugin;
|
||||
import mage.interfaces.plugin.ThemePlugin;
|
||||
import mage.util.Logging;
|
||||
import mage.view.PermanentView;
|
||||
import net.xeoh.plugins.base.PluginManager;
|
||||
import net.xeoh.plugins.base.impl.PluginManagerFactory;
|
||||
import net.xeoh.plugins.base.util.PluginManagerUtil;
|
||||
|
|
@ -47,4 +55,14 @@ public class Plugins implements MagePlugins {
|
|||
pl.apply(ui);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagePermanent getMagePermanent(PermanentView card, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
CardPlugin cp = pm.getPlugin(CardPlugin.class);
|
||||
if (cp != null) {
|
||||
return cp.getMagePermanent(card, dimension, gameId);
|
||||
} else {
|
||||
return new Permanent(card, bigCard, Config.dimensions, gameId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue