package controller.TableTab;


import javafx.event.Event;
import model.CardSettings;
import view.TableTab.CardRestrictionsMenuView;

import java.util.List;

public class CardRestrictionsMenuController {

    private CardRestrictionsMenuView cardRestrictionsMenuView;
    private CardSettings cardSettings;

    public CardRestrictionsMenuController(CardRestrictionsMenuView view){
        cardRestrictionsMenuView = view;
        cardSettings = new CardSettings();
        cardRestrictionsMenuView.getUpdateButton().setOnAction(this::onUpdateButtonClick);
        updateCardList();
        /* change to use observer/ observable */
    }

    public List<String> getCardList(){
        return cardSettings.getCardList();
    }

    public void updateCardList(){
        cardRestrictionsMenuView.updateCardList(cardSettings.getCardList());
    }

    public void onUpdateButtonClick(Event event){
        System.out.println("Update pressed - Card Restrictions Menu ");

        /* Get input from view. convert counts from strings to ints */

        /* validate */
        /* update model */
        /* update view */
        /* */
    }
}

@@ -1036,98 +1036,865 @@
  */%0A
-%0A        /* validate */%0A        /* update model */%0A        /* update view */%0A        /* */
+        String heartCount = cardRestrictionsMenuView.getHeartCount();%0A        String spadeCount = cardRestrictionsMenuView.getSpadeCount();%0A        String clubCount = cardRestrictionsMenuView.getClubCount();%0A        String diamondCount = cardRestrictionsMenuView.getDiamondCount();%0A%0A%0A        /* validate */%0A        /* update model */%0A        /* update view */%0A        /* */%0A    %7D%0A%0A    public void updateSuitCounts(String card)%7B%0A        cardRestrictionsMenuView.setHeartCount(Integer.toString(cardSettings.getSuitCount(card,%22heart%22)));%0A        cardRestrictionsMenuView.setSpadeCount(Integer.toString(cardSettings.getSuitCount(card,%22spade%22)));%0A        cardRestrictionsMenuView.setClubCount(Integer.toString(cardSettings.getSuitCount(card,%22club%22)));%0A        cardRestrictionsMenuView.setDiamondCount(Integer.toString(cardSettings.getSuitCount(card,%22diamond%22)));
 %0A   

work on CardRestrictionsMenuController. May need to rethink some of the updpate methods