Street Dice Pt9

Today I worked on the UIController and moved all the console.log calls.

let UIController = (function() {
  const DOMSTRINGS = {};
  return {
    //Object full of functions that will become methods of the UI Controller

    displayShooter: function(currentShooter) { 
      console.log(`Player ${currentShooter+1} is shooter.`);
    },
    displayDiceResult: function(diceResult) {
      console.log("Roll Result: ", diceResult);
    },
    displayDiceTotal: function(diceTotal) {
      console.log('Dice Total: ', diceTotal);
    },
    displayPoint: function(point) {
      console.log('Point is: ', point);
    },
    displayGameResult: function(result) {
      console.log('Game Result: ', result);
    },
    displayBet: function(bet) {
      console.log('Current Bet:', bet);
    },
    displayError: function(err) {
      console.log(err);
    },
    displayBank: function(bankArray) {
      console.log(bankArray);
    },
    displayMessage: function(message) {
      console.log(message);
    }

  }
})();

I am hoping this will make it easy when I transition to the browser. But first we need to create a real game controller to try to play several round until one player goes broke.

Here is today’s coding session on youTube: