public SwingDiscardGrid(final DiscardTracker controller) { super(controller.getEventBus(), DisplayType.discard); super.setBlankIncluded(false); this.controller = controller; // listen for updates controller .getEventBus() .register( new Object() { @Subscribe public void updateDiscards(UpdateDiscards event) { // be sure to show the empty spots setAlwayShown(event.getAlsoVisible(), false); setGrid(new QwirkleGridImpl(event.getPlacements())); if (controller.getCurPlayer() != null) makeDraggable(controller.getCurPlayer()); } @Subscribe public void clearOnTurnEnd(TurnCompleted event) { setGrid(null); } }); }
public void setVertical(boolean vertical) { controller.setVertical(vertical); }