You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
George Heineman edited this page Feb 8, 2018
·
1 revision
// this is a generic architecture for a deck controller. As such this can be reused as is// across all variationsDeckController : {
λname. {letboxNameParameter = {name} in {
λdp. {letboxDeckMousePressed = {dpbox["m"]} in {
box ["======="NameParameter"\DeckController.java=======package "NameParameter";import java.awt.event.MouseEvent;import ks.common.view.*;import ks.common.model.*;import ks.common.controller.*;/** * Controller for Decks. Typical actions involve just dealing cards from deck, so this * kind of controller is simpler to write. This standardized deck controller has only * press events (for now). */public class DeckController extends SolitaireReleasedAdapter { protected "NameParameter" theGame; public DeckController("NameParameter" theGame) { super(theGame); this.theGame = theGame; } // Deal cards public void mousePressed(MouseEvent me) { Move m; // Action on press "DeckMousePressed" // have solitaire game refresh widgets that were affected theGame.refreshWidgets(); }}"]
}}
}}
}