lib/core/Session.js
function GameSession(node) {
        SessionManager.call(this);

        /**
         * ### GameSession.node
         *
         * The reference to the node object.
         */
        this.node = node;

        // Register default variables in the session.
        this.register('player', {
            set: function(p) {
                node.createPlayer(p);
            },
            get: function() {
                return node.player;
            }
        });

        this.register('game.memory', {
            set: function(value) {
                node.game.memory.clear(true);
                node.game.memory.importDB(value);
            },
            get: function() {
                return (node.game.memory) ? node.game.memory.fetch() : null;
            }
        });

        this.register('events.history', {
            set: function(value) {
                node.events.history.history.clear(true);
                node.events.history.history.importDB(value);
            },
            get: function() {
                return node.events.history ?
                    node.events.history.history.fetch() : null;
            }
        });

        this.register('stage', {
            set: function() {
                // GameSession.restoreStage
            },
            get: function() {
                return node.player.stage;
            }
        });

        this.register('node.env');
    }
function GameSession(node) {
        SessionManager.call(this);

        /**
         * ### GameSession.node
         *
         * The reference to the node object.
         */
        this.node = node;

        // Register default variables in the session.
        this.register('player', {
            set: function(p) {
                node.createPlayer(p);
            },
            get: function() {
                return node.player;
            }
        });

        this.register('game.memory', {
            set: function(value) {
                node.game.memory.clear(true);
                node.game.memory.importDB(value);
            },
            get: function() {
                return (node.game.memory) ? node.game.memory.fetch() : null;
            }
        });

        this.register('events.history', {
            set: function(value) {
                node.events.history.history.clear(true);
                node.events.history.history.importDB(value);
            },
            get: function() {
                return node.events.history ?
                    node.events.history.history.fetch() : null;
            }
        });

        this.register('stage', {
            set: function() {
                // GameSession.restoreStage
            },
            get: function() {
                return node.player.stage;
            }
        });

        this.register('node.env');
    }
function GameSession ( node ) { SessionManager . call ( this ) ; /**
         * ### GameSession.node
         *
         * The reference to the node object.
         */ this . node = node ; // Register default variables in the session. this . register ( 'player' , { set : function ( p ) { node . createPlayer ( p ) ; } , get : function ( ) { return node . player ; } } ) ; this . register ( 'game.memory' , { set : function ( value ) { node . game . memory . clear ( true ) ; node . game . memory . importDB ( value ) ; } , get : function ( ) { return ( node . game . memory ) ? node . game . memory . fetch ( ) : null ; } } ) ; this . register ( 'events.history' , { set : function ( value ) { node . events . history . history . clear ( true ) ; node . events . history . history . importDB ( value ) ; } , get : function ( ) { return node . events . history ? node . events . history . history . fetch ( ) : null ; } } ) ; this . register ( 'stage' , { set : function ( ) { // GameSession.restoreStage } , get : function ( ) { return node . player . stage ; } } ) ; this . register ( 'node.env' ) ; }
## GameSession constructor

Creates a new instance of GameSession

@param {NodeGameClient} node A reference to the node object.
## GameSession constructor