diff --git a/src/js/automaton.js b/src/js/automaton.js index c80cd85..be84da0 100644 --- a/src/js/automaton.js +++ b/src/js/automaton.js @@ -1,4 +1,4 @@ -function Automaton(async, cache, dom, messaging, screen, session, ui) { +function Automaton(async, dom, messaging, screen, session, ui) { var menus = { start: { entries: [ @@ -56,16 +56,7 @@ function Automaton(async, cache, dom, messaging, screen, session, ui) { name: 'textSpeed' } }; - var areas = new cache.make(function(key) { - messaging.send({tag: 'Load', area: key}); - return async.bind( - messaging.receive(function(message) { - return message.tag == 'Area'; - }), - function(message) { return async.wrap(message.contents); } - ); - }); - var game = session.get('game'); + var game = session.get().game; if(game != undefined) { menus.start.entries.unshift( {label: 'Continue', action: function() { messaging.send({tag: 'Resume', game: game}); }} diff --git a/src/js/main.js b/src/js/main.js index ead7a31..aa5b863 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,11 +1,11 @@ window.addEventListener('load', function() { - messaging = Messaging(); - async = Async(); - dom = Dom(); - screen = Screen(dom); - session = Session(async); - cache = Cache(async); - buttons = Buttons(session); - ui = UI(async, buttons, dom, screen, session); - automaton = Automaton(async, cache, dom, messaging, screen, session, ui); + var messaging = Messaging(); + var async = Async(); + var dom = Dom(); + var screen = Screen(dom); + var session = Session(async, messaging); + var cache = Cache(async); + var buttons = Buttons(session); + var ui = UI(async, buttons, cache, dom, messaging, screen, session); + var automaton = Automaton(async, dom, messaging, screen, session, ui); }); diff --git a/src/js/session.js b/src/js/session.js index d937f69..d24f256 100644 --- a/src/js/session.js +++ b/src/js/session.js @@ -1,4 +1,4 @@ -function Session(async) { +function Session(async, messaging) { var session = { character: JSON.parse(localStorage.getItem('character')), game: JSON.parse(localStorage.getItem('game')), diff --git a/src/js/ui.js b/src/js/ui.js index fad6fae..691069c 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -1,4 +1,4 @@ -function UI(async, buttons, dom, screen, session) { +function UI(async, buttons, cache, dom, messaging, screen, session) { var lineWidth = 36; var textSpeeds = { slow: 100,