(function(){ UndoStack.register([ { type: "create-scenery", undo: function(state){ }, redo: function(state){ }, }, { type: "update-scenery", undo: function(state){ }, redo: function(state){ }, }, { type: "destroy-scenery", undo: function(state){ }, redo: function(state){ }, }, // { type: "create-room", undo: function(room){ Rooms.remove(room) Rooms.clipper.update() }, redo: function(room){ Rooms.add(room) Rooms.clipper.update() app.tube("builder-pick-room", room) }, }, { type: "update-room", undo: function(state){ var room = Rooms.list[state.id] room.rect.assign( state.rect ) room.height = state.height Rooms.clipper.update() app.tube("builder-pick-room", room) }, redo: function(state){ var room = Rooms.list[state.id] room.rect.assign( state.rect ) room.height = state.height Rooms.clipper.update() app.tube("builder-pick-room", room) }, }, { type: "destroy-room", undo: function(room){ Rooms.add(room) Rooms.clipper.update() app.tube("builder-pick-room", room) }, redo: function(room){ Rooms.remove(room) Rooms.clipper.update() }, }, // { type: "update-wallpaper", undo: function(state){ }, redo: function(state){ }, }, ]) })()