mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Refactor dev mode cheat functions into separate class that through it's restricted access allows determining if a player as cheated during a game
This commit is contained in:
@@ -27,7 +27,7 @@ public enum CDev implements ICDoc {
|
||||
public void togglePlayManyLandsPerTurn() {
|
||||
boolean newValue = !VDev.SINGLETON_INSTANCE.getLblUnlimitedLands().getToggled();
|
||||
VDev.SINGLETON_INSTANCE.getLblUnlimitedLands().setToggled(newValue);
|
||||
Singletons.getControl().getGameView().devSetUnlimitedLands(newValue);
|
||||
Singletons.getControl().getGameView().cheat().setCanPlayUnlimitedLands(newValue);
|
||||
}
|
||||
|
||||
private final MouseListener madMana = new MouseAdapter() {
|
||||
@@ -37,7 +37,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void generateMana() {
|
||||
Singletons.getControl().getGameView().devGenerateMana();
|
||||
Singletons.getControl().getGameView().cheat().generateMana();
|
||||
}
|
||||
|
||||
private final MouseListener madSetup = new MouseAdapter() {
|
||||
@@ -47,7 +47,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void setupGameState() {
|
||||
Singletons.getControl().getGameView().devSetupGameState();
|
||||
Singletons.getControl().getGameView().cheat().setupGameState();
|
||||
}
|
||||
|
||||
private final MouseListener madTutor = new MouseAdapter() {
|
||||
@@ -57,7 +57,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void tutorForCard() {
|
||||
Singletons.getControl().getGameView().devTutorForCard();
|
||||
Singletons.getControl().getGameView().cheat().tutorForCard();
|
||||
}
|
||||
|
||||
private final MouseListener madCardToHand = new MouseAdapter() {
|
||||
@@ -67,7 +67,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void addCardToHand() {
|
||||
Singletons.getControl().getGameView().devAddCardToHand();
|
||||
Singletons.getControl().getGameView().cheat().addCardToHand();
|
||||
}
|
||||
|
||||
private final MouseListener madCounter = new MouseAdapter() {
|
||||
@@ -77,7 +77,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void addCounterToPermanent() {
|
||||
Singletons.getControl().getGameView().devAddCounterToPermanent();
|
||||
Singletons.getControl().getGameView().cheat().addCountersToPermanent();
|
||||
}
|
||||
|
||||
private final MouseListener madTap = new MouseAdapter() {
|
||||
@@ -87,7 +87,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void tapPermanent() {
|
||||
Singletons.getControl().getGameView().devTapPermanent();
|
||||
Singletons.getControl().getGameView().cheat().tapPermanents();
|
||||
}
|
||||
|
||||
private final MouseListener madUntap = new MouseAdapter() {
|
||||
@@ -97,7 +97,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void untapPermanent() {
|
||||
Singletons.getControl().getGameView().devUntapPermanent();
|
||||
Singletons.getControl().getGameView().cheat().untapPermanents();
|
||||
}
|
||||
|
||||
private final MouseListener madLife = new MouseAdapter() {
|
||||
@@ -107,7 +107,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void setPlayerLife() {
|
||||
Singletons.getControl().getGameView().devSetPlayerLife();
|
||||
Singletons.getControl().getGameView().cheat().setPlayerLife();
|
||||
}
|
||||
|
||||
private final MouseListener madWinGame = new MouseAdapter() {
|
||||
@@ -117,7 +117,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void winGame() {
|
||||
Singletons.getControl().getGameView().devWinGame();
|
||||
Singletons.getControl().getGameView().cheat().winGame();
|
||||
}
|
||||
|
||||
private final MouseListener madCardToBattlefield = new MouseAdapter() {
|
||||
@@ -127,7 +127,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void addCardToBattlefield() {
|
||||
Singletons.getControl().getGameView().devAddCardToBattlefield();
|
||||
Singletons.getControl().getGameView().cheat().addCardToBattlefield();
|
||||
}
|
||||
|
||||
private final MouseListener madRiggedRoll = new MouseAdapter() {
|
||||
@@ -137,7 +137,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void riggedPlanerRoll() {
|
||||
Singletons.getControl().getGameView().devRiggedPlanerRoll();
|
||||
Singletons.getControl().getGameView().cheat().riggedPlanarRoll();
|
||||
}
|
||||
|
||||
private final MouseListener madWalkToPlane = new MouseAdapter() {
|
||||
@@ -147,7 +147,7 @@ public enum CDev implements ICDoc {
|
||||
}
|
||||
};
|
||||
public void planeswalkTo() {
|
||||
Singletons.getControl().getGameView().devPlaneswalkTo();
|
||||
Singletons.getControl().getGameView().cheat().planeswalkTo();
|
||||
}
|
||||
|
||||
//========== End mouse listener inits
|
||||
@@ -186,6 +186,6 @@ public enum CDev implements ICDoc {
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
VDev.SINGLETON_INSTANCE.getLblUnlimitedLands().setToggled(Singletons.getControl().getGameView().devGetUnlimitedLands());
|
||||
VDev.SINGLETON_INSTANCE.getLblUnlimitedLands().setToggled(Singletons.getControl().getGameView().canPlayUnlimitedLands());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DevModeMenu implements ActionListener {
|
||||
menu.add(getMenuItem(DevMenuItem.WIN_GAME));
|
||||
menu.addSeparator();
|
||||
menu.add(getMenuItem(DevMenuItem.SETUP_GAME_STATE));
|
||||
menu.add(getCheckboxMenuItem(DevMenuItem.PLAY_UNLIMITED_LANDS, Singletons.getControl().getGameView().devGetUnlimitedLands()));
|
||||
menu.add(getCheckboxMenuItem(DevMenuItem.PLAY_UNLIMITED_LANDS, Singletons.getControl().getGameView().canPlayUnlimitedLands()));
|
||||
menu.add(getMenuItem(DevMenuItem.ADD_COUNTER));
|
||||
menu.addSeparator();
|
||||
menu.add(getMenuItem(DevMenuItem.TAP_PERMANENT));
|
||||
|
||||
Reference in New Issue
Block a user