         return false
 
     showRun: =>
+        ###
+            Internal Function (used only by the code in this file)
+
+            Shows the run button.
+        ###
         jQuery('#stopRun').hide()
         jQuery('#compileAndRun').show()
         @running = false
         return
 
     gameRunFinished: ->
+        ###
+            Internal Function (used only by the code in this file)
+
+            Called when a run has finished, currently only re-displays
+            the run button.
+        ###
         @showRun()
         return
 
     helpTips:=>
+        ###
+            Event Function (passed in as a callback or bound to a button press)
+
+            Summons the help tips cloud to display the tips associated with
+            this game.
+        ###
         @environment.stats.tipsCount +=1
-        @storeStats()  
+        @storeStats()
         ma = @config?.code?.comments
         if ma
             if ma.length > 1

    log = (mesg) -> console.log(mesg)
else
    log = (mesg) -> null
        
log("GameManager log")
if not deepcopy?
    deepcopy = (src) -> $.extend(true, {},src)

class window.GameManager
    #environment is defined in codeland.startGame
    constructor: (@environment) ->
        @config = deepcopy @environment.description
        @gameStateBase = @environment.gameState


        return

    addEventListeners: ->
        ###
            Internal Function (used only by the code in this file)

            Sets up the event listeners the game manager responds to.
        ###
        jQuery('#compileAndRun').click @runStudentCode
        jQuery('#stopRun').click @stopStudentCode
        jQuery('#resetState').click @reset
