Refactoring changes and other updates:

- Completely refactor continuous static effects. Layers are now implemented properly in the sense that every effect applies the relevant parts in the relevant layer, while locking in the set of cards to which it applies.
- Refactor the (un)freezing of Trackable objects to a per-game Tracker object rather than static methods, to allow multiple games hosted on the same machine.
- Refactor the changing of card colours to match other parts of the code (like type and P/T changing) more closely. Also get rid of some static parameters in that code.
- Some changes in how split cards on the stack are handled to make them more robust.
- Some more minor changes/cleanup.
This commit is contained in:
elcnesh
2015-01-26 10:41:06 +00:00
parent 90f88cce9d
commit 92b80c69ff
38 changed files with 876 additions and 827 deletions

View File

@@ -204,14 +204,17 @@ public class GuiChoose {
@Override
public void valueChanged(final ListSelectionEvent ev) {
final T sel = list.getSelectedValue();
if (sel instanceof InventoryItem) {
CMatchUI.SINGLETON_INSTANCE.setCard((InventoryItem) list.getSelectedValue());
return;
}
final CardView card;
if (sel instanceof CardStateView) {
card = ((CardStateView) sel).getCard();
}
else if (sel instanceof CardView) {
} else if (sel instanceof CardView) {
card = (CardView) sel;
}
else {
} else {
card = null;
}
if (card != null) {
@@ -220,9 +223,6 @@ public class GuiChoose {
GuiUtils.clearPanelSelections();
GuiUtils.setPanelSelection(card);
}
if (list.getSelectedValue() instanceof InventoryItem) {
CMatchUI.SINGLETON_INSTANCE.setCard((InventoryItem) list.getSelectedValue());
}
}
});

View File

@@ -199,7 +199,7 @@ public class VAssignDamage {
}
else if (defender instanceof PlayerView) {
final PlayerView p = (PlayerView)defender;
fakeCard = new CardView(-1, defender.toString(), p, CMatchUI.SINGLETON_INSTANCE.avatarImages.get(p.getLobbyPlayerName()));
fakeCard = new CardView(-1, null, defender.toString(), p, CMatchUI.SINGLETON_INSTANCE.avatarImages.get(p.getLobbyPlayerName()));
}
addPanelForDefender(pnlDefenders, fakeCard);
}