= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":7936},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7935":{"this":{"__isSmartRef__":true,"id":7730}},"7936":{"timestamp":{"__isSmartRef__":true,"id":7937},"user":"jan.sandbrink","tags":[]},"7937":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"7938":{"varMapping":{"__isSmartRef__":true,"id":7939},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":7940},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7939":{"this":{"__isSmartRef__":true,"id":7730}},"7940":{"timestamp":{"__isSmartRef__":true,"id":7941},"user":"jan.sandbrink","tags":[]},"7941":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"7942":{"varMapping":{"__isSmartRef__":true,"id":7943},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":7944},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7943":{"this":{"__isSmartRef__":true,"id":7730}},"7944":{"timestamp":{"__isSmartRef__":true,"id":7945},"user":"josi","tags":["gemtypes"]},"7945":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"7946":{"varMapping":{"__isSmartRef__":true,"id":7947},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":7948},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7947":{"this":{"__isSmartRef__":true,"id":7730}},"7948":{"timestamp":{"__isSmartRef__":true,"id":7949},"user":"josi","tags":["gemtypes"]},"7949":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"7950":{"varMapping":{"__isSmartRef__":true,"id":7951},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":7952},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7951":{"this":{"__isSmartRef__":true,"id":7730}},"7952":{"timestamp":{"__isSmartRef__":true,"id":7953},"user":"soergel","tags":["debug"]},"7953":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"7954":{"varMapping":{"__isSmartRef__":true,"id":7955},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":7956},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7955":{"this":{"__isSmartRef__":true,"id":7730}},"7956":{"timestamp":{"__isSmartRef__":true,"id":7957},"user":"soergel","tags":["debug"]},"7957":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"7958":{"varMapping":{"__isSmartRef__":true,"id":7959},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":7960},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7959":{"this":{"__isSmartRef__":true,"id":7730}},"7960":{"timestamp":{"__isSmartRef__":true,"id":7961},"user":"josi","tags":["gemtypes"]},"7961":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"7962":{"varMapping":{"__isSmartRef__":true,"id":7963},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":7964},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7963":{"this":{"__isSmartRef__":true,"id":7730}},"7964":{"timestamp":{"__isSmartRef__":true,"id":7965},"user":"soergel","tags":[]},"7965":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"7966":{"varMapping":{"__isSmartRef__":true,"id":7967},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":7968},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7967":{"this":{"__isSmartRef__":true,"id":7730}},"7968":{"timestamp":{"__isSmartRef__":true,"id":7969},"user":"soergel","tags":[]},"7969":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"7970":{"varMapping":{"__isSmartRef__":true,"id":7971},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":7972},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7971":{"this":{"__isSmartRef__":true,"id":7730}},"7972":{"timestamp":{"__isSmartRef__":true,"id":7973},"user":"soergel","tags":[]},"7973":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"7974":{"varMapping":{"__isSmartRef__":true,"id":7975},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":7976},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7975":{"this":{"__isSmartRef__":true,"id":7730}},"7976":{"timestamp":{"__isSmartRef__":true,"id":7977},"user":"josi","tags":["gemtypes"]},"7977":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"7978":{"varMapping":{"__isSmartRef__":true,"id":7979},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":7980},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7979":{"this":{"__isSmartRef__":true,"id":7730}},"7980":{"timestamp":{"__isSmartRef__":true,"id":7981},"user":"josi","tags":["gemtypes"]},"7981":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"7982":{"varMapping":{"__isSmartRef__":true,"id":7983},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":7984},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7983":{"this":{"__isSmartRef__":true,"id":7730}},"7984":{"timestamp":{"__isSmartRef__":true,"id":7985},"user":"jan.sandbrink","tags":[]},"7985":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"7986":{"become":{"__isSmartRef__":true,"id":7987},"onMouseDown":{"__isSmartRef__":true,"id":7991},"updatePicture":{"__isSmartRef__":true,"id":7999},"ruby":{"__isSmartRef__":true,"id":8003},"switchPositionWith":{"__isSmartRef__":true,"id":8007},"addNeighbour":{"__isSmartRef__":true,"id":8011},"amethyst":{"__isSmartRef__":true,"id":8015},"diopside":{"__isSmartRef__":true,"id":8019},"gemTypes":{"__isSmartRef__":true,"id":8023},"becomeRandomGem":{"__isSmartRef__":true,"id":8027},"mark":{"__isSmartRef__":true,"id":8031},"unmark":{"__isSmartRef__":true,"id":8035},"hasNeighbour":{"__isSmartRef__":true,"id":8039},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8043},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8047},"disappear":{"__isSmartRef__":true,"id":8051},"findStreakStart":{"__isSmartRef__":true,"id":8055},"buildStreak":{"__isSmartRef__":true,"id":8059},"scoreStreak":{"__isSmartRef__":true,"id":8063},"tryToStreak":{"__isSmartRef__":true,"id":8067},"blueDiamond":{"__isSmartRef__":true,"id":8071},"prehnite":{"__isSmartRef__":true,"id":8075},"debugUnmark":{"__isSmartRef__":true,"id":8079},"debugMark":{"__isSmartRef__":true,"id":8083},"citrine":{"__isSmartRef__":true,"id":8087},"move":{"__isSmartRef__":true,"id":8091},"performMovement":{"__isSmartRef__":true,"id":8095},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8099},"zircon":{"__isSmartRef__":true,"id":8103},"emerald":{"__isSmartRef__":true,"id":8107},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8111}},"7987":{"varMapping":{"__isSmartRef__":true,"id":7988},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":7989},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7988":{"this":{"__isSmartRef__":true,"id":7603}},"7989":{"timestamp":{"__isSmartRef__":true,"id":7990},"user":"josi","tags":[]},"7990":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"7991":{"varMapping":{"__isSmartRef__":true,"id":7992},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":7997},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7992":{"this":{"__isSmartRef__":true,"id":7603},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":7993}},"7993":{"$super":{"__isSmartRef__":true,"id":7994}},"7994":{"varMapping":{"__isSmartRef__":true,"id":7995},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":7996},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"7995":{"obj":{"__isSmartRef__":true,"id":7603},"name":"onMouseDown"},"7996":{},"7997":{"timestamp":{"__isSmartRef__":true,"id":7998},"user":"soergel","tags":[]},"7998":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"7999":{"varMapping":{"__isSmartRef__":true,"id":8000},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8001},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8000":{"this":{"__isSmartRef__":true,"id":7603}},"8001":{"timestamp":{"__isSmartRef__":true,"id":8002},"user":"soergel","tags":[]},"8002":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8003":{"varMapping":{"__isSmartRef__":true,"id":8004},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8005},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8004":{"this":{"__isSmartRef__":true,"id":7603}},"8005":{"timestamp":{"__isSmartRef__":true,"id":8006},"user":"josi","tags":["gemtypes"]},"8006":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8007":{"varMapping":{"__isSmartRef__":true,"id":8008},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8009},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8008":{"this":{"__isSmartRef__":true,"id":7603}},"8009":{"timestamp":{"__isSmartRef__":true,"id":8010},"user":"jan.sandbrink","tags":[]},"8010":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8011":{"varMapping":{"__isSmartRef__":true,"id":8012},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8013},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8012":{"this":{"__isSmartRef__":true,"id":7603}},"8013":{"timestamp":{"__isSmartRef__":true,"id":8014},"user":"jan.sandbrink","tags":[]},"8014":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8015":{"varMapping":{"__isSmartRef__":true,"id":8016},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8017},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8016":{"this":{"__isSmartRef__":true,"id":7603}},"8017":{"timestamp":{"__isSmartRef__":true,"id":8018},"user":"josi","tags":["gemtypes"]},"8018":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8019":{"varMapping":{"__isSmartRef__":true,"id":8020},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8021},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8020":{"this":{"__isSmartRef__":true,"id":7603}},"8021":{"timestamp":{"__isSmartRef__":true,"id":8022},"user":"josi","tags":["gemtypes"]},"8022":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8023":{"varMapping":{"__isSmartRef__":true,"id":8024},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8025},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8024":{"this":{"__isSmartRef__":true,"id":7603}},"8025":{"timestamp":{"__isSmartRef__":true,"id":8026},"user":"josi","tags":[]},"8026":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8027":{"varMapping":{"__isSmartRef__":true,"id":8028},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8029},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8028":{"this":{"__isSmartRef__":true,"id":7603}},"8029":{"timestamp":{"__isSmartRef__":true,"id":8030},"user":"josi","tags":[]},"8030":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8031":{"varMapping":{"__isSmartRef__":true,"id":8032},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8033},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8032":{"this":{"__isSmartRef__":true,"id":7603}},"8033":{"timestamp":{"__isSmartRef__":true,"id":8034},"user":"soergel","tags":[]},"8034":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8035":{"varMapping":{"__isSmartRef__":true,"id":8036},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8037},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8036":{"this":{"__isSmartRef__":true,"id":7603}},"8037":{"timestamp":{"__isSmartRef__":true,"id":8038},"user":"soergel","tags":[]},"8038":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8039":{"varMapping":{"__isSmartRef__":true,"id":8040},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8041},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8040":{"this":{"__isSmartRef__":true,"id":7603}},"8041":{"timestamp":{"__isSmartRef__":true,"id":8042},"user":"soergel","tags":[]},"8042":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8043":{"varMapping":{"__isSmartRef__":true,"id":8044},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8045},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8044":{"this":{"__isSmartRef__":true,"id":7603}},"8045":{"timestamp":{"__isSmartRef__":true,"id":8046},"user":"soergel","tags":["debug"]},"8046":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8047":{"varMapping":{"__isSmartRef__":true,"id":8048},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8049},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8048":{"this":{"__isSmartRef__":true,"id":7603}},"8049":{"timestamp":{"__isSmartRef__":true,"id":8050},"user":"soergel","tags":["debug"]},"8050":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8051":{"varMapping":{"__isSmartRef__":true,"id":8052},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8053},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8052":{"this":{"__isSmartRef__":true,"id":7603}},"8053":{"timestamp":{"__isSmartRef__":true,"id":8054},"user":"jan.sandbrink","tags":[]},"8054":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8055":{"varMapping":{"__isSmartRef__":true,"id":8056},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8057},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8056":{"this":{"__isSmartRef__":true,"id":7603}},"8057":{"timestamp":{"__isSmartRef__":true,"id":8058},"user":"jan.sandbrink","tags":[]},"8058":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8059":{"varMapping":{"__isSmartRef__":true,"id":8060},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8061},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8060":{"this":{"__isSmartRef__":true,"id":7603}},"8061":{"timestamp":{"__isSmartRef__":true,"id":8062},"user":"jan.sandbrink","tags":[]},"8062":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8063":{"varMapping":{"__isSmartRef__":true,"id":8064},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8065},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8064":{"this":{"__isSmartRef__":true,"id":7603}},"8065":{"timestamp":{"__isSmartRef__":true,"id":8066},"user":"jan.sandbrink","tags":[]},"8066":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8067":{"varMapping":{"__isSmartRef__":true,"id":8068},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8069},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8068":{"this":{"__isSmartRef__":true,"id":7603}},"8069":{"timestamp":{"__isSmartRef__":true,"id":8070},"user":"jan.sandbrink","tags":[]},"8070":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8071":{"varMapping":{"__isSmartRef__":true,"id":8072},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8073},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8072":{"this":{"__isSmartRef__":true,"id":7603}},"8073":{"timestamp":{"__isSmartRef__":true,"id":8074},"user":"josi","tags":["gemtypes"]},"8074":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8075":{"varMapping":{"__isSmartRef__":true,"id":8076},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8077},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8076":{"this":{"__isSmartRef__":true,"id":7603}},"8077":{"timestamp":{"__isSmartRef__":true,"id":8078},"user":"josi","tags":["gemtypes"]},"8078":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8079":{"varMapping":{"__isSmartRef__":true,"id":8080},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8081},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8080":{"this":{"__isSmartRef__":true,"id":7603}},"8081":{"timestamp":{"__isSmartRef__":true,"id":8082},"user":"soergel","tags":["debug"]},"8082":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8083":{"varMapping":{"__isSmartRef__":true,"id":8084},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8085},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8084":{"this":{"__isSmartRef__":true,"id":7603}},"8085":{"timestamp":{"__isSmartRef__":true,"id":8086},"user":"soergel","tags":["debug"]},"8086":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8087":{"varMapping":{"__isSmartRef__":true,"id":8088},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8089},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8088":{"this":{"__isSmartRef__":true,"id":7603}},"8089":{"timestamp":{"__isSmartRef__":true,"id":8090},"user":"josi","tags":["gemtypes"]},"8090":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8091":{"varMapping":{"__isSmartRef__":true,"id":8092},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8093},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8092":{"this":{"__isSmartRef__":true,"id":7603}},"8093":{"timestamp":{"__isSmartRef__":true,"id":8094},"user":"soergel","tags":[]},"8094":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8095":{"varMapping":{"__isSmartRef__":true,"id":8096},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8097},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8096":{"this":{"__isSmartRef__":true,"id":7603}},"8097":{"timestamp":{"__isSmartRef__":true,"id":8098},"user":"soergel","tags":[]},"8098":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8099":{"varMapping":{"__isSmartRef__":true,"id":8100},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8101},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8100":{"this":{"__isSmartRef__":true,"id":7603}},"8101":{"timestamp":{"__isSmartRef__":true,"id":8102},"user":"soergel","tags":[]},"8102":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8103":{"varMapping":{"__isSmartRef__":true,"id":8104},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8105},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8104":{"this":{"__isSmartRef__":true,"id":7603}},"8105":{"timestamp":{"__isSmartRef__":true,"id":8106},"user":"josi","tags":["gemtypes"]},"8106":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8107":{"varMapping":{"__isSmartRef__":true,"id":8108},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8109},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8108":{"this":{"__isSmartRef__":true,"id":7603}},"8109":{"timestamp":{"__isSmartRef__":true,"id":8110},"user":"josi","tags":["gemtypes"]},"8110":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8111":{"varMapping":{"__isSmartRef__":true,"id":8112},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8113},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8112":{"this":{"__isSmartRef__":true,"id":7603}},"8113":{"timestamp":{"__isSmartRef__":true,"id":8114},"user":"jan.sandbrink","tags":[]},"8114":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8115":{"become":{"__isSmartRef__":true,"id":8116},"onMouseDown":{"__isSmartRef__":true,"id":8120},"updatePicture":{"__isSmartRef__":true,"id":8128},"ruby":{"__isSmartRef__":true,"id":8132},"switchPositionWith":{"__isSmartRef__":true,"id":8136},"addNeighbour":{"__isSmartRef__":true,"id":8140},"amethyst":{"__isSmartRef__":true,"id":8144},"diopside":{"__isSmartRef__":true,"id":8148},"gemTypes":{"__isSmartRef__":true,"id":8152},"becomeRandomGem":{"__isSmartRef__":true,"id":8156},"mark":{"__isSmartRef__":true,"id":8160},"unmark":{"__isSmartRef__":true,"id":8164},"hasNeighbour":{"__isSmartRef__":true,"id":8168},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8172},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8176},"disappear":{"__isSmartRef__":true,"id":8180},"findStreakStart":{"__isSmartRef__":true,"id":8184},"buildStreak":{"__isSmartRef__":true,"id":8188},"scoreStreak":{"__isSmartRef__":true,"id":8192},"tryToStreak":{"__isSmartRef__":true,"id":8196},"blueDiamond":{"__isSmartRef__":true,"id":8200},"prehnite":{"__isSmartRef__":true,"id":8204},"debugUnmark":{"__isSmartRef__":true,"id":8208},"debugMark":{"__isSmartRef__":true,"id":8212},"citrine":{"__isSmartRef__":true,"id":8216},"move":{"__isSmartRef__":true,"id":8220},"performMovement":{"__isSmartRef__":true,"id":8224},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8228},"zircon":{"__isSmartRef__":true,"id":8232},"emerald":{"__isSmartRef__":true,"id":8236},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8240}},"8116":{"varMapping":{"__isSmartRef__":true,"id":8117},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8118},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8117":{"this":{"__isSmartRef__":true,"id":7485}},"8118":{"timestamp":{"__isSmartRef__":true,"id":8119},"user":"josi","tags":[]},"8119":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8120":{"varMapping":{"__isSmartRef__":true,"id":8121},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8126},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8121":{"this":{"__isSmartRef__":true,"id":7485},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8122}},"8122":{"$super":{"__isSmartRef__":true,"id":8123}},"8123":{"varMapping":{"__isSmartRef__":true,"id":8124},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8125},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8124":{"obj":{"__isSmartRef__":true,"id":7485},"name":"onMouseDown"},"8125":{},"8126":{"timestamp":{"__isSmartRef__":true,"id":8127},"user":"soergel","tags":[]},"8127":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8128":{"varMapping":{"__isSmartRef__":true,"id":8129},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8130},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8129":{"this":{"__isSmartRef__":true,"id":7485}},"8130":{"timestamp":{"__isSmartRef__":true,"id":8131},"user":"soergel","tags":[]},"8131":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8132":{"varMapping":{"__isSmartRef__":true,"id":8133},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8134},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8133":{"this":{"__isSmartRef__":true,"id":7485}},"8134":{"timestamp":{"__isSmartRef__":true,"id":8135},"user":"josi","tags":["gemtypes"]},"8135":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8136":{"varMapping":{"__isSmartRef__":true,"id":8137},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8138},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8137":{"this":{"__isSmartRef__":true,"id":7485}},"8138":{"timestamp":{"__isSmartRef__":true,"id":8139},"user":"jan.sandbrink","tags":[]},"8139":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8140":{"varMapping":{"__isSmartRef__":true,"id":8141},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8142},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8141":{"this":{"__isSmartRef__":true,"id":7485}},"8142":{"timestamp":{"__isSmartRef__":true,"id":8143},"user":"jan.sandbrink","tags":[]},"8143":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8144":{"varMapping":{"__isSmartRef__":true,"id":8145},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8146},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8145":{"this":{"__isSmartRef__":true,"id":7485}},"8146":{"timestamp":{"__isSmartRef__":true,"id":8147},"user":"josi","tags":["gemtypes"]},"8147":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8148":{"varMapping":{"__isSmartRef__":true,"id":8149},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8150},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8149":{"this":{"__isSmartRef__":true,"id":7485}},"8150":{"timestamp":{"__isSmartRef__":true,"id":8151},"user":"josi","tags":["gemtypes"]},"8151":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8152":{"varMapping":{"__isSmartRef__":true,"id":8153},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8154},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8153":{"this":{"__isSmartRef__":true,"id":7485}},"8154":{"timestamp":{"__isSmartRef__":true,"id":8155},"user":"josi","tags":[]},"8155":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8156":{"varMapping":{"__isSmartRef__":true,"id":8157},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8158},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8157":{"this":{"__isSmartRef__":true,"id":7485}},"8158":{"timestamp":{"__isSmartRef__":true,"id":8159},"user":"josi","tags":[]},"8159":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8160":{"varMapping":{"__isSmartRef__":true,"id":8161},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8162},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8161":{"this":{"__isSmartRef__":true,"id":7485}},"8162":{"timestamp":{"__isSmartRef__":true,"id":8163},"user":"soergel","tags":[]},"8163":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8164":{"varMapping":{"__isSmartRef__":true,"id":8165},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8166},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8165":{"this":{"__isSmartRef__":true,"id":7485}},"8166":{"timestamp":{"__isSmartRef__":true,"id":8167},"user":"soergel","tags":[]},"8167":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8168":{"varMapping":{"__isSmartRef__":true,"id":8169},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8170},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8169":{"this":{"__isSmartRef__":true,"id":7485}},"8170":{"timestamp":{"__isSmartRef__":true,"id":8171},"user":"soergel","tags":[]},"8171":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8172":{"varMapping":{"__isSmartRef__":true,"id":8173},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8174},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8173":{"this":{"__isSmartRef__":true,"id":7485}},"8174":{"timestamp":{"__isSmartRef__":true,"id":8175},"user":"soergel","tags":["debug"]},"8175":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8176":{"varMapping":{"__isSmartRef__":true,"id":8177},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8178},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8177":{"this":{"__isSmartRef__":true,"id":7485}},"8178":{"timestamp":{"__isSmartRef__":true,"id":8179},"user":"soergel","tags":["debug"]},"8179":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8180":{"varMapping":{"__isSmartRef__":true,"id":8181},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8182},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8181":{"this":{"__isSmartRef__":true,"id":7485}},"8182":{"timestamp":{"__isSmartRef__":true,"id":8183},"user":"jan.sandbrink","tags":[]},"8183":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8184":{"varMapping":{"__isSmartRef__":true,"id":8185},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8186},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8185":{"this":{"__isSmartRef__":true,"id":7485}},"8186":{"timestamp":{"__isSmartRef__":true,"id":8187},"user":"jan.sandbrink","tags":[]},"8187":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8188":{"varMapping":{"__isSmartRef__":true,"id":8189},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8190},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8189":{"this":{"__isSmartRef__":true,"id":7485}},"8190":{"timestamp":{"__isSmartRef__":true,"id":8191},"user":"jan.sandbrink","tags":[]},"8191":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8192":{"varMapping":{"__isSmartRef__":true,"id":8193},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8194},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8193":{"this":{"__isSmartRef__":true,"id":7485}},"8194":{"timestamp":{"__isSmartRef__":true,"id":8195},"user":"jan.sandbrink","tags":[]},"8195":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8196":{"varMapping":{"__isSmartRef__":true,"id":8197},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8198},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8197":{"this":{"__isSmartRef__":true,"id":7485}},"8198":{"timestamp":{"__isSmartRef__":true,"id":8199},"user":"jan.sandbrink","tags":[]},"8199":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8200":{"varMapping":{"__isSmartRef__":true,"id":8201},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8202},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8201":{"this":{"__isSmartRef__":true,"id":7485}},"8202":{"timestamp":{"__isSmartRef__":true,"id":8203},"user":"josi","tags":["gemtypes"]},"8203":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8204":{"varMapping":{"__isSmartRef__":true,"id":8205},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8206},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8205":{"this":{"__isSmartRef__":true,"id":7485}},"8206":{"timestamp":{"__isSmartRef__":true,"id":8207},"user":"josi","tags":["gemtypes"]},"8207":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8208":{"varMapping":{"__isSmartRef__":true,"id":8209},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8210},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8209":{"this":{"__isSmartRef__":true,"id":7485}},"8210":{"timestamp":{"__isSmartRef__":true,"id":8211},"user":"soergel","tags":["debug"]},"8211":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8212":{"varMapping":{"__isSmartRef__":true,"id":8213},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8214},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8213":{"this":{"__isSmartRef__":true,"id":7485}},"8214":{"timestamp":{"__isSmartRef__":true,"id":8215},"user":"soergel","tags":["debug"]},"8215":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8216":{"varMapping":{"__isSmartRef__":true,"id":8217},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8218},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8217":{"this":{"__isSmartRef__":true,"id":7485}},"8218":{"timestamp":{"__isSmartRef__":true,"id":8219},"user":"josi","tags":["gemtypes"]},"8219":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8220":{"varMapping":{"__isSmartRef__":true,"id":8221},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8222},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8221":{"this":{"__isSmartRef__":true,"id":7485}},"8222":{"timestamp":{"__isSmartRef__":true,"id":8223},"user":"soergel","tags":[]},"8223":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8224":{"varMapping":{"__isSmartRef__":true,"id":8225},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8226},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8225":{"this":{"__isSmartRef__":true,"id":7485}},"8226":{"timestamp":{"__isSmartRef__":true,"id":8227},"user":"soergel","tags":[]},"8227":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8228":{"varMapping":{"__isSmartRef__":true,"id":8229},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8230},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8229":{"this":{"__isSmartRef__":true,"id":7485}},"8230":{"timestamp":{"__isSmartRef__":true,"id":8231},"user":"soergel","tags":[]},"8231":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8232":{"varMapping":{"__isSmartRef__":true,"id":8233},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8234},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8233":{"this":{"__isSmartRef__":true,"id":7485}},"8234":{"timestamp":{"__isSmartRef__":true,"id":8235},"user":"josi","tags":["gemtypes"]},"8235":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8236":{"varMapping":{"__isSmartRef__":true,"id":8237},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8238},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8237":{"this":{"__isSmartRef__":true,"id":7485}},"8238":{"timestamp":{"__isSmartRef__":true,"id":8239},"user":"josi","tags":["gemtypes"]},"8239":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8240":{"varMapping":{"__isSmartRef__":true,"id":8241},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8242},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8241":{"this":{"__isSmartRef__":true,"id":7485}},"8242":{"timestamp":{"__isSmartRef__":true,"id":8243},"user":"jan.sandbrink","tags":[]},"8243":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8244":{"become":{"__isSmartRef__":true,"id":8245},"onMouseDown":{"__isSmartRef__":true,"id":8249},"updatePicture":{"__isSmartRef__":true,"id":8257},"ruby":{"__isSmartRef__":true,"id":8261},"switchPositionWith":{"__isSmartRef__":true,"id":8265},"addNeighbour":{"__isSmartRef__":true,"id":8269},"amethyst":{"__isSmartRef__":true,"id":8273},"diopside":{"__isSmartRef__":true,"id":8277},"gemTypes":{"__isSmartRef__":true,"id":8281},"becomeRandomGem":{"__isSmartRef__":true,"id":8285},"mark":{"__isSmartRef__":true,"id":8289},"unmark":{"__isSmartRef__":true,"id":8293},"hasNeighbour":{"__isSmartRef__":true,"id":8297},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8301},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8305},"disappear":{"__isSmartRef__":true,"id":8309},"findStreakStart":{"__isSmartRef__":true,"id":8313},"buildStreak":{"__isSmartRef__":true,"id":8317},"scoreStreak":{"__isSmartRef__":true,"id":8321},"tryToStreak":{"__isSmartRef__":true,"id":8325},"blueDiamond":{"__isSmartRef__":true,"id":8329},"prehnite":{"__isSmartRef__":true,"id":8333},"debugUnmark":{"__isSmartRef__":true,"id":8337},"debugMark":{"__isSmartRef__":true,"id":8341},"citrine":{"__isSmartRef__":true,"id":8345},"move":{"__isSmartRef__":true,"id":8349},"performMovement":{"__isSmartRef__":true,"id":8353},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8357},"zircon":{"__isSmartRef__":true,"id":8361},"emerald":{"__isSmartRef__":true,"id":8365},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8369}},"8245":{"varMapping":{"__isSmartRef__":true,"id":8246},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8247},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8246":{"this":{"__isSmartRef__":true,"id":7353}},"8247":{"timestamp":{"__isSmartRef__":true,"id":8248},"user":"josi","tags":[]},"8248":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8249":{"varMapping":{"__isSmartRef__":true,"id":8250},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8255},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8250":{"this":{"__isSmartRef__":true,"id":7353},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8251}},"8251":{"$super":{"__isSmartRef__":true,"id":8252}},"8252":{"varMapping":{"__isSmartRef__":true,"id":8253},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8254},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8253":{"obj":{"__isSmartRef__":true,"id":7353},"name":"onMouseDown"},"8254":{},"8255":{"timestamp":{"__isSmartRef__":true,"id":8256},"user":"soergel","tags":[]},"8256":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8257":{"varMapping":{"__isSmartRef__":true,"id":8258},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8259},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8258":{"this":{"__isSmartRef__":true,"id":7353}},"8259":{"timestamp":{"__isSmartRef__":true,"id":8260},"user":"soergel","tags":[]},"8260":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8261":{"varMapping":{"__isSmartRef__":true,"id":8262},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8263},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8262":{"this":{"__isSmartRef__":true,"id":7353}},"8263":{"timestamp":{"__isSmartRef__":true,"id":8264},"user":"josi","tags":["gemtypes"]},"8264":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8265":{"varMapping":{"__isSmartRef__":true,"id":8266},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8267},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8266":{"this":{"__isSmartRef__":true,"id":7353}},"8267":{"timestamp":{"__isSmartRef__":true,"id":8268},"user":"jan.sandbrink","tags":[]},"8268":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8269":{"varMapping":{"__isSmartRef__":true,"id":8270},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8271},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8270":{"this":{"__isSmartRef__":true,"id":7353}},"8271":{"timestamp":{"__isSmartRef__":true,"id":8272},"user":"jan.sandbrink","tags":[]},"8272":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8273":{"varMapping":{"__isSmartRef__":true,"id":8274},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8275},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8274":{"this":{"__isSmartRef__":true,"id":7353}},"8275":{"timestamp":{"__isSmartRef__":true,"id":8276},"user":"josi","tags":["gemtypes"]},"8276":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8277":{"varMapping":{"__isSmartRef__":true,"id":8278},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8279},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8278":{"this":{"__isSmartRef__":true,"id":7353}},"8279":{"timestamp":{"__isSmartRef__":true,"id":8280},"user":"josi","tags":["gemtypes"]},"8280":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8281":{"varMapping":{"__isSmartRef__":true,"id":8282},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8283},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8282":{"this":{"__isSmartRef__":true,"id":7353}},"8283":{"timestamp":{"__isSmartRef__":true,"id":8284},"user":"josi","tags":[]},"8284":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8285":{"varMapping":{"__isSmartRef__":true,"id":8286},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8287},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8286":{"this":{"__isSmartRef__":true,"id":7353}},"8287":{"timestamp":{"__isSmartRef__":true,"id":8288},"user":"josi","tags":[]},"8288":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8289":{"varMapping":{"__isSmartRef__":true,"id":8290},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8291},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8290":{"this":{"__isSmartRef__":true,"id":7353}},"8291":{"timestamp":{"__isSmartRef__":true,"id":8292},"user":"soergel","tags":[]},"8292":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8293":{"varMapping":{"__isSmartRef__":true,"id":8294},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8295},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8294":{"this":{"__isSmartRef__":true,"id":7353}},"8295":{"timestamp":{"__isSmartRef__":true,"id":8296},"user":"soergel","tags":[]},"8296":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8297":{"varMapping":{"__isSmartRef__":true,"id":8298},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8299},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8298":{"this":{"__isSmartRef__":true,"id":7353}},"8299":{"timestamp":{"__isSmartRef__":true,"id":8300},"user":"soergel","tags":[]},"8300":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8301":{"varMapping":{"__isSmartRef__":true,"id":8302},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8303},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8302":{"this":{"__isSmartRef__":true,"id":7353}},"8303":{"timestamp":{"__isSmartRef__":true,"id":8304},"user":"soergel","tags":["debug"]},"8304":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8305":{"varMapping":{"__isSmartRef__":true,"id":8306},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8307},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8306":{"this":{"__isSmartRef__":true,"id":7353}},"8307":{"timestamp":{"__isSmartRef__":true,"id":8308},"user":"soergel","tags":["debug"]},"8308":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8309":{"varMapping":{"__isSmartRef__":true,"id":8310},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8311},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8310":{"this":{"__isSmartRef__":true,"id":7353}},"8311":{"timestamp":{"__isSmartRef__":true,"id":8312},"user":"jan.sandbrink","tags":[]},"8312":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8313":{"varMapping":{"__isSmartRef__":true,"id":8314},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8315},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8314":{"this":{"__isSmartRef__":true,"id":7353}},"8315":{"timestamp":{"__isSmartRef__":true,"id":8316},"user":"jan.sandbrink","tags":[]},"8316":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8317":{"varMapping":{"__isSmartRef__":true,"id":8318},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8319},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8318":{"this":{"__isSmartRef__":true,"id":7353}},"8319":{"timestamp":{"__isSmartRef__":true,"id":8320},"user":"jan.sandbrink","tags":[]},"8320":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8321":{"varMapping":{"__isSmartRef__":true,"id":8322},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8323},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8322":{"this":{"__isSmartRef__":true,"id":7353}},"8323":{"timestamp":{"__isSmartRef__":true,"id":8324},"user":"jan.sandbrink","tags":[]},"8324":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8325":{"varMapping":{"__isSmartRef__":true,"id":8326},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8327},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8326":{"this":{"__isSmartRef__":true,"id":7353}},"8327":{"timestamp":{"__isSmartRef__":true,"id":8328},"user":"jan.sandbrink","tags":[]},"8328":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8329":{"varMapping":{"__isSmartRef__":true,"id":8330},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8331},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8330":{"this":{"__isSmartRef__":true,"id":7353}},"8331":{"timestamp":{"__isSmartRef__":true,"id":8332},"user":"josi","tags":["gemtypes"]},"8332":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8333":{"varMapping":{"__isSmartRef__":true,"id":8334},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8335},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8334":{"this":{"__isSmartRef__":true,"id":7353}},"8335":{"timestamp":{"__isSmartRef__":true,"id":8336},"user":"josi","tags":["gemtypes"]},"8336":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8337":{"varMapping":{"__isSmartRef__":true,"id":8338},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8339},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8338":{"this":{"__isSmartRef__":true,"id":7353}},"8339":{"timestamp":{"__isSmartRef__":true,"id":8340},"user":"soergel","tags":["debug"]},"8340":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8341":{"varMapping":{"__isSmartRef__":true,"id":8342},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8343},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8342":{"this":{"__isSmartRef__":true,"id":7353}},"8343":{"timestamp":{"__isSmartRef__":true,"id":8344},"user":"soergel","tags":["debug"]},"8344":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8345":{"varMapping":{"__isSmartRef__":true,"id":8346},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8347},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8346":{"this":{"__isSmartRef__":true,"id":7353}},"8347":{"timestamp":{"__isSmartRef__":true,"id":8348},"user":"josi","tags":["gemtypes"]},"8348":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8349":{"varMapping":{"__isSmartRef__":true,"id":8350},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8351},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8350":{"this":{"__isSmartRef__":true,"id":7353}},"8351":{"timestamp":{"__isSmartRef__":true,"id":8352},"user":"soergel","tags":[]},"8352":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8353":{"varMapping":{"__isSmartRef__":true,"id":8354},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8355},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8354":{"this":{"__isSmartRef__":true,"id":7353}},"8355":{"timestamp":{"__isSmartRef__":true,"id":8356},"user":"soergel","tags":[]},"8356":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8357":{"varMapping":{"__isSmartRef__":true,"id":8358},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8359},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8358":{"this":{"__isSmartRef__":true,"id":7353}},"8359":{"timestamp":{"__isSmartRef__":true,"id":8360},"user":"soergel","tags":[]},"8360":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8361":{"varMapping":{"__isSmartRef__":true,"id":8362},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8363},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8362":{"this":{"__isSmartRef__":true,"id":7353}},"8363":{"timestamp":{"__isSmartRef__":true,"id":8364},"user":"josi","tags":["gemtypes"]},"8364":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8365":{"varMapping":{"__isSmartRef__":true,"id":8366},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8367},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8366":{"this":{"__isSmartRef__":true,"id":7353}},"8367":{"timestamp":{"__isSmartRef__":true,"id":8368},"user":"josi","tags":["gemtypes"]},"8368":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8369":{"varMapping":{"__isSmartRef__":true,"id":8370},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8371},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8370":{"this":{"__isSmartRef__":true,"id":7353}},"8371":{"timestamp":{"__isSmartRef__":true,"id":8372},"user":"jan.sandbrink","tags":[]},"8372":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8373":{"become":{"__isSmartRef__":true,"id":8374},"onMouseDown":{"__isSmartRef__":true,"id":8378},"updatePicture":{"__isSmartRef__":true,"id":8386},"ruby":{"__isSmartRef__":true,"id":8390},"switchPositionWith":{"__isSmartRef__":true,"id":8394},"addNeighbour":{"__isSmartRef__":true,"id":8398},"amethyst":{"__isSmartRef__":true,"id":8402},"diopside":{"__isSmartRef__":true,"id":8406},"gemTypes":{"__isSmartRef__":true,"id":8410},"becomeRandomGem":{"__isSmartRef__":true,"id":8414},"mark":{"__isSmartRef__":true,"id":8418},"unmark":{"__isSmartRef__":true,"id":8422},"hasNeighbour":{"__isSmartRef__":true,"id":8426},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8430},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8434},"disappear":{"__isSmartRef__":true,"id":8438},"findStreakStart":{"__isSmartRef__":true,"id":8442},"buildStreak":{"__isSmartRef__":true,"id":8446},"scoreStreak":{"__isSmartRef__":true,"id":8450},"tryToStreak":{"__isSmartRef__":true,"id":8454},"blueDiamond":{"__isSmartRef__":true,"id":8458},"prehnite":{"__isSmartRef__":true,"id":8462},"debugUnmark":{"__isSmartRef__":true,"id":8466},"debugMark":{"__isSmartRef__":true,"id":8470},"citrine":{"__isSmartRef__":true,"id":8474},"move":{"__isSmartRef__":true,"id":8478},"performMovement":{"__isSmartRef__":true,"id":8482},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8486},"zircon":{"__isSmartRef__":true,"id":8490},"emerald":{"__isSmartRef__":true,"id":8494},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8498}},"8374":{"varMapping":{"__isSmartRef__":true,"id":8375},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8376},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8375":{"this":{"__isSmartRef__":true,"id":7221}},"8376":{"timestamp":{"__isSmartRef__":true,"id":8377},"user":"josi","tags":[]},"8377":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8378":{"varMapping":{"__isSmartRef__":true,"id":8379},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8384},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8379":{"this":{"__isSmartRef__":true,"id":7221},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8380}},"8380":{"$super":{"__isSmartRef__":true,"id":8381}},"8381":{"varMapping":{"__isSmartRef__":true,"id":8382},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8383},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8382":{"obj":{"__isSmartRef__":true,"id":7221},"name":"onMouseDown"},"8383":{},"8384":{"timestamp":{"__isSmartRef__":true,"id":8385},"user":"soergel","tags":[]},"8385":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8386":{"varMapping":{"__isSmartRef__":true,"id":8387},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8388},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8387":{"this":{"__isSmartRef__":true,"id":7221}},"8388":{"timestamp":{"__isSmartRef__":true,"id":8389},"user":"soergel","tags":[]},"8389":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8390":{"varMapping":{"__isSmartRef__":true,"id":8391},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8392},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8391":{"this":{"__isSmartRef__":true,"id":7221}},"8392":{"timestamp":{"__isSmartRef__":true,"id":8393},"user":"josi","tags":["gemtypes"]},"8393":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8394":{"varMapping":{"__isSmartRef__":true,"id":8395},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8396},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8395":{"this":{"__isSmartRef__":true,"id":7221}},"8396":{"timestamp":{"__isSmartRef__":true,"id":8397},"user":"jan.sandbrink","tags":[]},"8397":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8398":{"varMapping":{"__isSmartRef__":true,"id":8399},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8400},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8399":{"this":{"__isSmartRef__":true,"id":7221}},"8400":{"timestamp":{"__isSmartRef__":true,"id":8401},"user":"jan.sandbrink","tags":[]},"8401":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8402":{"varMapping":{"__isSmartRef__":true,"id":8403},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8404},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8403":{"this":{"__isSmartRef__":true,"id":7221}},"8404":{"timestamp":{"__isSmartRef__":true,"id":8405},"user":"josi","tags":["gemtypes"]},"8405":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8406":{"varMapping":{"__isSmartRef__":true,"id":8407},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8408},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8407":{"this":{"__isSmartRef__":true,"id":7221}},"8408":{"timestamp":{"__isSmartRef__":true,"id":8409},"user":"josi","tags":["gemtypes"]},"8409":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8410":{"varMapping":{"__isSmartRef__":true,"id":8411},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8412},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8411":{"this":{"__isSmartRef__":true,"id":7221}},"8412":{"timestamp":{"__isSmartRef__":true,"id":8413},"user":"josi","tags":[]},"8413":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8414":{"varMapping":{"__isSmartRef__":true,"id":8415},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8416},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8415":{"this":{"__isSmartRef__":true,"id":7221}},"8416":{"timestamp":{"__isSmartRef__":true,"id":8417},"user":"josi","tags":[]},"8417":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8418":{"varMapping":{"__isSmartRef__":true,"id":8419},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8420},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8419":{"this":{"__isSmartRef__":true,"id":7221}},"8420":{"timestamp":{"__isSmartRef__":true,"id":8421},"user":"soergel","tags":[]},"8421":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8422":{"varMapping":{"__isSmartRef__":true,"id":8423},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8424},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8423":{"this":{"__isSmartRef__":true,"id":7221}},"8424":{"timestamp":{"__isSmartRef__":true,"id":8425},"user":"soergel","tags":[]},"8425":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8426":{"varMapping":{"__isSmartRef__":true,"id":8427},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8428},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8427":{"this":{"__isSmartRef__":true,"id":7221}},"8428":{"timestamp":{"__isSmartRef__":true,"id":8429},"user":"soergel","tags":[]},"8429":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8430":{"varMapping":{"__isSmartRef__":true,"id":8431},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8432},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8431":{"this":{"__isSmartRef__":true,"id":7221}},"8432":{"timestamp":{"__isSmartRef__":true,"id":8433},"user":"soergel","tags":["debug"]},"8433":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8434":{"varMapping":{"__isSmartRef__":true,"id":8435},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8436},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8435":{"this":{"__isSmartRef__":true,"id":7221}},"8436":{"timestamp":{"__isSmartRef__":true,"id":8437},"user":"soergel","tags":["debug"]},"8437":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8438":{"varMapping":{"__isSmartRef__":true,"id":8439},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8440},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8439":{"this":{"__isSmartRef__":true,"id":7221}},"8440":{"timestamp":{"__isSmartRef__":true,"id":8441},"user":"jan.sandbrink","tags":[]},"8441":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8442":{"varMapping":{"__isSmartRef__":true,"id":8443},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8444},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8443":{"this":{"__isSmartRef__":true,"id":7221}},"8444":{"timestamp":{"__isSmartRef__":true,"id":8445},"user":"jan.sandbrink","tags":[]},"8445":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8446":{"varMapping":{"__isSmartRef__":true,"id":8447},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8448},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8447":{"this":{"__isSmartRef__":true,"id":7221}},"8448":{"timestamp":{"__isSmartRef__":true,"id":8449},"user":"jan.sandbrink","tags":[]},"8449":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8450":{"varMapping":{"__isSmartRef__":true,"id":8451},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8452},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8451":{"this":{"__isSmartRef__":true,"id":7221}},"8452":{"timestamp":{"__isSmartRef__":true,"id":8453},"user":"jan.sandbrink","tags":[]},"8453":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8454":{"varMapping":{"__isSmartRef__":true,"id":8455},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8456},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8455":{"this":{"__isSmartRef__":true,"id":7221}},"8456":{"timestamp":{"__isSmartRef__":true,"id":8457},"user":"jan.sandbrink","tags":[]},"8457":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8458":{"varMapping":{"__isSmartRef__":true,"id":8459},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8460},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8459":{"this":{"__isSmartRef__":true,"id":7221}},"8460":{"timestamp":{"__isSmartRef__":true,"id":8461},"user":"josi","tags":["gemtypes"]},"8461":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8462":{"varMapping":{"__isSmartRef__":true,"id":8463},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8464},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8463":{"this":{"__isSmartRef__":true,"id":7221}},"8464":{"timestamp":{"__isSmartRef__":true,"id":8465},"user":"josi","tags":["gemtypes"]},"8465":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8466":{"varMapping":{"__isSmartRef__":true,"id":8467},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8468},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8467":{"this":{"__isSmartRef__":true,"id":7221}},"8468":{"timestamp":{"__isSmartRef__":true,"id":8469},"user":"soergel","tags":["debug"]},"8469":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8470":{"varMapping":{"__isSmartRef__":true,"id":8471},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8472},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8471":{"this":{"__isSmartRef__":true,"id":7221}},"8472":{"timestamp":{"__isSmartRef__":true,"id":8473},"user":"soergel","tags":["debug"]},"8473":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8474":{"varMapping":{"__isSmartRef__":true,"id":8475},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8476},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8475":{"this":{"__isSmartRef__":true,"id":7221}},"8476":{"timestamp":{"__isSmartRef__":true,"id":8477},"user":"josi","tags":["gemtypes"]},"8477":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8478":{"varMapping":{"__isSmartRef__":true,"id":8479},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8480},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8479":{"this":{"__isSmartRef__":true,"id":7221}},"8480":{"timestamp":{"__isSmartRef__":true,"id":8481},"user":"soergel","tags":[]},"8481":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8482":{"varMapping":{"__isSmartRef__":true,"id":8483},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8484},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8483":{"this":{"__isSmartRef__":true,"id":7221}},"8484":{"timestamp":{"__isSmartRef__":true,"id":8485},"user":"soergel","tags":[]},"8485":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8486":{"varMapping":{"__isSmartRef__":true,"id":8487},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8488},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8487":{"this":{"__isSmartRef__":true,"id":7221}},"8488":{"timestamp":{"__isSmartRef__":true,"id":8489},"user":"soergel","tags":[]},"8489":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8490":{"varMapping":{"__isSmartRef__":true,"id":8491},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8492},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8491":{"this":{"__isSmartRef__":true,"id":7221}},"8492":{"timestamp":{"__isSmartRef__":true,"id":8493},"user":"josi","tags":["gemtypes"]},"8493":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8494":{"varMapping":{"__isSmartRef__":true,"id":8495},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8496},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8495":{"this":{"__isSmartRef__":true,"id":7221}},"8496":{"timestamp":{"__isSmartRef__":true,"id":8497},"user":"josi","tags":["gemtypes"]},"8497":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8498":{"varMapping":{"__isSmartRef__":true,"id":8499},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8500},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8499":{"this":{"__isSmartRef__":true,"id":7221}},"8500":{"timestamp":{"__isSmartRef__":true,"id":8501},"user":"jan.sandbrink","tags":[]},"8501":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8502":{"become":{"__isSmartRef__":true,"id":8503},"onMouseDown":{"__isSmartRef__":true,"id":8507},"updatePicture":{"__isSmartRef__":true,"id":8515},"ruby":{"__isSmartRef__":true,"id":8519},"switchPositionWith":{"__isSmartRef__":true,"id":8523},"addNeighbour":{"__isSmartRef__":true,"id":8527},"amethyst":{"__isSmartRef__":true,"id":8531},"diopside":{"__isSmartRef__":true,"id":8535},"gemTypes":{"__isSmartRef__":true,"id":8539},"becomeRandomGem":{"__isSmartRef__":true,"id":8543},"mark":{"__isSmartRef__":true,"id":8547},"unmark":{"__isSmartRef__":true,"id":8551},"hasNeighbour":{"__isSmartRef__":true,"id":8555},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8559},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8563},"disappear":{"__isSmartRef__":true,"id":8567},"findStreakStart":{"__isSmartRef__":true,"id":8571},"buildStreak":{"__isSmartRef__":true,"id":8575},"scoreStreak":{"__isSmartRef__":true,"id":8579},"tryToStreak":{"__isSmartRef__":true,"id":8583},"blueDiamond":{"__isSmartRef__":true,"id":8587},"prehnite":{"__isSmartRef__":true,"id":8591},"debugUnmark":{"__isSmartRef__":true,"id":8595},"debugMark":{"__isSmartRef__":true,"id":8599},"citrine":{"__isSmartRef__":true,"id":8603},"move":{"__isSmartRef__":true,"id":8607},"performMovement":{"__isSmartRef__":true,"id":8611},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8615},"zircon":{"__isSmartRef__":true,"id":8619},"emerald":{"__isSmartRef__":true,"id":8623},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8627}},"8503":{"varMapping":{"__isSmartRef__":true,"id":8504},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8505},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8504":{"this":{"__isSmartRef__":true,"id":7089}},"8505":{"timestamp":{"__isSmartRef__":true,"id":8506},"user":"josi","tags":[]},"8506":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8507":{"varMapping":{"__isSmartRef__":true,"id":8508},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8513},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8508":{"this":{"__isSmartRef__":true,"id":7089},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8509}},"8509":{"$super":{"__isSmartRef__":true,"id":8510}},"8510":{"varMapping":{"__isSmartRef__":true,"id":8511},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8512},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8511":{"obj":{"__isSmartRef__":true,"id":7089},"name":"onMouseDown"},"8512":{},"8513":{"timestamp":{"__isSmartRef__":true,"id":8514},"user":"soergel","tags":[]},"8514":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8515":{"varMapping":{"__isSmartRef__":true,"id":8516},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8517},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8516":{"this":{"__isSmartRef__":true,"id":7089}},"8517":{"timestamp":{"__isSmartRef__":true,"id":8518},"user":"soergel","tags":[]},"8518":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8519":{"varMapping":{"__isSmartRef__":true,"id":8520},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8521},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8520":{"this":{"__isSmartRef__":true,"id":7089}},"8521":{"timestamp":{"__isSmartRef__":true,"id":8522},"user":"josi","tags":["gemtypes"]},"8522":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8523":{"varMapping":{"__isSmartRef__":true,"id":8524},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8525},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8524":{"this":{"__isSmartRef__":true,"id":7089}},"8525":{"timestamp":{"__isSmartRef__":true,"id":8526},"user":"jan.sandbrink","tags":[]},"8526":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8527":{"varMapping":{"__isSmartRef__":true,"id":8528},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8529},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8528":{"this":{"__isSmartRef__":true,"id":7089}},"8529":{"timestamp":{"__isSmartRef__":true,"id":8530},"user":"jan.sandbrink","tags":[]},"8530":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8531":{"varMapping":{"__isSmartRef__":true,"id":8532},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8533},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8532":{"this":{"__isSmartRef__":true,"id":7089}},"8533":{"timestamp":{"__isSmartRef__":true,"id":8534},"user":"josi","tags":["gemtypes"]},"8534":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8535":{"varMapping":{"__isSmartRef__":true,"id":8536},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8537},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8536":{"this":{"__isSmartRef__":true,"id":7089}},"8537":{"timestamp":{"__isSmartRef__":true,"id":8538},"user":"josi","tags":["gemtypes"]},"8538":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8539":{"varMapping":{"__isSmartRef__":true,"id":8540},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8541},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8540":{"this":{"__isSmartRef__":true,"id":7089}},"8541":{"timestamp":{"__isSmartRef__":true,"id":8542},"user":"josi","tags":[]},"8542":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8543":{"varMapping":{"__isSmartRef__":true,"id":8544},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8545},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8544":{"this":{"__isSmartRef__":true,"id":7089}},"8545":{"timestamp":{"__isSmartRef__":true,"id":8546},"user":"josi","tags":[]},"8546":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8547":{"varMapping":{"__isSmartRef__":true,"id":8548},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8549},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8548":{"this":{"__isSmartRef__":true,"id":7089}},"8549":{"timestamp":{"__isSmartRef__":true,"id":8550},"user":"soergel","tags":[]},"8550":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8551":{"varMapping":{"__isSmartRef__":true,"id":8552},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8553},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8552":{"this":{"__isSmartRef__":true,"id":7089}},"8553":{"timestamp":{"__isSmartRef__":true,"id":8554},"user":"soergel","tags":[]},"8554":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8555":{"varMapping":{"__isSmartRef__":true,"id":8556},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8557},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8556":{"this":{"__isSmartRef__":true,"id":7089}},"8557":{"timestamp":{"__isSmartRef__":true,"id":8558},"user":"soergel","tags":[]},"8558":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8559":{"varMapping":{"__isSmartRef__":true,"id":8560},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8561},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8560":{"this":{"__isSmartRef__":true,"id":7089}},"8561":{"timestamp":{"__isSmartRef__":true,"id":8562},"user":"soergel","tags":["debug"]},"8562":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8563":{"varMapping":{"__isSmartRef__":true,"id":8564},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8565},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8564":{"this":{"__isSmartRef__":true,"id":7089}},"8565":{"timestamp":{"__isSmartRef__":true,"id":8566},"user":"soergel","tags":["debug"]},"8566":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8567":{"varMapping":{"__isSmartRef__":true,"id":8568},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8569},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8568":{"this":{"__isSmartRef__":true,"id":7089}},"8569":{"timestamp":{"__isSmartRef__":true,"id":8570},"user":"jan.sandbrink","tags":[]},"8570":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8571":{"varMapping":{"__isSmartRef__":true,"id":8572},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8573},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8572":{"this":{"__isSmartRef__":true,"id":7089}},"8573":{"timestamp":{"__isSmartRef__":true,"id":8574},"user":"jan.sandbrink","tags":[]},"8574":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8575":{"varMapping":{"__isSmartRef__":true,"id":8576},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8577},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8576":{"this":{"__isSmartRef__":true,"id":7089}},"8577":{"timestamp":{"__isSmartRef__":true,"id":8578},"user":"jan.sandbrink","tags":[]},"8578":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8579":{"varMapping":{"__isSmartRef__":true,"id":8580},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8581},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8580":{"this":{"__isSmartRef__":true,"id":7089}},"8581":{"timestamp":{"__isSmartRef__":true,"id":8582},"user":"jan.sandbrink","tags":[]},"8582":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8583":{"varMapping":{"__isSmartRef__":true,"id":8584},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8585},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8584":{"this":{"__isSmartRef__":true,"id":7089}},"8585":{"timestamp":{"__isSmartRef__":true,"id":8586},"user":"jan.sandbrink","tags":[]},"8586":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8587":{"varMapping":{"__isSmartRef__":true,"id":8588},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8589},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8588":{"this":{"__isSmartRef__":true,"id":7089}},"8589":{"timestamp":{"__isSmartRef__":true,"id":8590},"user":"josi","tags":["gemtypes"]},"8590":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8591":{"varMapping":{"__isSmartRef__":true,"id":8592},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8593},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8592":{"this":{"__isSmartRef__":true,"id":7089}},"8593":{"timestamp":{"__isSmartRef__":true,"id":8594},"user":"josi","tags":["gemtypes"]},"8594":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8595":{"varMapping":{"__isSmartRef__":true,"id":8596},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8597},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8596":{"this":{"__isSmartRef__":true,"id":7089}},"8597":{"timestamp":{"__isSmartRef__":true,"id":8598},"user":"soergel","tags":["debug"]},"8598":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8599":{"varMapping":{"__isSmartRef__":true,"id":8600},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8601},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8600":{"this":{"__isSmartRef__":true,"id":7089}},"8601":{"timestamp":{"__isSmartRef__":true,"id":8602},"user":"soergel","tags":["debug"]},"8602":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8603":{"varMapping":{"__isSmartRef__":true,"id":8604},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8605},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8604":{"this":{"__isSmartRef__":true,"id":7089}},"8605":{"timestamp":{"__isSmartRef__":true,"id":8606},"user":"josi","tags":["gemtypes"]},"8606":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8607":{"varMapping":{"__isSmartRef__":true,"id":8608},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8609},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8608":{"this":{"__isSmartRef__":true,"id":7089}},"8609":{"timestamp":{"__isSmartRef__":true,"id":8610},"user":"soergel","tags":[]},"8610":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8611":{"varMapping":{"__isSmartRef__":true,"id":8612},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8613},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8612":{"this":{"__isSmartRef__":true,"id":7089}},"8613":{"timestamp":{"__isSmartRef__":true,"id":8614},"user":"soergel","tags":[]},"8614":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8615":{"varMapping":{"__isSmartRef__":true,"id":8616},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8617},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8616":{"this":{"__isSmartRef__":true,"id":7089}},"8617":{"timestamp":{"__isSmartRef__":true,"id":8618},"user":"soergel","tags":[]},"8618":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8619":{"varMapping":{"__isSmartRef__":true,"id":8620},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8621},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8620":{"this":{"__isSmartRef__":true,"id":7089}},"8621":{"timestamp":{"__isSmartRef__":true,"id":8622},"user":"josi","tags":["gemtypes"]},"8622":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8623":{"varMapping":{"__isSmartRef__":true,"id":8624},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8625},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8624":{"this":{"__isSmartRef__":true,"id":7089}},"8625":{"timestamp":{"__isSmartRef__":true,"id":8626},"user":"josi","tags":["gemtypes"]},"8626":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8627":{"varMapping":{"__isSmartRef__":true,"id":8628},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8629},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8628":{"this":{"__isSmartRef__":true,"id":7089}},"8629":{"timestamp":{"__isSmartRef__":true,"id":8630},"user":"jan.sandbrink","tags":[]},"8630":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8631":{"become":{"__isSmartRef__":true,"id":8632},"onMouseDown":{"__isSmartRef__":true,"id":8636},"updatePicture":{"__isSmartRef__":true,"id":8644},"ruby":{"__isSmartRef__":true,"id":8648},"switchPositionWith":{"__isSmartRef__":true,"id":8652},"addNeighbour":{"__isSmartRef__":true,"id":8656},"amethyst":{"__isSmartRef__":true,"id":8660},"diopside":{"__isSmartRef__":true,"id":8664},"gemTypes":{"__isSmartRef__":true,"id":8668},"becomeRandomGem":{"__isSmartRef__":true,"id":8672},"mark":{"__isSmartRef__":true,"id":8676},"unmark":{"__isSmartRef__":true,"id":8680},"hasNeighbour":{"__isSmartRef__":true,"id":8684},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8688},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8692},"disappear":{"__isSmartRef__":true,"id":8696},"findStreakStart":{"__isSmartRef__":true,"id":8700},"buildStreak":{"__isSmartRef__":true,"id":8704},"scoreStreak":{"__isSmartRef__":true,"id":8708},"tryToStreak":{"__isSmartRef__":true,"id":8712},"blueDiamond":{"__isSmartRef__":true,"id":8716},"prehnite":{"__isSmartRef__":true,"id":8720},"debugUnmark":{"__isSmartRef__":true,"id":8724},"debugMark":{"__isSmartRef__":true,"id":8728},"citrine":{"__isSmartRef__":true,"id":8732},"move":{"__isSmartRef__":true,"id":8736},"performMovement":{"__isSmartRef__":true,"id":8740},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8744},"zircon":{"__isSmartRef__":true,"id":8748},"emerald":{"__isSmartRef__":true,"id":8752},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8756}},"8632":{"varMapping":{"__isSmartRef__":true,"id":8633},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8634},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8633":{"this":{"__isSmartRef__":true,"id":6971}},"8634":{"timestamp":{"__isSmartRef__":true,"id":8635},"user":"josi","tags":[]},"8635":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8636":{"varMapping":{"__isSmartRef__":true,"id":8637},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8642},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8637":{"this":{"__isSmartRef__":true,"id":6971},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8638}},"8638":{"$super":{"__isSmartRef__":true,"id":8639}},"8639":{"varMapping":{"__isSmartRef__":true,"id":8640},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8641},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8640":{"obj":{"__isSmartRef__":true,"id":6971},"name":"onMouseDown"},"8641":{},"8642":{"timestamp":{"__isSmartRef__":true,"id":8643},"user":"soergel","tags":[]},"8643":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8644":{"varMapping":{"__isSmartRef__":true,"id":8645},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8646},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8645":{"this":{"__isSmartRef__":true,"id":6971}},"8646":{"timestamp":{"__isSmartRef__":true,"id":8647},"user":"soergel","tags":[]},"8647":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8648":{"varMapping":{"__isSmartRef__":true,"id":8649},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8650},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8649":{"this":{"__isSmartRef__":true,"id":6971}},"8650":{"timestamp":{"__isSmartRef__":true,"id":8651},"user":"josi","tags":["gemtypes"]},"8651":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8652":{"varMapping":{"__isSmartRef__":true,"id":8653},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8654},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8653":{"this":{"__isSmartRef__":true,"id":6971}},"8654":{"timestamp":{"__isSmartRef__":true,"id":8655},"user":"jan.sandbrink","tags":[]},"8655":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8656":{"varMapping":{"__isSmartRef__":true,"id":8657},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8658},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8657":{"this":{"__isSmartRef__":true,"id":6971}},"8658":{"timestamp":{"__isSmartRef__":true,"id":8659},"user":"jan.sandbrink","tags":[]},"8659":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8660":{"varMapping":{"__isSmartRef__":true,"id":8661},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8662},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8661":{"this":{"__isSmartRef__":true,"id":6971}},"8662":{"timestamp":{"__isSmartRef__":true,"id":8663},"user":"josi","tags":["gemtypes"]},"8663":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8664":{"varMapping":{"__isSmartRef__":true,"id":8665},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8666},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8665":{"this":{"__isSmartRef__":true,"id":6971}},"8666":{"timestamp":{"__isSmartRef__":true,"id":8667},"user":"josi","tags":["gemtypes"]},"8667":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8668":{"varMapping":{"__isSmartRef__":true,"id":8669},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8670},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8669":{"this":{"__isSmartRef__":true,"id":6971}},"8670":{"timestamp":{"__isSmartRef__":true,"id":8671},"user":"josi","tags":[]},"8671":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8672":{"varMapping":{"__isSmartRef__":true,"id":8673},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8674},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8673":{"this":{"__isSmartRef__":true,"id":6971}},"8674":{"timestamp":{"__isSmartRef__":true,"id":8675},"user":"josi","tags":[]},"8675":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8676":{"varMapping":{"__isSmartRef__":true,"id":8677},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8678},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8677":{"this":{"__isSmartRef__":true,"id":6971}},"8678":{"timestamp":{"__isSmartRef__":true,"id":8679},"user":"soergel","tags":[]},"8679":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8680":{"varMapping":{"__isSmartRef__":true,"id":8681},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8682},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8681":{"this":{"__isSmartRef__":true,"id":6971}},"8682":{"timestamp":{"__isSmartRef__":true,"id":8683},"user":"soergel","tags":[]},"8683":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8684":{"varMapping":{"__isSmartRef__":true,"id":8685},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8686},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8685":{"this":{"__isSmartRef__":true,"id":6971}},"8686":{"timestamp":{"__isSmartRef__":true,"id":8687},"user":"soergel","tags":[]},"8687":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8688":{"varMapping":{"__isSmartRef__":true,"id":8689},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8690},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8689":{"this":{"__isSmartRef__":true,"id":6971}},"8690":{"timestamp":{"__isSmartRef__":true,"id":8691},"user":"soergel","tags":["debug"]},"8691":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8692":{"varMapping":{"__isSmartRef__":true,"id":8693},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8694},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8693":{"this":{"__isSmartRef__":true,"id":6971}},"8694":{"timestamp":{"__isSmartRef__":true,"id":8695},"user":"soergel","tags":["debug"]},"8695":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8696":{"varMapping":{"__isSmartRef__":true,"id":8697},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8698},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8697":{"this":{"__isSmartRef__":true,"id":6971}},"8698":{"timestamp":{"__isSmartRef__":true,"id":8699},"user":"jan.sandbrink","tags":[]},"8699":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8700":{"varMapping":{"__isSmartRef__":true,"id":8701},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8702},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8701":{"this":{"__isSmartRef__":true,"id":6971}},"8702":{"timestamp":{"__isSmartRef__":true,"id":8703},"user":"jan.sandbrink","tags":[]},"8703":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8704":{"varMapping":{"__isSmartRef__":true,"id":8705},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8706},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8705":{"this":{"__isSmartRef__":true,"id":6971}},"8706":{"timestamp":{"__isSmartRef__":true,"id":8707},"user":"jan.sandbrink","tags":[]},"8707":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8708":{"varMapping":{"__isSmartRef__":true,"id":8709},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8710},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8709":{"this":{"__isSmartRef__":true,"id":6971}},"8710":{"timestamp":{"__isSmartRef__":true,"id":8711},"user":"jan.sandbrink","tags":[]},"8711":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8712":{"varMapping":{"__isSmartRef__":true,"id":8713},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8714},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8713":{"this":{"__isSmartRef__":true,"id":6971}},"8714":{"timestamp":{"__isSmartRef__":true,"id":8715},"user":"jan.sandbrink","tags":[]},"8715":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8716":{"varMapping":{"__isSmartRef__":true,"id":8717},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8718},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8717":{"this":{"__isSmartRef__":true,"id":6971}},"8718":{"timestamp":{"__isSmartRef__":true,"id":8719},"user":"josi","tags":["gemtypes"]},"8719":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8720":{"varMapping":{"__isSmartRef__":true,"id":8721},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8722},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8721":{"this":{"__isSmartRef__":true,"id":6971}},"8722":{"timestamp":{"__isSmartRef__":true,"id":8723},"user":"josi","tags":["gemtypes"]},"8723":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8724":{"varMapping":{"__isSmartRef__":true,"id":8725},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8726},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8725":{"this":{"__isSmartRef__":true,"id":6971}},"8726":{"timestamp":{"__isSmartRef__":true,"id":8727},"user":"soergel","tags":["debug"]},"8727":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8728":{"varMapping":{"__isSmartRef__":true,"id":8729},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8730},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8729":{"this":{"__isSmartRef__":true,"id":6971}},"8730":{"timestamp":{"__isSmartRef__":true,"id":8731},"user":"soergel","tags":["debug"]},"8731":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8732":{"varMapping":{"__isSmartRef__":true,"id":8733},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8734},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8733":{"this":{"__isSmartRef__":true,"id":6971}},"8734":{"timestamp":{"__isSmartRef__":true,"id":8735},"user":"josi","tags":["gemtypes"]},"8735":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8736":{"varMapping":{"__isSmartRef__":true,"id":8737},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8738},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8737":{"this":{"__isSmartRef__":true,"id":6971}},"8738":{"timestamp":{"__isSmartRef__":true,"id":8739},"user":"soergel","tags":[]},"8739":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8740":{"varMapping":{"__isSmartRef__":true,"id":8741},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8742},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8741":{"this":{"__isSmartRef__":true,"id":6971}},"8742":{"timestamp":{"__isSmartRef__":true,"id":8743},"user":"soergel","tags":[]},"8743":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8744":{"varMapping":{"__isSmartRef__":true,"id":8745},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8746},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8745":{"this":{"__isSmartRef__":true,"id":6971}},"8746":{"timestamp":{"__isSmartRef__":true,"id":8747},"user":"soergel","tags":[]},"8747":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8748":{"varMapping":{"__isSmartRef__":true,"id":8749},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8750},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8749":{"this":{"__isSmartRef__":true,"id":6971}},"8750":{"timestamp":{"__isSmartRef__":true,"id":8751},"user":"josi","tags":["gemtypes"]},"8751":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8752":{"varMapping":{"__isSmartRef__":true,"id":8753},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8754},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8753":{"this":{"__isSmartRef__":true,"id":6971}},"8754":{"timestamp":{"__isSmartRef__":true,"id":8755},"user":"josi","tags":["gemtypes"]},"8755":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8756":{"varMapping":{"__isSmartRef__":true,"id":8757},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8758},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8757":{"this":{"__isSmartRef__":true,"id":6971}},"8758":{"timestamp":{"__isSmartRef__":true,"id":8759},"user":"jan.sandbrink","tags":[]},"8759":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8760":{"become":{"__isSmartRef__":true,"id":8761},"onMouseDown":{"__isSmartRef__":true,"id":8765},"updatePicture":{"__isSmartRef__":true,"id":8773},"ruby":{"__isSmartRef__":true,"id":8777},"switchPositionWith":{"__isSmartRef__":true,"id":8781},"addNeighbour":{"__isSmartRef__":true,"id":8785},"amethyst":{"__isSmartRef__":true,"id":8789},"diopside":{"__isSmartRef__":true,"id":8793},"gemTypes":{"__isSmartRef__":true,"id":8797},"becomeRandomGem":{"__isSmartRef__":true,"id":8801},"mark":{"__isSmartRef__":true,"id":8805},"unmark":{"__isSmartRef__":true,"id":8809},"hasNeighbour":{"__isSmartRef__":true,"id":8813},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8817},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8821},"disappear":{"__isSmartRef__":true,"id":8825},"findStreakStart":{"__isSmartRef__":true,"id":8829},"buildStreak":{"__isSmartRef__":true,"id":8833},"scoreStreak":{"__isSmartRef__":true,"id":8837},"tryToStreak":{"__isSmartRef__":true,"id":8841},"blueDiamond":{"__isSmartRef__":true,"id":8845},"prehnite":{"__isSmartRef__":true,"id":8849},"debugUnmark":{"__isSmartRef__":true,"id":8853},"debugMark":{"__isSmartRef__":true,"id":8857},"citrine":{"__isSmartRef__":true,"id":8861},"move":{"__isSmartRef__":true,"id":8865},"performMovement":{"__isSmartRef__":true,"id":8869},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":8873},"zircon":{"__isSmartRef__":true,"id":8877},"emerald":{"__isSmartRef__":true,"id":8881},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":8885}},"8761":{"varMapping":{"__isSmartRef__":true,"id":8762},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8763},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8762":{"this":{"__isSmartRef__":true,"id":6844}},"8763":{"timestamp":{"__isSmartRef__":true,"id":8764},"user":"josi","tags":[]},"8764":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8765":{"varMapping":{"__isSmartRef__":true,"id":8766},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8771},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8766":{"this":{"__isSmartRef__":true,"id":6844},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8767}},"8767":{"$super":{"__isSmartRef__":true,"id":8768}},"8768":{"varMapping":{"__isSmartRef__":true,"id":8769},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8770},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8769":{"obj":{"__isSmartRef__":true,"id":6844},"name":"onMouseDown"},"8770":{},"8771":{"timestamp":{"__isSmartRef__":true,"id":8772},"user":"soergel","tags":[]},"8772":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8773":{"varMapping":{"__isSmartRef__":true,"id":8774},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8775},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8774":{"this":{"__isSmartRef__":true,"id":6844}},"8775":{"timestamp":{"__isSmartRef__":true,"id":8776},"user":"soergel","tags":[]},"8776":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8777":{"varMapping":{"__isSmartRef__":true,"id":8778},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8779},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8778":{"this":{"__isSmartRef__":true,"id":6844}},"8779":{"timestamp":{"__isSmartRef__":true,"id":8780},"user":"josi","tags":["gemtypes"]},"8780":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8781":{"varMapping":{"__isSmartRef__":true,"id":8782},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8783},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8782":{"this":{"__isSmartRef__":true,"id":6844}},"8783":{"timestamp":{"__isSmartRef__":true,"id":8784},"user":"jan.sandbrink","tags":[]},"8784":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8785":{"varMapping":{"__isSmartRef__":true,"id":8786},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8787},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8786":{"this":{"__isSmartRef__":true,"id":6844}},"8787":{"timestamp":{"__isSmartRef__":true,"id":8788},"user":"jan.sandbrink","tags":[]},"8788":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8789":{"varMapping":{"__isSmartRef__":true,"id":8790},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8791},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8790":{"this":{"__isSmartRef__":true,"id":6844}},"8791":{"timestamp":{"__isSmartRef__":true,"id":8792},"user":"josi","tags":["gemtypes"]},"8792":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8793":{"varMapping":{"__isSmartRef__":true,"id":8794},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8795},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8794":{"this":{"__isSmartRef__":true,"id":6844}},"8795":{"timestamp":{"__isSmartRef__":true,"id":8796},"user":"josi","tags":["gemtypes"]},"8796":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8797":{"varMapping":{"__isSmartRef__":true,"id":8798},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8799},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8798":{"this":{"__isSmartRef__":true,"id":6844}},"8799":{"timestamp":{"__isSmartRef__":true,"id":8800},"user":"josi","tags":[]},"8800":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8801":{"varMapping":{"__isSmartRef__":true,"id":8802},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8803},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8802":{"this":{"__isSmartRef__":true,"id":6844}},"8803":{"timestamp":{"__isSmartRef__":true,"id":8804},"user":"josi","tags":[]},"8804":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8805":{"varMapping":{"__isSmartRef__":true,"id":8806},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8807},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8806":{"this":{"__isSmartRef__":true,"id":6844}},"8807":{"timestamp":{"__isSmartRef__":true,"id":8808},"user":"soergel","tags":[]},"8808":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8809":{"varMapping":{"__isSmartRef__":true,"id":8810},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8811},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8810":{"this":{"__isSmartRef__":true,"id":6844}},"8811":{"timestamp":{"__isSmartRef__":true,"id":8812},"user":"soergel","tags":[]},"8812":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8813":{"varMapping":{"__isSmartRef__":true,"id":8814},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8815},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8814":{"this":{"__isSmartRef__":true,"id":6844}},"8815":{"timestamp":{"__isSmartRef__":true,"id":8816},"user":"soergel","tags":[]},"8816":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8817":{"varMapping":{"__isSmartRef__":true,"id":8818},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8819},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8818":{"this":{"__isSmartRef__":true,"id":6844}},"8819":{"timestamp":{"__isSmartRef__":true,"id":8820},"user":"soergel","tags":["debug"]},"8820":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8821":{"varMapping":{"__isSmartRef__":true,"id":8822},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8823},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8822":{"this":{"__isSmartRef__":true,"id":6844}},"8823":{"timestamp":{"__isSmartRef__":true,"id":8824},"user":"soergel","tags":["debug"]},"8824":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8825":{"varMapping":{"__isSmartRef__":true,"id":8826},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8827},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8826":{"this":{"__isSmartRef__":true,"id":6844}},"8827":{"timestamp":{"__isSmartRef__":true,"id":8828},"user":"jan.sandbrink","tags":[]},"8828":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8829":{"varMapping":{"__isSmartRef__":true,"id":8830},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8831},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8830":{"this":{"__isSmartRef__":true,"id":6844}},"8831":{"timestamp":{"__isSmartRef__":true,"id":8832},"user":"jan.sandbrink","tags":[]},"8832":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8833":{"varMapping":{"__isSmartRef__":true,"id":8834},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8835},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8834":{"this":{"__isSmartRef__":true,"id":6844}},"8835":{"timestamp":{"__isSmartRef__":true,"id":8836},"user":"jan.sandbrink","tags":[]},"8836":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8837":{"varMapping":{"__isSmartRef__":true,"id":8838},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8839},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8838":{"this":{"__isSmartRef__":true,"id":6844}},"8839":{"timestamp":{"__isSmartRef__":true,"id":8840},"user":"jan.sandbrink","tags":[]},"8840":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8841":{"varMapping":{"__isSmartRef__":true,"id":8842},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8843},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8842":{"this":{"__isSmartRef__":true,"id":6844}},"8843":{"timestamp":{"__isSmartRef__":true,"id":8844},"user":"jan.sandbrink","tags":[]},"8844":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8845":{"varMapping":{"__isSmartRef__":true,"id":8846},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8847},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8846":{"this":{"__isSmartRef__":true,"id":6844}},"8847":{"timestamp":{"__isSmartRef__":true,"id":8848},"user":"josi","tags":["gemtypes"]},"8848":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8849":{"varMapping":{"__isSmartRef__":true,"id":8850},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8851},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8850":{"this":{"__isSmartRef__":true,"id":6844}},"8851":{"timestamp":{"__isSmartRef__":true,"id":8852},"user":"josi","tags":["gemtypes"]},"8852":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8853":{"varMapping":{"__isSmartRef__":true,"id":8854},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8855},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8854":{"this":{"__isSmartRef__":true,"id":6844}},"8855":{"timestamp":{"__isSmartRef__":true,"id":8856},"user":"soergel","tags":["debug"]},"8856":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8857":{"varMapping":{"__isSmartRef__":true,"id":8858},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8859},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8858":{"this":{"__isSmartRef__":true,"id":6844}},"8859":{"timestamp":{"__isSmartRef__":true,"id":8860},"user":"soergel","tags":["debug"]},"8860":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8861":{"varMapping":{"__isSmartRef__":true,"id":8862},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8863},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8862":{"this":{"__isSmartRef__":true,"id":6844}},"8863":{"timestamp":{"__isSmartRef__":true,"id":8864},"user":"josi","tags":["gemtypes"]},"8864":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8865":{"varMapping":{"__isSmartRef__":true,"id":8866},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8867},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8866":{"this":{"__isSmartRef__":true,"id":6844}},"8867":{"timestamp":{"__isSmartRef__":true,"id":8868},"user":"soergel","tags":[]},"8868":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8869":{"varMapping":{"__isSmartRef__":true,"id":8870},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":8871},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8870":{"this":{"__isSmartRef__":true,"id":6844}},"8871":{"timestamp":{"__isSmartRef__":true,"id":8872},"user":"soergel","tags":[]},"8872":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"8873":{"varMapping":{"__isSmartRef__":true,"id":8874},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":8875},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8874":{"this":{"__isSmartRef__":true,"id":6844}},"8875":{"timestamp":{"__isSmartRef__":true,"id":8876},"user":"soergel","tags":[]},"8876":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"8877":{"varMapping":{"__isSmartRef__":true,"id":8878},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":8879},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8878":{"this":{"__isSmartRef__":true,"id":6844}},"8879":{"timestamp":{"__isSmartRef__":true,"id":8880},"user":"josi","tags":["gemtypes"]},"8880":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"8881":{"varMapping":{"__isSmartRef__":true,"id":8882},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":8883},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8882":{"this":{"__isSmartRef__":true,"id":6844}},"8883":{"timestamp":{"__isSmartRef__":true,"id":8884},"user":"josi","tags":["gemtypes"]},"8884":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"8885":{"varMapping":{"__isSmartRef__":true,"id":8886},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":8887},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8886":{"this":{"__isSmartRef__":true,"id":6844}},"8887":{"timestamp":{"__isSmartRef__":true,"id":8888},"user":"jan.sandbrink","tags":[]},"8888":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"8889":{"become":{"__isSmartRef__":true,"id":8890},"onMouseDown":{"__isSmartRef__":true,"id":8894},"updatePicture":{"__isSmartRef__":true,"id":8902},"ruby":{"__isSmartRef__":true,"id":8906},"switchPositionWith":{"__isSmartRef__":true,"id":8910},"addNeighbour":{"__isSmartRef__":true,"id":8914},"amethyst":{"__isSmartRef__":true,"id":8918},"diopside":{"__isSmartRef__":true,"id":8922},"gemTypes":{"__isSmartRef__":true,"id":8926},"becomeRandomGem":{"__isSmartRef__":true,"id":8930},"mark":{"__isSmartRef__":true,"id":8934},"unmark":{"__isSmartRef__":true,"id":8938},"hasNeighbour":{"__isSmartRef__":true,"id":8942},"debugMarkNeighbours":{"__isSmartRef__":true,"id":8946},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":8950},"disappear":{"__isSmartRef__":true,"id":8954},"findStreakStart":{"__isSmartRef__":true,"id":8958},"buildStreak":{"__isSmartRef__":true,"id":8962},"scoreStreak":{"__isSmartRef__":true,"id":8966},"tryToStreak":{"__isSmartRef__":true,"id":8970},"blueDiamond":{"__isSmartRef__":true,"id":8974},"prehnite":{"__isSmartRef__":true,"id":8978},"debugUnmark":{"__isSmartRef__":true,"id":8982},"debugMark":{"__isSmartRef__":true,"id":8986},"citrine":{"__isSmartRef__":true,"id":8990},"move":{"__isSmartRef__":true,"id":8994},"performMovement":{"__isSmartRef__":true,"id":8998},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9002},"zircon":{"__isSmartRef__":true,"id":9006},"emerald":{"__isSmartRef__":true,"id":9010},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9014}},"8890":{"varMapping":{"__isSmartRef__":true,"id":8891},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8892},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8891":{"this":{"__isSmartRef__":true,"id":6726}},"8892":{"timestamp":{"__isSmartRef__":true,"id":8893},"user":"josi","tags":[]},"8893":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"8894":{"varMapping":{"__isSmartRef__":true,"id":8895},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":8900},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8895":{"this":{"__isSmartRef__":true,"id":6726},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":8896}},"8896":{"$super":{"__isSmartRef__":true,"id":8897}},"8897":{"varMapping":{"__isSmartRef__":true,"id":8898},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":8899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8898":{"obj":{"__isSmartRef__":true,"id":6726},"name":"onMouseDown"},"8899":{},"8900":{"timestamp":{"__isSmartRef__":true,"id":8901},"user":"soergel","tags":[]},"8901":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"8902":{"varMapping":{"__isSmartRef__":true,"id":8903},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":8904},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8903":{"this":{"__isSmartRef__":true,"id":6726}},"8904":{"timestamp":{"__isSmartRef__":true,"id":8905},"user":"soergel","tags":[]},"8905":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"8906":{"varMapping":{"__isSmartRef__":true,"id":8907},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":8908},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8907":{"this":{"__isSmartRef__":true,"id":6726}},"8908":{"timestamp":{"__isSmartRef__":true,"id":8909},"user":"josi","tags":["gemtypes"]},"8909":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"8910":{"varMapping":{"__isSmartRef__":true,"id":8911},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":8912},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8911":{"this":{"__isSmartRef__":true,"id":6726}},"8912":{"timestamp":{"__isSmartRef__":true,"id":8913},"user":"jan.sandbrink","tags":[]},"8913":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"8914":{"varMapping":{"__isSmartRef__":true,"id":8915},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8916},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8915":{"this":{"__isSmartRef__":true,"id":6726}},"8916":{"timestamp":{"__isSmartRef__":true,"id":8917},"user":"jan.sandbrink","tags":[]},"8917":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"8918":{"varMapping":{"__isSmartRef__":true,"id":8919},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":8920},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8919":{"this":{"__isSmartRef__":true,"id":6726}},"8920":{"timestamp":{"__isSmartRef__":true,"id":8921},"user":"josi","tags":["gemtypes"]},"8921":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"8922":{"varMapping":{"__isSmartRef__":true,"id":8923},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":8924},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8923":{"this":{"__isSmartRef__":true,"id":6726}},"8924":{"timestamp":{"__isSmartRef__":true,"id":8925},"user":"josi","tags":["gemtypes"]},"8925":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"8926":{"varMapping":{"__isSmartRef__":true,"id":8927},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":8928},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8927":{"this":{"__isSmartRef__":true,"id":6726}},"8928":{"timestamp":{"__isSmartRef__":true,"id":8929},"user":"josi","tags":[]},"8929":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"8930":{"varMapping":{"__isSmartRef__":true,"id":8931},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":8932},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8931":{"this":{"__isSmartRef__":true,"id":6726}},"8932":{"timestamp":{"__isSmartRef__":true,"id":8933},"user":"josi","tags":[]},"8933":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"8934":{"varMapping":{"__isSmartRef__":true,"id":8935},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":8936},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8935":{"this":{"__isSmartRef__":true,"id":6726}},"8936":{"timestamp":{"__isSmartRef__":true,"id":8937},"user":"soergel","tags":[]},"8937":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"8938":{"varMapping":{"__isSmartRef__":true,"id":8939},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":8940},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8939":{"this":{"__isSmartRef__":true,"id":6726}},"8940":{"timestamp":{"__isSmartRef__":true,"id":8941},"user":"soergel","tags":[]},"8941":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"8942":{"varMapping":{"__isSmartRef__":true,"id":8943},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":8944},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8943":{"this":{"__isSmartRef__":true,"id":6726}},"8944":{"timestamp":{"__isSmartRef__":true,"id":8945},"user":"soergel","tags":[]},"8945":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"8946":{"varMapping":{"__isSmartRef__":true,"id":8947},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8948},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8947":{"this":{"__isSmartRef__":true,"id":6726}},"8948":{"timestamp":{"__isSmartRef__":true,"id":8949},"user":"soergel","tags":["debug"]},"8949":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"8950":{"varMapping":{"__isSmartRef__":true,"id":8951},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":8952},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8951":{"this":{"__isSmartRef__":true,"id":6726}},"8952":{"timestamp":{"__isSmartRef__":true,"id":8953},"user":"soergel","tags":["debug"]},"8953":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"8954":{"varMapping":{"__isSmartRef__":true,"id":8955},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":8956},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8955":{"this":{"__isSmartRef__":true,"id":6726}},"8956":{"timestamp":{"__isSmartRef__":true,"id":8957},"user":"jan.sandbrink","tags":[]},"8957":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"8958":{"varMapping":{"__isSmartRef__":true,"id":8959},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8960},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8959":{"this":{"__isSmartRef__":true,"id":6726}},"8960":{"timestamp":{"__isSmartRef__":true,"id":8961},"user":"jan.sandbrink","tags":[]},"8961":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"8962":{"varMapping":{"__isSmartRef__":true,"id":8963},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":8964},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8963":{"this":{"__isSmartRef__":true,"id":6726}},"8964":{"timestamp":{"__isSmartRef__":true,"id":8965},"user":"jan.sandbrink","tags":[]},"8965":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"8966":{"varMapping":{"__isSmartRef__":true,"id":8967},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":8968},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8967":{"this":{"__isSmartRef__":true,"id":6726}},"8968":{"timestamp":{"__isSmartRef__":true,"id":8969},"user":"jan.sandbrink","tags":[]},"8969":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"8970":{"varMapping":{"__isSmartRef__":true,"id":8971},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":8972},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8971":{"this":{"__isSmartRef__":true,"id":6726}},"8972":{"timestamp":{"__isSmartRef__":true,"id":8973},"user":"jan.sandbrink","tags":[]},"8973":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"8974":{"varMapping":{"__isSmartRef__":true,"id":8975},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":8976},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8975":{"this":{"__isSmartRef__":true,"id":6726}},"8976":{"timestamp":{"__isSmartRef__":true,"id":8977},"user":"josi","tags":["gemtypes"]},"8977":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"8978":{"varMapping":{"__isSmartRef__":true,"id":8979},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":8980},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8979":{"this":{"__isSmartRef__":true,"id":6726}},"8980":{"timestamp":{"__isSmartRef__":true,"id":8981},"user":"josi","tags":["gemtypes"]},"8981":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"8982":{"varMapping":{"__isSmartRef__":true,"id":8983},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":8984},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8983":{"this":{"__isSmartRef__":true,"id":6726}},"8984":{"timestamp":{"__isSmartRef__":true,"id":8985},"user":"soergel","tags":["debug"]},"8985":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"8986":{"varMapping":{"__isSmartRef__":true,"id":8987},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":8988},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8987":{"this":{"__isSmartRef__":true,"id":6726}},"8988":{"timestamp":{"__isSmartRef__":true,"id":8989},"user":"soergel","tags":["debug"]},"8989":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"8990":{"varMapping":{"__isSmartRef__":true,"id":8991},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":8992},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8991":{"this":{"__isSmartRef__":true,"id":6726}},"8992":{"timestamp":{"__isSmartRef__":true,"id":8993},"user":"josi","tags":["gemtypes"]},"8993":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"8994":{"varMapping":{"__isSmartRef__":true,"id":8995},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":8996},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8995":{"this":{"__isSmartRef__":true,"id":6726}},"8996":{"timestamp":{"__isSmartRef__":true,"id":8997},"user":"soergel","tags":[]},"8997":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"8998":{"varMapping":{"__isSmartRef__":true,"id":8999},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9000},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"8999":{"this":{"__isSmartRef__":true,"id":6726}},"9000":{"timestamp":{"__isSmartRef__":true,"id":9001},"user":"soergel","tags":[]},"9001":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9002":{"varMapping":{"__isSmartRef__":true,"id":9003},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9004},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9003":{"this":{"__isSmartRef__":true,"id":6726}},"9004":{"timestamp":{"__isSmartRef__":true,"id":9005},"user":"soergel","tags":[]},"9005":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9006":{"varMapping":{"__isSmartRef__":true,"id":9007},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9008},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9007":{"this":{"__isSmartRef__":true,"id":6726}},"9008":{"timestamp":{"__isSmartRef__":true,"id":9009},"user":"josi","tags":["gemtypes"]},"9009":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9010":{"varMapping":{"__isSmartRef__":true,"id":9011},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9012},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9011":{"this":{"__isSmartRef__":true,"id":6726}},"9012":{"timestamp":{"__isSmartRef__":true,"id":9013},"user":"josi","tags":["gemtypes"]},"9013":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9014":{"varMapping":{"__isSmartRef__":true,"id":9015},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9016},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9015":{"this":{"__isSmartRef__":true,"id":6726}},"9016":{"timestamp":{"__isSmartRef__":true,"id":9017},"user":"jan.sandbrink","tags":[]},"9017":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9018":{"become":{"__isSmartRef__":true,"id":9019},"onMouseDown":{"__isSmartRef__":true,"id":9023},"updatePicture":{"__isSmartRef__":true,"id":9031},"ruby":{"__isSmartRef__":true,"id":9035},"switchPositionWith":{"__isSmartRef__":true,"id":9039},"addNeighbour":{"__isSmartRef__":true,"id":9043},"amethyst":{"__isSmartRef__":true,"id":9047},"diopside":{"__isSmartRef__":true,"id":9051},"gemTypes":{"__isSmartRef__":true,"id":9055},"becomeRandomGem":{"__isSmartRef__":true,"id":9059},"mark":{"__isSmartRef__":true,"id":9063},"unmark":{"__isSmartRef__":true,"id":9067},"hasNeighbour":{"__isSmartRef__":true,"id":9071},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9075},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9079},"disappear":{"__isSmartRef__":true,"id":9083},"findStreakStart":{"__isSmartRef__":true,"id":9087},"buildStreak":{"__isSmartRef__":true,"id":9091},"scoreStreak":{"__isSmartRef__":true,"id":9095},"tryToStreak":{"__isSmartRef__":true,"id":9099},"blueDiamond":{"__isSmartRef__":true,"id":9103},"prehnite":{"__isSmartRef__":true,"id":9107},"debugUnmark":{"__isSmartRef__":true,"id":9111},"debugMark":{"__isSmartRef__":true,"id":9115},"citrine":{"__isSmartRef__":true,"id":9119},"move":{"__isSmartRef__":true,"id":9123},"performMovement":{"__isSmartRef__":true,"id":9127},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9131},"zircon":{"__isSmartRef__":true,"id":9135},"emerald":{"__isSmartRef__":true,"id":9139},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9143}},"9019":{"varMapping":{"__isSmartRef__":true,"id":9020},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9021},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9020":{"this":{"__isSmartRef__":true,"id":6594}},"9021":{"timestamp":{"__isSmartRef__":true,"id":9022},"user":"josi","tags":[]},"9022":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9023":{"varMapping":{"__isSmartRef__":true,"id":9024},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9029},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9024":{"this":{"__isSmartRef__":true,"id":6594},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9025}},"9025":{"$super":{"__isSmartRef__":true,"id":9026}},"9026":{"varMapping":{"__isSmartRef__":true,"id":9027},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9028},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9027":{"obj":{"__isSmartRef__":true,"id":6594},"name":"onMouseDown"},"9028":{},"9029":{"timestamp":{"__isSmartRef__":true,"id":9030},"user":"soergel","tags":[]},"9030":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9031":{"varMapping":{"__isSmartRef__":true,"id":9032},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9033},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9032":{"this":{"__isSmartRef__":true,"id":6594}},"9033":{"timestamp":{"__isSmartRef__":true,"id":9034},"user":"soergel","tags":[]},"9034":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9035":{"varMapping":{"__isSmartRef__":true,"id":9036},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9037},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9036":{"this":{"__isSmartRef__":true,"id":6594}},"9037":{"timestamp":{"__isSmartRef__":true,"id":9038},"user":"josi","tags":["gemtypes"]},"9038":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9039":{"varMapping":{"__isSmartRef__":true,"id":9040},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9041},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9040":{"this":{"__isSmartRef__":true,"id":6594}},"9041":{"timestamp":{"__isSmartRef__":true,"id":9042},"user":"jan.sandbrink","tags":[]},"9042":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9043":{"varMapping":{"__isSmartRef__":true,"id":9044},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9045},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9044":{"this":{"__isSmartRef__":true,"id":6594}},"9045":{"timestamp":{"__isSmartRef__":true,"id":9046},"user":"jan.sandbrink","tags":[]},"9046":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9047":{"varMapping":{"__isSmartRef__":true,"id":9048},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9049},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9048":{"this":{"__isSmartRef__":true,"id":6594}},"9049":{"timestamp":{"__isSmartRef__":true,"id":9050},"user":"josi","tags":["gemtypes"]},"9050":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9051":{"varMapping":{"__isSmartRef__":true,"id":9052},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9053},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9052":{"this":{"__isSmartRef__":true,"id":6594}},"9053":{"timestamp":{"__isSmartRef__":true,"id":9054},"user":"josi","tags":["gemtypes"]},"9054":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9055":{"varMapping":{"__isSmartRef__":true,"id":9056},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9057},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9056":{"this":{"__isSmartRef__":true,"id":6594}},"9057":{"timestamp":{"__isSmartRef__":true,"id":9058},"user":"josi","tags":[]},"9058":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9059":{"varMapping":{"__isSmartRef__":true,"id":9060},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9061},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9060":{"this":{"__isSmartRef__":true,"id":6594}},"9061":{"timestamp":{"__isSmartRef__":true,"id":9062},"user":"josi","tags":[]},"9062":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9063":{"varMapping":{"__isSmartRef__":true,"id":9064},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9065},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9064":{"this":{"__isSmartRef__":true,"id":6594}},"9065":{"timestamp":{"__isSmartRef__":true,"id":9066},"user":"soergel","tags":[]},"9066":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9067":{"varMapping":{"__isSmartRef__":true,"id":9068},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9069},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9068":{"this":{"__isSmartRef__":true,"id":6594}},"9069":{"timestamp":{"__isSmartRef__":true,"id":9070},"user":"soergel","tags":[]},"9070":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9071":{"varMapping":{"__isSmartRef__":true,"id":9072},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9073},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9072":{"this":{"__isSmartRef__":true,"id":6594}},"9073":{"timestamp":{"__isSmartRef__":true,"id":9074},"user":"soergel","tags":[]},"9074":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9075":{"varMapping":{"__isSmartRef__":true,"id":9076},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9077},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9076":{"this":{"__isSmartRef__":true,"id":6594}},"9077":{"timestamp":{"__isSmartRef__":true,"id":9078},"user":"soergel","tags":["debug"]},"9078":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9079":{"varMapping":{"__isSmartRef__":true,"id":9080},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9081},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9080":{"this":{"__isSmartRef__":true,"id":6594}},"9081":{"timestamp":{"__isSmartRef__":true,"id":9082},"user":"soergel","tags":["debug"]},"9082":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9083":{"varMapping":{"__isSmartRef__":true,"id":9084},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9085},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9084":{"this":{"__isSmartRef__":true,"id":6594}},"9085":{"timestamp":{"__isSmartRef__":true,"id":9086},"user":"jan.sandbrink","tags":[]},"9086":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9087":{"varMapping":{"__isSmartRef__":true,"id":9088},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9089},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9088":{"this":{"__isSmartRef__":true,"id":6594}},"9089":{"timestamp":{"__isSmartRef__":true,"id":9090},"user":"jan.sandbrink","tags":[]},"9090":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9091":{"varMapping":{"__isSmartRef__":true,"id":9092},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9093},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9092":{"this":{"__isSmartRef__":true,"id":6594}},"9093":{"timestamp":{"__isSmartRef__":true,"id":9094},"user":"jan.sandbrink","tags":[]},"9094":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9095":{"varMapping":{"__isSmartRef__":true,"id":9096},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9097},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9096":{"this":{"__isSmartRef__":true,"id":6594}},"9097":{"timestamp":{"__isSmartRef__":true,"id":9098},"user":"jan.sandbrink","tags":[]},"9098":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9099":{"varMapping":{"__isSmartRef__":true,"id":9100},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9101},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9100":{"this":{"__isSmartRef__":true,"id":6594}},"9101":{"timestamp":{"__isSmartRef__":true,"id":9102},"user":"jan.sandbrink","tags":[]},"9102":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9103":{"varMapping":{"__isSmartRef__":true,"id":9104},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9105},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9104":{"this":{"__isSmartRef__":true,"id":6594}},"9105":{"timestamp":{"__isSmartRef__":true,"id":9106},"user":"josi","tags":["gemtypes"]},"9106":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9107":{"varMapping":{"__isSmartRef__":true,"id":9108},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9109},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9108":{"this":{"__isSmartRef__":true,"id":6594}},"9109":{"timestamp":{"__isSmartRef__":true,"id":9110},"user":"josi","tags":["gemtypes"]},"9110":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9111":{"varMapping":{"__isSmartRef__":true,"id":9112},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9113},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9112":{"this":{"__isSmartRef__":true,"id":6594}},"9113":{"timestamp":{"__isSmartRef__":true,"id":9114},"user":"soergel","tags":["debug"]},"9114":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9115":{"varMapping":{"__isSmartRef__":true,"id":9116},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9117},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9116":{"this":{"__isSmartRef__":true,"id":6594}},"9117":{"timestamp":{"__isSmartRef__":true,"id":9118},"user":"soergel","tags":["debug"]},"9118":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9119":{"varMapping":{"__isSmartRef__":true,"id":9120},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9121},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9120":{"this":{"__isSmartRef__":true,"id":6594}},"9121":{"timestamp":{"__isSmartRef__":true,"id":9122},"user":"josi","tags":["gemtypes"]},"9122":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9123":{"varMapping":{"__isSmartRef__":true,"id":9124},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9125},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9124":{"this":{"__isSmartRef__":true,"id":6594}},"9125":{"timestamp":{"__isSmartRef__":true,"id":9126},"user":"soergel","tags":[]},"9126":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9127":{"varMapping":{"__isSmartRef__":true,"id":9128},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9129},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9128":{"this":{"__isSmartRef__":true,"id":6594}},"9129":{"timestamp":{"__isSmartRef__":true,"id":9130},"user":"soergel","tags":[]},"9130":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9131":{"varMapping":{"__isSmartRef__":true,"id":9132},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9133},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9132":{"this":{"__isSmartRef__":true,"id":6594}},"9133":{"timestamp":{"__isSmartRef__":true,"id":9134},"user":"soergel","tags":[]},"9134":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9135":{"varMapping":{"__isSmartRef__":true,"id":9136},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9137},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9136":{"this":{"__isSmartRef__":true,"id":6594}},"9137":{"timestamp":{"__isSmartRef__":true,"id":9138},"user":"josi","tags":["gemtypes"]},"9138":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9139":{"varMapping":{"__isSmartRef__":true,"id":9140},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9141},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9140":{"this":{"__isSmartRef__":true,"id":6594}},"9141":{"timestamp":{"__isSmartRef__":true,"id":9142},"user":"josi","tags":["gemtypes"]},"9142":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9143":{"varMapping":{"__isSmartRef__":true,"id":9144},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9145},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9144":{"this":{"__isSmartRef__":true,"id":6594}},"9145":{"timestamp":{"__isSmartRef__":true,"id":9146},"user":"jan.sandbrink","tags":[]},"9146":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9147":{"become":{"__isSmartRef__":true,"id":9148},"onMouseDown":{"__isSmartRef__":true,"id":9152},"updatePicture":{"__isSmartRef__":true,"id":9160},"ruby":{"__isSmartRef__":true,"id":9164},"switchPositionWith":{"__isSmartRef__":true,"id":9168},"addNeighbour":{"__isSmartRef__":true,"id":9172},"amethyst":{"__isSmartRef__":true,"id":9176},"diopside":{"__isSmartRef__":true,"id":9180},"gemTypes":{"__isSmartRef__":true,"id":9184},"becomeRandomGem":{"__isSmartRef__":true,"id":9188},"mark":{"__isSmartRef__":true,"id":9192},"unmark":{"__isSmartRef__":true,"id":9196},"hasNeighbour":{"__isSmartRef__":true,"id":9200},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9204},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9208},"disappear":{"__isSmartRef__":true,"id":9212},"findStreakStart":{"__isSmartRef__":true,"id":9216},"buildStreak":{"__isSmartRef__":true,"id":9220},"scoreStreak":{"__isSmartRef__":true,"id":9224},"tryToStreak":{"__isSmartRef__":true,"id":9228},"blueDiamond":{"__isSmartRef__":true,"id":9232},"prehnite":{"__isSmartRef__":true,"id":9236},"debugUnmark":{"__isSmartRef__":true,"id":9240},"debugMark":{"__isSmartRef__":true,"id":9244},"citrine":{"__isSmartRef__":true,"id":9248},"move":{"__isSmartRef__":true,"id":9252},"performMovement":{"__isSmartRef__":true,"id":9256},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9260},"zircon":{"__isSmartRef__":true,"id":9264},"emerald":{"__isSmartRef__":true,"id":9268},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9272}},"9148":{"varMapping":{"__isSmartRef__":true,"id":9149},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9150},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9149":{"this":{"__isSmartRef__":true,"id":6459}},"9150":{"timestamp":{"__isSmartRef__":true,"id":9151},"user":"josi","tags":[]},"9151":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9152":{"varMapping":{"__isSmartRef__":true,"id":9153},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9158},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9153":{"this":{"__isSmartRef__":true,"id":6459},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9154}},"9154":{"$super":{"__isSmartRef__":true,"id":9155}},"9155":{"varMapping":{"__isSmartRef__":true,"id":9156},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9156":{"obj":{"__isSmartRef__":true,"id":6459},"name":"onMouseDown"},"9157":{},"9158":{"timestamp":{"__isSmartRef__":true,"id":9159},"user":"soergel","tags":[]},"9159":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9160":{"varMapping":{"__isSmartRef__":true,"id":9161},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9162},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9161":{"this":{"__isSmartRef__":true,"id":6459}},"9162":{"timestamp":{"__isSmartRef__":true,"id":9163},"user":"soergel","tags":[]},"9163":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9164":{"varMapping":{"__isSmartRef__":true,"id":9165},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9166},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9165":{"this":{"__isSmartRef__":true,"id":6459}},"9166":{"timestamp":{"__isSmartRef__":true,"id":9167},"user":"josi","tags":["gemtypes"]},"9167":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9168":{"varMapping":{"__isSmartRef__":true,"id":9169},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9170},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9169":{"this":{"__isSmartRef__":true,"id":6459}},"9170":{"timestamp":{"__isSmartRef__":true,"id":9171},"user":"jan.sandbrink","tags":[]},"9171":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9172":{"varMapping":{"__isSmartRef__":true,"id":9173},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9174},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9173":{"this":{"__isSmartRef__":true,"id":6459}},"9174":{"timestamp":{"__isSmartRef__":true,"id":9175},"user":"jan.sandbrink","tags":[]},"9175":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9176":{"varMapping":{"__isSmartRef__":true,"id":9177},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9178},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9177":{"this":{"__isSmartRef__":true,"id":6459}},"9178":{"timestamp":{"__isSmartRef__":true,"id":9179},"user":"josi","tags":["gemtypes"]},"9179":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9180":{"varMapping":{"__isSmartRef__":true,"id":9181},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9182},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9181":{"this":{"__isSmartRef__":true,"id":6459}},"9182":{"timestamp":{"__isSmartRef__":true,"id":9183},"user":"josi","tags":["gemtypes"]},"9183":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9184":{"varMapping":{"__isSmartRef__":true,"id":9185},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9186},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9185":{"this":{"__isSmartRef__":true,"id":6459}},"9186":{"timestamp":{"__isSmartRef__":true,"id":9187},"user":"josi","tags":[]},"9187":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9188":{"varMapping":{"__isSmartRef__":true,"id":9189},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9190},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9189":{"this":{"__isSmartRef__":true,"id":6459}},"9190":{"timestamp":{"__isSmartRef__":true,"id":9191},"user":"josi","tags":[]},"9191":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9192":{"varMapping":{"__isSmartRef__":true,"id":9193},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9194},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9193":{"this":{"__isSmartRef__":true,"id":6459}},"9194":{"timestamp":{"__isSmartRef__":true,"id":9195},"user":"soergel","tags":[]},"9195":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9196":{"varMapping":{"__isSmartRef__":true,"id":9197},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9198},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9197":{"this":{"__isSmartRef__":true,"id":6459}},"9198":{"timestamp":{"__isSmartRef__":true,"id":9199},"user":"soergel","tags":[]},"9199":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9200":{"varMapping":{"__isSmartRef__":true,"id":9201},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9202},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9201":{"this":{"__isSmartRef__":true,"id":6459}},"9202":{"timestamp":{"__isSmartRef__":true,"id":9203},"user":"soergel","tags":[]},"9203":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9204":{"varMapping":{"__isSmartRef__":true,"id":9205},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9206},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9205":{"this":{"__isSmartRef__":true,"id":6459}},"9206":{"timestamp":{"__isSmartRef__":true,"id":9207},"user":"soergel","tags":["debug"]},"9207":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9208":{"varMapping":{"__isSmartRef__":true,"id":9209},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9210},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9209":{"this":{"__isSmartRef__":true,"id":6459}},"9210":{"timestamp":{"__isSmartRef__":true,"id":9211},"user":"soergel","tags":["debug"]},"9211":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9212":{"varMapping":{"__isSmartRef__":true,"id":9213},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9214},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9213":{"this":{"__isSmartRef__":true,"id":6459}},"9214":{"timestamp":{"__isSmartRef__":true,"id":9215},"user":"jan.sandbrink","tags":[]},"9215":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9216":{"varMapping":{"__isSmartRef__":true,"id":9217},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9218},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9217":{"this":{"__isSmartRef__":true,"id":6459}},"9218":{"timestamp":{"__isSmartRef__":true,"id":9219},"user":"jan.sandbrink","tags":[]},"9219":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9220":{"varMapping":{"__isSmartRef__":true,"id":9221},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9222},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9221":{"this":{"__isSmartRef__":true,"id":6459}},"9222":{"timestamp":{"__isSmartRef__":true,"id":9223},"user":"jan.sandbrink","tags":[]},"9223":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9224":{"varMapping":{"__isSmartRef__":true,"id":9225},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9226},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9225":{"this":{"__isSmartRef__":true,"id":6459}},"9226":{"timestamp":{"__isSmartRef__":true,"id":9227},"user":"jan.sandbrink","tags":[]},"9227":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9228":{"varMapping":{"__isSmartRef__":true,"id":9229},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9230},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9229":{"this":{"__isSmartRef__":true,"id":6459}},"9230":{"timestamp":{"__isSmartRef__":true,"id":9231},"user":"jan.sandbrink","tags":[]},"9231":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9232":{"varMapping":{"__isSmartRef__":true,"id":9233},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9234},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9233":{"this":{"__isSmartRef__":true,"id":6459}},"9234":{"timestamp":{"__isSmartRef__":true,"id":9235},"user":"josi","tags":["gemtypes"]},"9235":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9236":{"varMapping":{"__isSmartRef__":true,"id":9237},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9238},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9237":{"this":{"__isSmartRef__":true,"id":6459}},"9238":{"timestamp":{"__isSmartRef__":true,"id":9239},"user":"josi","tags":["gemtypes"]},"9239":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9240":{"varMapping":{"__isSmartRef__":true,"id":9241},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9242},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9241":{"this":{"__isSmartRef__":true,"id":6459}},"9242":{"timestamp":{"__isSmartRef__":true,"id":9243},"user":"soergel","tags":["debug"]},"9243":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9244":{"varMapping":{"__isSmartRef__":true,"id":9245},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9246},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9245":{"this":{"__isSmartRef__":true,"id":6459}},"9246":{"timestamp":{"__isSmartRef__":true,"id":9247},"user":"soergel","tags":["debug"]},"9247":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9248":{"varMapping":{"__isSmartRef__":true,"id":9249},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9250},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9249":{"this":{"__isSmartRef__":true,"id":6459}},"9250":{"timestamp":{"__isSmartRef__":true,"id":9251},"user":"josi","tags":["gemtypes"]},"9251":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9252":{"varMapping":{"__isSmartRef__":true,"id":9253},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9254},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9253":{"this":{"__isSmartRef__":true,"id":6459}},"9254":{"timestamp":{"__isSmartRef__":true,"id":9255},"user":"soergel","tags":[]},"9255":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9256":{"varMapping":{"__isSmartRef__":true,"id":9257},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9258},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9257":{"this":{"__isSmartRef__":true,"id":6459}},"9258":{"timestamp":{"__isSmartRef__":true,"id":9259},"user":"soergel","tags":[]},"9259":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9260":{"varMapping":{"__isSmartRef__":true,"id":9261},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9262},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9261":{"this":{"__isSmartRef__":true,"id":6459}},"9262":{"timestamp":{"__isSmartRef__":true,"id":9263},"user":"soergel","tags":[]},"9263":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9264":{"varMapping":{"__isSmartRef__":true,"id":9265},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9266},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9265":{"this":{"__isSmartRef__":true,"id":6459}},"9266":{"timestamp":{"__isSmartRef__":true,"id":9267},"user":"josi","tags":["gemtypes"]},"9267":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9268":{"varMapping":{"__isSmartRef__":true,"id":9269},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9270},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9269":{"this":{"__isSmartRef__":true,"id":6459}},"9270":{"timestamp":{"__isSmartRef__":true,"id":9271},"user":"josi","tags":["gemtypes"]},"9271":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9272":{"varMapping":{"__isSmartRef__":true,"id":9273},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9274},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9273":{"this":{"__isSmartRef__":true,"id":6459}},"9274":{"timestamp":{"__isSmartRef__":true,"id":9275},"user":"jan.sandbrink","tags":[]},"9275":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9276":{"become":{"__isSmartRef__":true,"id":9277},"onMouseDown":{"__isSmartRef__":true,"id":9281},"updatePicture":{"__isSmartRef__":true,"id":9289},"ruby":{"__isSmartRef__":true,"id":9293},"switchPositionWith":{"__isSmartRef__":true,"id":9297},"addNeighbour":{"__isSmartRef__":true,"id":9301},"amethyst":{"__isSmartRef__":true,"id":9305},"diopside":{"__isSmartRef__":true,"id":9309},"gemTypes":{"__isSmartRef__":true,"id":9313},"becomeRandomGem":{"__isSmartRef__":true,"id":9317},"mark":{"__isSmartRef__":true,"id":9321},"unmark":{"__isSmartRef__":true,"id":9325},"hasNeighbour":{"__isSmartRef__":true,"id":9329},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9333},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9337},"disappear":{"__isSmartRef__":true,"id":9341},"findStreakStart":{"__isSmartRef__":true,"id":9345},"buildStreak":{"__isSmartRef__":true,"id":9349},"scoreStreak":{"__isSmartRef__":true,"id":9353},"tryToStreak":{"__isSmartRef__":true,"id":9357},"blueDiamond":{"__isSmartRef__":true,"id":9361},"prehnite":{"__isSmartRef__":true,"id":9365},"debugUnmark":{"__isSmartRef__":true,"id":9369},"debugMark":{"__isSmartRef__":true,"id":9373},"citrine":{"__isSmartRef__":true,"id":9377},"move":{"__isSmartRef__":true,"id":9381},"performMovement":{"__isSmartRef__":true,"id":9385},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9389},"zircon":{"__isSmartRef__":true,"id":9393},"emerald":{"__isSmartRef__":true,"id":9397},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9401}},"9277":{"varMapping":{"__isSmartRef__":true,"id":9278},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9279},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9278":{"this":{"__isSmartRef__":true,"id":6324}},"9279":{"timestamp":{"__isSmartRef__":true,"id":9280},"user":"josi","tags":[]},"9280":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9281":{"varMapping":{"__isSmartRef__":true,"id":9282},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9287},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9282":{"this":{"__isSmartRef__":true,"id":6324},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9283}},"9283":{"$super":{"__isSmartRef__":true,"id":9284}},"9284":{"varMapping":{"__isSmartRef__":true,"id":9285},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9286},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9285":{"obj":{"__isSmartRef__":true,"id":6324},"name":"onMouseDown"},"9286":{},"9287":{"timestamp":{"__isSmartRef__":true,"id":9288},"user":"soergel","tags":[]},"9288":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9289":{"varMapping":{"__isSmartRef__":true,"id":9290},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9291},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9290":{"this":{"__isSmartRef__":true,"id":6324}},"9291":{"timestamp":{"__isSmartRef__":true,"id":9292},"user":"soergel","tags":[]},"9292":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9293":{"varMapping":{"__isSmartRef__":true,"id":9294},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9295},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9294":{"this":{"__isSmartRef__":true,"id":6324}},"9295":{"timestamp":{"__isSmartRef__":true,"id":9296},"user":"josi","tags":["gemtypes"]},"9296":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9297":{"varMapping":{"__isSmartRef__":true,"id":9298},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9299},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9298":{"this":{"__isSmartRef__":true,"id":6324}},"9299":{"timestamp":{"__isSmartRef__":true,"id":9300},"user":"jan.sandbrink","tags":[]},"9300":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9301":{"varMapping":{"__isSmartRef__":true,"id":9302},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9303},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9302":{"this":{"__isSmartRef__":true,"id":6324}},"9303":{"timestamp":{"__isSmartRef__":true,"id":9304},"user":"jan.sandbrink","tags":[]},"9304":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9305":{"varMapping":{"__isSmartRef__":true,"id":9306},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9307},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9306":{"this":{"__isSmartRef__":true,"id":6324}},"9307":{"timestamp":{"__isSmartRef__":true,"id":9308},"user":"josi","tags":["gemtypes"]},"9308":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9309":{"varMapping":{"__isSmartRef__":true,"id":9310},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9311},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9310":{"this":{"__isSmartRef__":true,"id":6324}},"9311":{"timestamp":{"__isSmartRef__":true,"id":9312},"user":"josi","tags":["gemtypes"]},"9312":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9313":{"varMapping":{"__isSmartRef__":true,"id":9314},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9315},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9314":{"this":{"__isSmartRef__":true,"id":6324}},"9315":{"timestamp":{"__isSmartRef__":true,"id":9316},"user":"josi","tags":[]},"9316":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9317":{"varMapping":{"__isSmartRef__":true,"id":9318},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9319},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9318":{"this":{"__isSmartRef__":true,"id":6324}},"9319":{"timestamp":{"__isSmartRef__":true,"id":9320},"user":"josi","tags":[]},"9320":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9321":{"varMapping":{"__isSmartRef__":true,"id":9322},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9323},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9322":{"this":{"__isSmartRef__":true,"id":6324}},"9323":{"timestamp":{"__isSmartRef__":true,"id":9324},"user":"soergel","tags":[]},"9324":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9325":{"varMapping":{"__isSmartRef__":true,"id":9326},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9327},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9326":{"this":{"__isSmartRef__":true,"id":6324}},"9327":{"timestamp":{"__isSmartRef__":true,"id":9328},"user":"soergel","tags":[]},"9328":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9329":{"varMapping":{"__isSmartRef__":true,"id":9330},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9331},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9330":{"this":{"__isSmartRef__":true,"id":6324}},"9331":{"timestamp":{"__isSmartRef__":true,"id":9332},"user":"soergel","tags":[]},"9332":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9333":{"varMapping":{"__isSmartRef__":true,"id":9334},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9335},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9334":{"this":{"__isSmartRef__":true,"id":6324}},"9335":{"timestamp":{"__isSmartRef__":true,"id":9336},"user":"soergel","tags":["debug"]},"9336":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9337":{"varMapping":{"__isSmartRef__":true,"id":9338},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9339},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9338":{"this":{"__isSmartRef__":true,"id":6324}},"9339":{"timestamp":{"__isSmartRef__":true,"id":9340},"user":"soergel","tags":["debug"]},"9340":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9341":{"varMapping":{"__isSmartRef__":true,"id":9342},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9343},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9342":{"this":{"__isSmartRef__":true,"id":6324}},"9343":{"timestamp":{"__isSmartRef__":true,"id":9344},"user":"jan.sandbrink","tags":[]},"9344":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9345":{"varMapping":{"__isSmartRef__":true,"id":9346},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9347},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9346":{"this":{"__isSmartRef__":true,"id":6324}},"9347":{"timestamp":{"__isSmartRef__":true,"id":9348},"user":"jan.sandbrink","tags":[]},"9348":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9349":{"varMapping":{"__isSmartRef__":true,"id":9350},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9351},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9350":{"this":{"__isSmartRef__":true,"id":6324}},"9351":{"timestamp":{"__isSmartRef__":true,"id":9352},"user":"jan.sandbrink","tags":[]},"9352":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9353":{"varMapping":{"__isSmartRef__":true,"id":9354},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9355},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9354":{"this":{"__isSmartRef__":true,"id":6324}},"9355":{"timestamp":{"__isSmartRef__":true,"id":9356},"user":"jan.sandbrink","tags":[]},"9356":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9357":{"varMapping":{"__isSmartRef__":true,"id":9358},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9359},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9358":{"this":{"__isSmartRef__":true,"id":6324}},"9359":{"timestamp":{"__isSmartRef__":true,"id":9360},"user":"jan.sandbrink","tags":[]},"9360":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9361":{"varMapping":{"__isSmartRef__":true,"id":9362},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9363},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9362":{"this":{"__isSmartRef__":true,"id":6324}},"9363":{"timestamp":{"__isSmartRef__":true,"id":9364},"user":"josi","tags":["gemtypes"]},"9364":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9365":{"varMapping":{"__isSmartRef__":true,"id":9366},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9367},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9366":{"this":{"__isSmartRef__":true,"id":6324}},"9367":{"timestamp":{"__isSmartRef__":true,"id":9368},"user":"josi","tags":["gemtypes"]},"9368":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9369":{"varMapping":{"__isSmartRef__":true,"id":9370},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9371},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9370":{"this":{"__isSmartRef__":true,"id":6324}},"9371":{"timestamp":{"__isSmartRef__":true,"id":9372},"user":"soergel","tags":["debug"]},"9372":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9373":{"varMapping":{"__isSmartRef__":true,"id":9374},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9375},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9374":{"this":{"__isSmartRef__":true,"id":6324}},"9375":{"timestamp":{"__isSmartRef__":true,"id":9376},"user":"soergel","tags":["debug"]},"9376":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9377":{"varMapping":{"__isSmartRef__":true,"id":9378},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9379},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9378":{"this":{"__isSmartRef__":true,"id":6324}},"9379":{"timestamp":{"__isSmartRef__":true,"id":9380},"user":"josi","tags":["gemtypes"]},"9380":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9381":{"varMapping":{"__isSmartRef__":true,"id":9382},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9383},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9382":{"this":{"__isSmartRef__":true,"id":6324}},"9383":{"timestamp":{"__isSmartRef__":true,"id":9384},"user":"soergel","tags":[]},"9384":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9385":{"varMapping":{"__isSmartRef__":true,"id":9386},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9387},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9386":{"this":{"__isSmartRef__":true,"id":6324}},"9387":{"timestamp":{"__isSmartRef__":true,"id":9388},"user":"soergel","tags":[]},"9388":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9389":{"varMapping":{"__isSmartRef__":true,"id":9390},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9391},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9390":{"this":{"__isSmartRef__":true,"id":6324}},"9391":{"timestamp":{"__isSmartRef__":true,"id":9392},"user":"soergel","tags":[]},"9392":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9393":{"varMapping":{"__isSmartRef__":true,"id":9394},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9395},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9394":{"this":{"__isSmartRef__":true,"id":6324}},"9395":{"timestamp":{"__isSmartRef__":true,"id":9396},"user":"josi","tags":["gemtypes"]},"9396":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9397":{"varMapping":{"__isSmartRef__":true,"id":9398},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9399},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9398":{"this":{"__isSmartRef__":true,"id":6324}},"9399":{"timestamp":{"__isSmartRef__":true,"id":9400},"user":"josi","tags":["gemtypes"]},"9400":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9401":{"varMapping":{"__isSmartRef__":true,"id":9402},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9403},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9402":{"this":{"__isSmartRef__":true,"id":6324}},"9403":{"timestamp":{"__isSmartRef__":true,"id":9404},"user":"jan.sandbrink","tags":[]},"9404":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9405":{"become":{"__isSmartRef__":true,"id":9406},"onMouseDown":{"__isSmartRef__":true,"id":9410},"updatePicture":{"__isSmartRef__":true,"id":9418},"ruby":{"__isSmartRef__":true,"id":9422},"switchPositionWith":{"__isSmartRef__":true,"id":9426},"addNeighbour":{"__isSmartRef__":true,"id":9430},"amethyst":{"__isSmartRef__":true,"id":9434},"diopside":{"__isSmartRef__":true,"id":9438},"gemTypes":{"__isSmartRef__":true,"id":9442},"becomeRandomGem":{"__isSmartRef__":true,"id":9446},"mark":{"__isSmartRef__":true,"id":9450},"unmark":{"__isSmartRef__":true,"id":9454},"hasNeighbour":{"__isSmartRef__":true,"id":9458},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9462},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9466},"disappear":{"__isSmartRef__":true,"id":9470},"findStreakStart":{"__isSmartRef__":true,"id":9474},"buildStreak":{"__isSmartRef__":true,"id":9478},"scoreStreak":{"__isSmartRef__":true,"id":9482},"tryToStreak":{"__isSmartRef__":true,"id":9486},"blueDiamond":{"__isSmartRef__":true,"id":9490},"prehnite":{"__isSmartRef__":true,"id":9494},"debugUnmark":{"__isSmartRef__":true,"id":9498},"debugMark":{"__isSmartRef__":true,"id":9502},"citrine":{"__isSmartRef__":true,"id":9506},"move":{"__isSmartRef__":true,"id":9510},"performMovement":{"__isSmartRef__":true,"id":9514},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9518},"zircon":{"__isSmartRef__":true,"id":9522},"emerald":{"__isSmartRef__":true,"id":9526},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9530}},"9406":{"varMapping":{"__isSmartRef__":true,"id":9407},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9408},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9407":{"this":{"__isSmartRef__":true,"id":6206}},"9408":{"timestamp":{"__isSmartRef__":true,"id":9409},"user":"josi","tags":[]},"9409":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9410":{"varMapping":{"__isSmartRef__":true,"id":9411},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9416},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9411":{"this":{"__isSmartRef__":true,"id":6206},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9412}},"9412":{"$super":{"__isSmartRef__":true,"id":9413}},"9413":{"varMapping":{"__isSmartRef__":true,"id":9414},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9414":{"obj":{"__isSmartRef__":true,"id":6206},"name":"onMouseDown"},"9415":{},"9416":{"timestamp":{"__isSmartRef__":true,"id":9417},"user":"soergel","tags":[]},"9417":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9418":{"varMapping":{"__isSmartRef__":true,"id":9419},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9420},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9419":{"this":{"__isSmartRef__":true,"id":6206}},"9420":{"timestamp":{"__isSmartRef__":true,"id":9421},"user":"soergel","tags":[]},"9421":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9422":{"varMapping":{"__isSmartRef__":true,"id":9423},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9424},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9423":{"this":{"__isSmartRef__":true,"id":6206}},"9424":{"timestamp":{"__isSmartRef__":true,"id":9425},"user":"josi","tags":["gemtypes"]},"9425":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9426":{"varMapping":{"__isSmartRef__":true,"id":9427},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9428},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9427":{"this":{"__isSmartRef__":true,"id":6206}},"9428":{"timestamp":{"__isSmartRef__":true,"id":9429},"user":"jan.sandbrink","tags":[]},"9429":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9430":{"varMapping":{"__isSmartRef__":true,"id":9431},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9432},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9431":{"this":{"__isSmartRef__":true,"id":6206}},"9432":{"timestamp":{"__isSmartRef__":true,"id":9433},"user":"jan.sandbrink","tags":[]},"9433":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9434":{"varMapping":{"__isSmartRef__":true,"id":9435},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9436},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9435":{"this":{"__isSmartRef__":true,"id":6206}},"9436":{"timestamp":{"__isSmartRef__":true,"id":9437},"user":"josi","tags":["gemtypes"]},"9437":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9438":{"varMapping":{"__isSmartRef__":true,"id":9439},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9440},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9439":{"this":{"__isSmartRef__":true,"id":6206}},"9440":{"timestamp":{"__isSmartRef__":true,"id":9441},"user":"josi","tags":["gemtypes"]},"9441":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9442":{"varMapping":{"__isSmartRef__":true,"id":9443},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9444},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9443":{"this":{"__isSmartRef__":true,"id":6206}},"9444":{"timestamp":{"__isSmartRef__":true,"id":9445},"user":"josi","tags":[]},"9445":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9446":{"varMapping":{"__isSmartRef__":true,"id":9447},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9448},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9447":{"this":{"__isSmartRef__":true,"id":6206}},"9448":{"timestamp":{"__isSmartRef__":true,"id":9449},"user":"josi","tags":[]},"9449":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9450":{"varMapping":{"__isSmartRef__":true,"id":9451},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9452},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9451":{"this":{"__isSmartRef__":true,"id":6206}},"9452":{"timestamp":{"__isSmartRef__":true,"id":9453},"user":"soergel","tags":[]},"9453":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9454":{"varMapping":{"__isSmartRef__":true,"id":9455},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9456},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9455":{"this":{"__isSmartRef__":true,"id":6206}},"9456":{"timestamp":{"__isSmartRef__":true,"id":9457},"user":"soergel","tags":[]},"9457":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9458":{"varMapping":{"__isSmartRef__":true,"id":9459},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9460},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9459":{"this":{"__isSmartRef__":true,"id":6206}},"9460":{"timestamp":{"__isSmartRef__":true,"id":9461},"user":"soergel","tags":[]},"9461":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9462":{"varMapping":{"__isSmartRef__":true,"id":9463},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9464},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9463":{"this":{"__isSmartRef__":true,"id":6206}},"9464":{"timestamp":{"__isSmartRef__":true,"id":9465},"user":"soergel","tags":["debug"]},"9465":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9466":{"varMapping":{"__isSmartRef__":true,"id":9467},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9468},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9467":{"this":{"__isSmartRef__":true,"id":6206}},"9468":{"timestamp":{"__isSmartRef__":true,"id":9469},"user":"soergel","tags":["debug"]},"9469":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9470":{"varMapping":{"__isSmartRef__":true,"id":9471},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9472},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9471":{"this":{"__isSmartRef__":true,"id":6206}},"9472":{"timestamp":{"__isSmartRef__":true,"id":9473},"user":"jan.sandbrink","tags":[]},"9473":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9474":{"varMapping":{"__isSmartRef__":true,"id":9475},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9476},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9475":{"this":{"__isSmartRef__":true,"id":6206}},"9476":{"timestamp":{"__isSmartRef__":true,"id":9477},"user":"jan.sandbrink","tags":[]},"9477":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9478":{"varMapping":{"__isSmartRef__":true,"id":9479},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9480},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9479":{"this":{"__isSmartRef__":true,"id":6206}},"9480":{"timestamp":{"__isSmartRef__":true,"id":9481},"user":"jan.sandbrink","tags":[]},"9481":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9482":{"varMapping":{"__isSmartRef__":true,"id":9483},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9484},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9483":{"this":{"__isSmartRef__":true,"id":6206}},"9484":{"timestamp":{"__isSmartRef__":true,"id":9485},"user":"jan.sandbrink","tags":[]},"9485":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9486":{"varMapping":{"__isSmartRef__":true,"id":9487},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9488},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9487":{"this":{"__isSmartRef__":true,"id":6206}},"9488":{"timestamp":{"__isSmartRef__":true,"id":9489},"user":"jan.sandbrink","tags":[]},"9489":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9490":{"varMapping":{"__isSmartRef__":true,"id":9491},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9492},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9491":{"this":{"__isSmartRef__":true,"id":6206}},"9492":{"timestamp":{"__isSmartRef__":true,"id":9493},"user":"josi","tags":["gemtypes"]},"9493":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9494":{"varMapping":{"__isSmartRef__":true,"id":9495},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9496},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9495":{"this":{"__isSmartRef__":true,"id":6206}},"9496":{"timestamp":{"__isSmartRef__":true,"id":9497},"user":"josi","tags":["gemtypes"]},"9497":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9498":{"varMapping":{"__isSmartRef__":true,"id":9499},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9500},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9499":{"this":{"__isSmartRef__":true,"id":6206}},"9500":{"timestamp":{"__isSmartRef__":true,"id":9501},"user":"soergel","tags":["debug"]},"9501":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9502":{"varMapping":{"__isSmartRef__":true,"id":9503},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9504},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9503":{"this":{"__isSmartRef__":true,"id":6206}},"9504":{"timestamp":{"__isSmartRef__":true,"id":9505},"user":"soergel","tags":["debug"]},"9505":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9506":{"varMapping":{"__isSmartRef__":true,"id":9507},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9508},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9507":{"this":{"__isSmartRef__":true,"id":6206}},"9508":{"timestamp":{"__isSmartRef__":true,"id":9509},"user":"josi","tags":["gemtypes"]},"9509":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9510":{"varMapping":{"__isSmartRef__":true,"id":9511},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9512},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9511":{"this":{"__isSmartRef__":true,"id":6206}},"9512":{"timestamp":{"__isSmartRef__":true,"id":9513},"user":"soergel","tags":[]},"9513":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9514":{"varMapping":{"__isSmartRef__":true,"id":9515},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9516},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9515":{"this":{"__isSmartRef__":true,"id":6206}},"9516":{"timestamp":{"__isSmartRef__":true,"id":9517},"user":"soergel","tags":[]},"9517":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9518":{"varMapping":{"__isSmartRef__":true,"id":9519},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9520},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9519":{"this":{"__isSmartRef__":true,"id":6206}},"9520":{"timestamp":{"__isSmartRef__":true,"id":9521},"user":"soergel","tags":[]},"9521":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9522":{"varMapping":{"__isSmartRef__":true,"id":9523},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9524},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9523":{"this":{"__isSmartRef__":true,"id":6206}},"9524":{"timestamp":{"__isSmartRef__":true,"id":9525},"user":"josi","tags":["gemtypes"]},"9525":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9526":{"varMapping":{"__isSmartRef__":true,"id":9527},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9528},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9527":{"this":{"__isSmartRef__":true,"id":6206}},"9528":{"timestamp":{"__isSmartRef__":true,"id":9529},"user":"josi","tags":["gemtypes"]},"9529":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9530":{"varMapping":{"__isSmartRef__":true,"id":9531},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9532},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9531":{"this":{"__isSmartRef__":true,"id":6206}},"9532":{"timestamp":{"__isSmartRef__":true,"id":9533},"user":"jan.sandbrink","tags":[]},"9533":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9534":{"become":{"__isSmartRef__":true,"id":9535},"onMouseDown":{"__isSmartRef__":true,"id":9539},"updatePicture":{"__isSmartRef__":true,"id":9547},"ruby":{"__isSmartRef__":true,"id":9551},"switchPositionWith":{"__isSmartRef__":true,"id":9555},"addNeighbour":{"__isSmartRef__":true,"id":9559},"amethyst":{"__isSmartRef__":true,"id":9563},"diopside":{"__isSmartRef__":true,"id":9567},"gemTypes":{"__isSmartRef__":true,"id":9571},"becomeRandomGem":{"__isSmartRef__":true,"id":9575},"mark":{"__isSmartRef__":true,"id":9579},"unmark":{"__isSmartRef__":true,"id":9583},"hasNeighbour":{"__isSmartRef__":true,"id":9587},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9591},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9595},"disappear":{"__isSmartRef__":true,"id":9599},"findStreakStart":{"__isSmartRef__":true,"id":9603},"buildStreak":{"__isSmartRef__":true,"id":9607},"scoreStreak":{"__isSmartRef__":true,"id":9611},"tryToStreak":{"__isSmartRef__":true,"id":9615},"blueDiamond":{"__isSmartRef__":true,"id":9619},"prehnite":{"__isSmartRef__":true,"id":9623},"debugUnmark":{"__isSmartRef__":true,"id":9627},"debugMark":{"__isSmartRef__":true,"id":9631},"citrine":{"__isSmartRef__":true,"id":9635},"move":{"__isSmartRef__":true,"id":9639},"performMovement":{"__isSmartRef__":true,"id":9643},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9647},"zircon":{"__isSmartRef__":true,"id":9651},"emerald":{"__isSmartRef__":true,"id":9655},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9659}},"9535":{"varMapping":{"__isSmartRef__":true,"id":9536},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9537},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9536":{"this":{"__isSmartRef__":true,"id":6074}},"9537":{"timestamp":{"__isSmartRef__":true,"id":9538},"user":"josi","tags":[]},"9538":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9539":{"varMapping":{"__isSmartRef__":true,"id":9540},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9545},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9540":{"this":{"__isSmartRef__":true,"id":6074},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9541}},"9541":{"$super":{"__isSmartRef__":true,"id":9542}},"9542":{"varMapping":{"__isSmartRef__":true,"id":9543},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9544},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9543":{"obj":{"__isSmartRef__":true,"id":6074},"name":"onMouseDown"},"9544":{},"9545":{"timestamp":{"__isSmartRef__":true,"id":9546},"user":"soergel","tags":[]},"9546":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9547":{"varMapping":{"__isSmartRef__":true,"id":9548},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9549},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9548":{"this":{"__isSmartRef__":true,"id":6074}},"9549":{"timestamp":{"__isSmartRef__":true,"id":9550},"user":"soergel","tags":[]},"9550":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9551":{"varMapping":{"__isSmartRef__":true,"id":9552},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9553},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9552":{"this":{"__isSmartRef__":true,"id":6074}},"9553":{"timestamp":{"__isSmartRef__":true,"id":9554},"user":"josi","tags":["gemtypes"]},"9554":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9555":{"varMapping":{"__isSmartRef__":true,"id":9556},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9557},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9556":{"this":{"__isSmartRef__":true,"id":6074}},"9557":{"timestamp":{"__isSmartRef__":true,"id":9558},"user":"jan.sandbrink","tags":[]},"9558":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9559":{"varMapping":{"__isSmartRef__":true,"id":9560},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9561},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9560":{"this":{"__isSmartRef__":true,"id":6074}},"9561":{"timestamp":{"__isSmartRef__":true,"id":9562},"user":"jan.sandbrink","tags":[]},"9562":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9563":{"varMapping":{"__isSmartRef__":true,"id":9564},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9565},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9564":{"this":{"__isSmartRef__":true,"id":6074}},"9565":{"timestamp":{"__isSmartRef__":true,"id":9566},"user":"josi","tags":["gemtypes"]},"9566":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9567":{"varMapping":{"__isSmartRef__":true,"id":9568},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9569},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9568":{"this":{"__isSmartRef__":true,"id":6074}},"9569":{"timestamp":{"__isSmartRef__":true,"id":9570},"user":"josi","tags":["gemtypes"]},"9570":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9571":{"varMapping":{"__isSmartRef__":true,"id":9572},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9573},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9572":{"this":{"__isSmartRef__":true,"id":6074}},"9573":{"timestamp":{"__isSmartRef__":true,"id":9574},"user":"josi","tags":[]},"9574":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9575":{"varMapping":{"__isSmartRef__":true,"id":9576},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9577},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9576":{"this":{"__isSmartRef__":true,"id":6074}},"9577":{"timestamp":{"__isSmartRef__":true,"id":9578},"user":"josi","tags":[]},"9578":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9579":{"varMapping":{"__isSmartRef__":true,"id":9580},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9581},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9580":{"this":{"__isSmartRef__":true,"id":6074}},"9581":{"timestamp":{"__isSmartRef__":true,"id":9582},"user":"soergel","tags":[]},"9582":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9583":{"varMapping":{"__isSmartRef__":true,"id":9584},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9585},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9584":{"this":{"__isSmartRef__":true,"id":6074}},"9585":{"timestamp":{"__isSmartRef__":true,"id":9586},"user":"soergel","tags":[]},"9586":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9587":{"varMapping":{"__isSmartRef__":true,"id":9588},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9589},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9588":{"this":{"__isSmartRef__":true,"id":6074}},"9589":{"timestamp":{"__isSmartRef__":true,"id":9590},"user":"soergel","tags":[]},"9590":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9591":{"varMapping":{"__isSmartRef__":true,"id":9592},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9593},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9592":{"this":{"__isSmartRef__":true,"id":6074}},"9593":{"timestamp":{"__isSmartRef__":true,"id":9594},"user":"soergel","tags":["debug"]},"9594":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9595":{"varMapping":{"__isSmartRef__":true,"id":9596},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9597},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9596":{"this":{"__isSmartRef__":true,"id":6074}},"9597":{"timestamp":{"__isSmartRef__":true,"id":9598},"user":"soergel","tags":["debug"]},"9598":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9599":{"varMapping":{"__isSmartRef__":true,"id":9600},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9601},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9600":{"this":{"__isSmartRef__":true,"id":6074}},"9601":{"timestamp":{"__isSmartRef__":true,"id":9602},"user":"jan.sandbrink","tags":[]},"9602":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9603":{"varMapping":{"__isSmartRef__":true,"id":9604},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9605},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9604":{"this":{"__isSmartRef__":true,"id":6074}},"9605":{"timestamp":{"__isSmartRef__":true,"id":9606},"user":"jan.sandbrink","tags":[]},"9606":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9607":{"varMapping":{"__isSmartRef__":true,"id":9608},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9609},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9608":{"this":{"__isSmartRef__":true,"id":6074}},"9609":{"timestamp":{"__isSmartRef__":true,"id":9610},"user":"jan.sandbrink","tags":[]},"9610":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9611":{"varMapping":{"__isSmartRef__":true,"id":9612},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9613},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9612":{"this":{"__isSmartRef__":true,"id":6074}},"9613":{"timestamp":{"__isSmartRef__":true,"id":9614},"user":"jan.sandbrink","tags":[]},"9614":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9615":{"varMapping":{"__isSmartRef__":true,"id":9616},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9617},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9616":{"this":{"__isSmartRef__":true,"id":6074}},"9617":{"timestamp":{"__isSmartRef__":true,"id":9618},"user":"jan.sandbrink","tags":[]},"9618":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9619":{"varMapping":{"__isSmartRef__":true,"id":9620},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9621},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9620":{"this":{"__isSmartRef__":true,"id":6074}},"9621":{"timestamp":{"__isSmartRef__":true,"id":9622},"user":"josi","tags":["gemtypes"]},"9622":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9623":{"varMapping":{"__isSmartRef__":true,"id":9624},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9625},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9624":{"this":{"__isSmartRef__":true,"id":6074}},"9625":{"timestamp":{"__isSmartRef__":true,"id":9626},"user":"josi","tags":["gemtypes"]},"9626":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9627":{"varMapping":{"__isSmartRef__":true,"id":9628},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9629},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9628":{"this":{"__isSmartRef__":true,"id":6074}},"9629":{"timestamp":{"__isSmartRef__":true,"id":9630},"user":"soergel","tags":["debug"]},"9630":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9631":{"varMapping":{"__isSmartRef__":true,"id":9632},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9633},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9632":{"this":{"__isSmartRef__":true,"id":6074}},"9633":{"timestamp":{"__isSmartRef__":true,"id":9634},"user":"soergel","tags":["debug"]},"9634":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9635":{"varMapping":{"__isSmartRef__":true,"id":9636},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9637},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9636":{"this":{"__isSmartRef__":true,"id":6074}},"9637":{"timestamp":{"__isSmartRef__":true,"id":9638},"user":"josi","tags":["gemtypes"]},"9638":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9639":{"varMapping":{"__isSmartRef__":true,"id":9640},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9641},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9640":{"this":{"__isSmartRef__":true,"id":6074}},"9641":{"timestamp":{"__isSmartRef__":true,"id":9642},"user":"soergel","tags":[]},"9642":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9643":{"varMapping":{"__isSmartRef__":true,"id":9644},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9645},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9644":{"this":{"__isSmartRef__":true,"id":6074}},"9645":{"timestamp":{"__isSmartRef__":true,"id":9646},"user":"soergel","tags":[]},"9646":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9647":{"varMapping":{"__isSmartRef__":true,"id":9648},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9649},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9648":{"this":{"__isSmartRef__":true,"id":6074}},"9649":{"timestamp":{"__isSmartRef__":true,"id":9650},"user":"soergel","tags":[]},"9650":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9651":{"varMapping":{"__isSmartRef__":true,"id":9652},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9653},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9652":{"this":{"__isSmartRef__":true,"id":6074}},"9653":{"timestamp":{"__isSmartRef__":true,"id":9654},"user":"josi","tags":["gemtypes"]},"9654":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9655":{"varMapping":{"__isSmartRef__":true,"id":9656},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9657},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9656":{"this":{"__isSmartRef__":true,"id":6074}},"9657":{"timestamp":{"__isSmartRef__":true,"id":9658},"user":"josi","tags":["gemtypes"]},"9658":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9659":{"varMapping":{"__isSmartRef__":true,"id":9660},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9661},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9660":{"this":{"__isSmartRef__":true,"id":6074}},"9661":{"timestamp":{"__isSmartRef__":true,"id":9662},"user":"jan.sandbrink","tags":[]},"9662":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9663":{"become":{"__isSmartRef__":true,"id":9664},"onMouseDown":{"__isSmartRef__":true,"id":9668},"updatePicture":{"__isSmartRef__":true,"id":9676},"ruby":{"__isSmartRef__":true,"id":9680},"switchPositionWith":{"__isSmartRef__":true,"id":9684},"addNeighbour":{"__isSmartRef__":true,"id":9688},"amethyst":{"__isSmartRef__":true,"id":9692},"diopside":{"__isSmartRef__":true,"id":9696},"gemTypes":{"__isSmartRef__":true,"id":9700},"becomeRandomGem":{"__isSmartRef__":true,"id":9704},"mark":{"__isSmartRef__":true,"id":9708},"unmark":{"__isSmartRef__":true,"id":9712},"hasNeighbour":{"__isSmartRef__":true,"id":9716},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9720},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9724},"disappear":{"__isSmartRef__":true,"id":9728},"findStreakStart":{"__isSmartRef__":true,"id":9732},"buildStreak":{"__isSmartRef__":true,"id":9736},"scoreStreak":{"__isSmartRef__":true,"id":9740},"tryToStreak":{"__isSmartRef__":true,"id":9744},"blueDiamond":{"__isSmartRef__":true,"id":9748},"prehnite":{"__isSmartRef__":true,"id":9752},"debugUnmark":{"__isSmartRef__":true,"id":9756},"debugMark":{"__isSmartRef__":true,"id":9760},"citrine":{"__isSmartRef__":true,"id":9764},"move":{"__isSmartRef__":true,"id":9768},"performMovement":{"__isSmartRef__":true,"id":9772},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9776},"zircon":{"__isSmartRef__":true,"id":9780},"emerald":{"__isSmartRef__":true,"id":9784},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9788}},"9664":{"varMapping":{"__isSmartRef__":true,"id":9665},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9666},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9665":{"this":{"__isSmartRef__":true,"id":5942}},"9666":{"timestamp":{"__isSmartRef__":true,"id":9667},"user":"josi","tags":[]},"9667":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9668":{"varMapping":{"__isSmartRef__":true,"id":9669},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9674},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9669":{"this":{"__isSmartRef__":true,"id":5942},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9670}},"9670":{"$super":{"__isSmartRef__":true,"id":9671}},"9671":{"varMapping":{"__isSmartRef__":true,"id":9672},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9673},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9672":{"obj":{"__isSmartRef__":true,"id":5942},"name":"onMouseDown"},"9673":{},"9674":{"timestamp":{"__isSmartRef__":true,"id":9675},"user":"soergel","tags":[]},"9675":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9676":{"varMapping":{"__isSmartRef__":true,"id":9677},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9678},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9677":{"this":{"__isSmartRef__":true,"id":5942}},"9678":{"timestamp":{"__isSmartRef__":true,"id":9679},"user":"soergel","tags":[]},"9679":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9680":{"varMapping":{"__isSmartRef__":true,"id":9681},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9682},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9681":{"this":{"__isSmartRef__":true,"id":5942}},"9682":{"timestamp":{"__isSmartRef__":true,"id":9683},"user":"josi","tags":["gemtypes"]},"9683":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9684":{"varMapping":{"__isSmartRef__":true,"id":9685},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9686},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9685":{"this":{"__isSmartRef__":true,"id":5942}},"9686":{"timestamp":{"__isSmartRef__":true,"id":9687},"user":"jan.sandbrink","tags":[]},"9687":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9688":{"varMapping":{"__isSmartRef__":true,"id":9689},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9690},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9689":{"this":{"__isSmartRef__":true,"id":5942}},"9690":{"timestamp":{"__isSmartRef__":true,"id":9691},"user":"jan.sandbrink","tags":[]},"9691":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9692":{"varMapping":{"__isSmartRef__":true,"id":9693},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9694},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9693":{"this":{"__isSmartRef__":true,"id":5942}},"9694":{"timestamp":{"__isSmartRef__":true,"id":9695},"user":"josi","tags":["gemtypes"]},"9695":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9696":{"varMapping":{"__isSmartRef__":true,"id":9697},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9698},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9697":{"this":{"__isSmartRef__":true,"id":5942}},"9698":{"timestamp":{"__isSmartRef__":true,"id":9699},"user":"josi","tags":["gemtypes"]},"9699":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9700":{"varMapping":{"__isSmartRef__":true,"id":9701},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9702},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9701":{"this":{"__isSmartRef__":true,"id":5942}},"9702":{"timestamp":{"__isSmartRef__":true,"id":9703},"user":"josi","tags":[]},"9703":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9704":{"varMapping":{"__isSmartRef__":true,"id":9705},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9706},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9705":{"this":{"__isSmartRef__":true,"id":5942}},"9706":{"timestamp":{"__isSmartRef__":true,"id":9707},"user":"josi","tags":[]},"9707":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9708":{"varMapping":{"__isSmartRef__":true,"id":9709},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9710},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9709":{"this":{"__isSmartRef__":true,"id":5942}},"9710":{"timestamp":{"__isSmartRef__":true,"id":9711},"user":"soergel","tags":[]},"9711":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9712":{"varMapping":{"__isSmartRef__":true,"id":9713},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9714},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9713":{"this":{"__isSmartRef__":true,"id":5942}},"9714":{"timestamp":{"__isSmartRef__":true,"id":9715},"user":"soergel","tags":[]},"9715":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9716":{"varMapping":{"__isSmartRef__":true,"id":9717},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9718},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9717":{"this":{"__isSmartRef__":true,"id":5942}},"9718":{"timestamp":{"__isSmartRef__":true,"id":9719},"user":"soergel","tags":[]},"9719":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9720":{"varMapping":{"__isSmartRef__":true,"id":9721},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9722},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9721":{"this":{"__isSmartRef__":true,"id":5942}},"9722":{"timestamp":{"__isSmartRef__":true,"id":9723},"user":"soergel","tags":["debug"]},"9723":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9724":{"varMapping":{"__isSmartRef__":true,"id":9725},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9726},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9725":{"this":{"__isSmartRef__":true,"id":5942}},"9726":{"timestamp":{"__isSmartRef__":true,"id":9727},"user":"soergel","tags":["debug"]},"9727":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9728":{"varMapping":{"__isSmartRef__":true,"id":9729},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9730},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9729":{"this":{"__isSmartRef__":true,"id":5942}},"9730":{"timestamp":{"__isSmartRef__":true,"id":9731},"user":"jan.sandbrink","tags":[]},"9731":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9732":{"varMapping":{"__isSmartRef__":true,"id":9733},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9734},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9733":{"this":{"__isSmartRef__":true,"id":5942}},"9734":{"timestamp":{"__isSmartRef__":true,"id":9735},"user":"jan.sandbrink","tags":[]},"9735":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9736":{"varMapping":{"__isSmartRef__":true,"id":9737},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9738},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9737":{"this":{"__isSmartRef__":true,"id":5942}},"9738":{"timestamp":{"__isSmartRef__":true,"id":9739},"user":"jan.sandbrink","tags":[]},"9739":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9740":{"varMapping":{"__isSmartRef__":true,"id":9741},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9742},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9741":{"this":{"__isSmartRef__":true,"id":5942}},"9742":{"timestamp":{"__isSmartRef__":true,"id":9743},"user":"jan.sandbrink","tags":[]},"9743":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9744":{"varMapping":{"__isSmartRef__":true,"id":9745},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9746},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9745":{"this":{"__isSmartRef__":true,"id":5942}},"9746":{"timestamp":{"__isSmartRef__":true,"id":9747},"user":"jan.sandbrink","tags":[]},"9747":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9748":{"varMapping":{"__isSmartRef__":true,"id":9749},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9750},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9749":{"this":{"__isSmartRef__":true,"id":5942}},"9750":{"timestamp":{"__isSmartRef__":true,"id":9751},"user":"josi","tags":["gemtypes"]},"9751":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9752":{"varMapping":{"__isSmartRef__":true,"id":9753},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9754},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9753":{"this":{"__isSmartRef__":true,"id":5942}},"9754":{"timestamp":{"__isSmartRef__":true,"id":9755},"user":"josi","tags":["gemtypes"]},"9755":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9756":{"varMapping":{"__isSmartRef__":true,"id":9757},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9758},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9757":{"this":{"__isSmartRef__":true,"id":5942}},"9758":{"timestamp":{"__isSmartRef__":true,"id":9759},"user":"soergel","tags":["debug"]},"9759":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9760":{"varMapping":{"__isSmartRef__":true,"id":9761},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9762},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9761":{"this":{"__isSmartRef__":true,"id":5942}},"9762":{"timestamp":{"__isSmartRef__":true,"id":9763},"user":"soergel","tags":["debug"]},"9763":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9764":{"varMapping":{"__isSmartRef__":true,"id":9765},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9766},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9765":{"this":{"__isSmartRef__":true,"id":5942}},"9766":{"timestamp":{"__isSmartRef__":true,"id":9767},"user":"josi","tags":["gemtypes"]},"9767":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9768":{"varMapping":{"__isSmartRef__":true,"id":9769},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9770},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9769":{"this":{"__isSmartRef__":true,"id":5942}},"9770":{"timestamp":{"__isSmartRef__":true,"id":9771},"user":"soergel","tags":[]},"9771":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9772":{"varMapping":{"__isSmartRef__":true,"id":9773},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9774},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9773":{"this":{"__isSmartRef__":true,"id":5942}},"9774":{"timestamp":{"__isSmartRef__":true,"id":9775},"user":"soergel","tags":[]},"9775":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9776":{"varMapping":{"__isSmartRef__":true,"id":9777},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9778},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9777":{"this":{"__isSmartRef__":true,"id":5942}},"9778":{"timestamp":{"__isSmartRef__":true,"id":9779},"user":"soergel","tags":[]},"9779":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9780":{"varMapping":{"__isSmartRef__":true,"id":9781},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9782},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9781":{"this":{"__isSmartRef__":true,"id":5942}},"9782":{"timestamp":{"__isSmartRef__":true,"id":9783},"user":"josi","tags":["gemtypes"]},"9783":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9784":{"varMapping":{"__isSmartRef__":true,"id":9785},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9785":{"this":{"__isSmartRef__":true,"id":5942}},"9786":{"timestamp":{"__isSmartRef__":true,"id":9787},"user":"josi","tags":["gemtypes"]},"9787":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9788":{"varMapping":{"__isSmartRef__":true,"id":9789},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9790},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9789":{"this":{"__isSmartRef__":true,"id":5942}},"9790":{"timestamp":{"__isSmartRef__":true,"id":9791},"user":"jan.sandbrink","tags":[]},"9791":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9792":{"become":{"__isSmartRef__":true,"id":9793},"onMouseDown":{"__isSmartRef__":true,"id":9797},"updatePicture":{"__isSmartRef__":true,"id":9805},"ruby":{"__isSmartRef__":true,"id":9809},"switchPositionWith":{"__isSmartRef__":true,"id":9813},"addNeighbour":{"__isSmartRef__":true,"id":9817},"amethyst":{"__isSmartRef__":true,"id":9821},"diopside":{"__isSmartRef__":true,"id":9825},"gemTypes":{"__isSmartRef__":true,"id":9829},"becomeRandomGem":{"__isSmartRef__":true,"id":9833},"mark":{"__isSmartRef__":true,"id":9837},"unmark":{"__isSmartRef__":true,"id":9841},"hasNeighbour":{"__isSmartRef__":true,"id":9845},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9849},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9853},"disappear":{"__isSmartRef__":true,"id":9857},"findStreakStart":{"__isSmartRef__":true,"id":9861},"buildStreak":{"__isSmartRef__":true,"id":9865},"scoreStreak":{"__isSmartRef__":true,"id":9869},"tryToStreak":{"__isSmartRef__":true,"id":9873},"blueDiamond":{"__isSmartRef__":true,"id":9877},"prehnite":{"__isSmartRef__":true,"id":9881},"debugUnmark":{"__isSmartRef__":true,"id":9885},"debugMark":{"__isSmartRef__":true,"id":9889},"citrine":{"__isSmartRef__":true,"id":9893},"move":{"__isSmartRef__":true,"id":9897},"performMovement":{"__isSmartRef__":true,"id":9901},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":9905},"zircon":{"__isSmartRef__":true,"id":9909},"emerald":{"__isSmartRef__":true,"id":9913},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":9917}},"9793":{"varMapping":{"__isSmartRef__":true,"id":9794},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9795},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9794":{"this":{"__isSmartRef__":true,"id":5850}},"9795":{"timestamp":{"__isSmartRef__":true,"id":9796},"user":"josi","tags":[]},"9796":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9797":{"varMapping":{"__isSmartRef__":true,"id":9798},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9803},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9798":{"this":{"__isSmartRef__":true,"id":5850},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9799}},"9799":{"$super":{"__isSmartRef__":true,"id":9800}},"9800":{"varMapping":{"__isSmartRef__":true,"id":9801},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9802},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9801":{"obj":{"__isSmartRef__":true,"id":5850},"name":"onMouseDown"},"9802":{},"9803":{"timestamp":{"__isSmartRef__":true,"id":9804},"user":"soergel","tags":[]},"9804":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9805":{"varMapping":{"__isSmartRef__":true,"id":9806},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9807},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9806":{"this":{"__isSmartRef__":true,"id":5850}},"9807":{"timestamp":{"__isSmartRef__":true,"id":9808},"user":"soergel","tags":[]},"9808":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9809":{"varMapping":{"__isSmartRef__":true,"id":9810},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9811},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9810":{"this":{"__isSmartRef__":true,"id":5850}},"9811":{"timestamp":{"__isSmartRef__":true,"id":9812},"user":"josi","tags":["gemtypes"]},"9812":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9813":{"varMapping":{"__isSmartRef__":true,"id":9814},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9815},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9814":{"this":{"__isSmartRef__":true,"id":5850}},"9815":{"timestamp":{"__isSmartRef__":true,"id":9816},"user":"jan.sandbrink","tags":[]},"9816":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9817":{"varMapping":{"__isSmartRef__":true,"id":9818},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9819},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9818":{"this":{"__isSmartRef__":true,"id":5850}},"9819":{"timestamp":{"__isSmartRef__":true,"id":9820},"user":"jan.sandbrink","tags":[]},"9820":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9821":{"varMapping":{"__isSmartRef__":true,"id":9822},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9823},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9822":{"this":{"__isSmartRef__":true,"id":5850}},"9823":{"timestamp":{"__isSmartRef__":true,"id":9824},"user":"josi","tags":["gemtypes"]},"9824":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9825":{"varMapping":{"__isSmartRef__":true,"id":9826},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9827},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9826":{"this":{"__isSmartRef__":true,"id":5850}},"9827":{"timestamp":{"__isSmartRef__":true,"id":9828},"user":"josi","tags":["gemtypes"]},"9828":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9829":{"varMapping":{"__isSmartRef__":true,"id":9830},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9831},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9830":{"this":{"__isSmartRef__":true,"id":5850}},"9831":{"timestamp":{"__isSmartRef__":true,"id":9832},"user":"josi","tags":[]},"9832":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9833":{"varMapping":{"__isSmartRef__":true,"id":9834},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9835},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9834":{"this":{"__isSmartRef__":true,"id":5850}},"9835":{"timestamp":{"__isSmartRef__":true,"id":9836},"user":"josi","tags":[]},"9836":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9837":{"varMapping":{"__isSmartRef__":true,"id":9838},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9839},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9838":{"this":{"__isSmartRef__":true,"id":5850}},"9839":{"timestamp":{"__isSmartRef__":true,"id":9840},"user":"soergel","tags":[]},"9840":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9841":{"varMapping":{"__isSmartRef__":true,"id":9842},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9843},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9842":{"this":{"__isSmartRef__":true,"id":5850}},"9843":{"timestamp":{"__isSmartRef__":true,"id":9844},"user":"soergel","tags":[]},"9844":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9845":{"varMapping":{"__isSmartRef__":true,"id":9846},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9847},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9846":{"this":{"__isSmartRef__":true,"id":5850}},"9847":{"timestamp":{"__isSmartRef__":true,"id":9848},"user":"soergel","tags":[]},"9848":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9849":{"varMapping":{"__isSmartRef__":true,"id":9850},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9851},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9850":{"this":{"__isSmartRef__":true,"id":5850}},"9851":{"timestamp":{"__isSmartRef__":true,"id":9852},"user":"soergel","tags":["debug"]},"9852":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9853":{"varMapping":{"__isSmartRef__":true,"id":9854},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9855},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9854":{"this":{"__isSmartRef__":true,"id":5850}},"9855":{"timestamp":{"__isSmartRef__":true,"id":9856},"user":"soergel","tags":["debug"]},"9856":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9857":{"varMapping":{"__isSmartRef__":true,"id":9858},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9859},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9858":{"this":{"__isSmartRef__":true,"id":5850}},"9859":{"timestamp":{"__isSmartRef__":true,"id":9860},"user":"jan.sandbrink","tags":[]},"9860":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9861":{"varMapping":{"__isSmartRef__":true,"id":9862},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9863},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9862":{"this":{"__isSmartRef__":true,"id":5850}},"9863":{"timestamp":{"__isSmartRef__":true,"id":9864},"user":"jan.sandbrink","tags":[]},"9864":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9865":{"varMapping":{"__isSmartRef__":true,"id":9866},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9867},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9866":{"this":{"__isSmartRef__":true,"id":5850}},"9867":{"timestamp":{"__isSmartRef__":true,"id":9868},"user":"jan.sandbrink","tags":[]},"9868":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9869":{"varMapping":{"__isSmartRef__":true,"id":9870},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9871},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9870":{"this":{"__isSmartRef__":true,"id":5850}},"9871":{"timestamp":{"__isSmartRef__":true,"id":9872},"user":"jan.sandbrink","tags":[]},"9872":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"9873":{"varMapping":{"__isSmartRef__":true,"id":9874},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":9875},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9874":{"this":{"__isSmartRef__":true,"id":5850}},"9875":{"timestamp":{"__isSmartRef__":true,"id":9876},"user":"jan.sandbrink","tags":[]},"9876":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"9877":{"varMapping":{"__isSmartRef__":true,"id":9878},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":9879},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9878":{"this":{"__isSmartRef__":true,"id":5850}},"9879":{"timestamp":{"__isSmartRef__":true,"id":9880},"user":"josi","tags":["gemtypes"]},"9880":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"9881":{"varMapping":{"__isSmartRef__":true,"id":9882},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":9883},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9882":{"this":{"__isSmartRef__":true,"id":5850}},"9883":{"timestamp":{"__isSmartRef__":true,"id":9884},"user":"josi","tags":["gemtypes"]},"9884":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"9885":{"varMapping":{"__isSmartRef__":true,"id":9886},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":9887},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9886":{"this":{"__isSmartRef__":true,"id":5850}},"9887":{"timestamp":{"__isSmartRef__":true,"id":9888},"user":"soergel","tags":["debug"]},"9888":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"9889":{"varMapping":{"__isSmartRef__":true,"id":9890},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":9891},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9890":{"this":{"__isSmartRef__":true,"id":5850}},"9891":{"timestamp":{"__isSmartRef__":true,"id":9892},"user":"soergel","tags":["debug"]},"9892":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"9893":{"varMapping":{"__isSmartRef__":true,"id":9894},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":9895},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9894":{"this":{"__isSmartRef__":true,"id":5850}},"9895":{"timestamp":{"__isSmartRef__":true,"id":9896},"user":"josi","tags":["gemtypes"]},"9896":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"9897":{"varMapping":{"__isSmartRef__":true,"id":9898},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":9899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9898":{"this":{"__isSmartRef__":true,"id":5850}},"9899":{"timestamp":{"__isSmartRef__":true,"id":9900},"user":"soergel","tags":[]},"9900":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"9901":{"varMapping":{"__isSmartRef__":true,"id":9902},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":9903},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9902":{"this":{"__isSmartRef__":true,"id":5850}},"9903":{"timestamp":{"__isSmartRef__":true,"id":9904},"user":"soergel","tags":[]},"9904":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"9905":{"varMapping":{"__isSmartRef__":true,"id":9906},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":9907},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9906":{"this":{"__isSmartRef__":true,"id":5850}},"9907":{"timestamp":{"__isSmartRef__":true,"id":9908},"user":"soergel","tags":[]},"9908":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"9909":{"varMapping":{"__isSmartRef__":true,"id":9910},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":9911},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9910":{"this":{"__isSmartRef__":true,"id":5850}},"9911":{"timestamp":{"__isSmartRef__":true,"id":9912},"user":"josi","tags":["gemtypes"]},"9912":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"9913":{"varMapping":{"__isSmartRef__":true,"id":9914},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":9915},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9914":{"this":{"__isSmartRef__":true,"id":5850}},"9915":{"timestamp":{"__isSmartRef__":true,"id":9916},"user":"josi","tags":["gemtypes"]},"9916":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"9917":{"varMapping":{"__isSmartRef__":true,"id":9918},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":9919},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9918":{"this":{"__isSmartRef__":true,"id":5850}},"9919":{"timestamp":{"__isSmartRef__":true,"id":9920},"user":"jan.sandbrink","tags":[]},"9920":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"9921":{"become":{"__isSmartRef__":true,"id":9922},"onMouseDown":{"__isSmartRef__":true,"id":9926},"updatePicture":{"__isSmartRef__":true,"id":9934},"ruby":{"__isSmartRef__":true,"id":9938},"switchPositionWith":{"__isSmartRef__":true,"id":9942},"addNeighbour":{"__isSmartRef__":true,"id":9946},"amethyst":{"__isSmartRef__":true,"id":9950},"diopside":{"__isSmartRef__":true,"id":9954},"gemTypes":{"__isSmartRef__":true,"id":9958},"becomeRandomGem":{"__isSmartRef__":true,"id":9962},"mark":{"__isSmartRef__":true,"id":9966},"unmark":{"__isSmartRef__":true,"id":9970},"hasNeighbour":{"__isSmartRef__":true,"id":9974},"debugMarkNeighbours":{"__isSmartRef__":true,"id":9978},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":9982},"disappear":{"__isSmartRef__":true,"id":9986},"findStreakStart":{"__isSmartRef__":true,"id":9990},"buildStreak":{"__isSmartRef__":true,"id":9994},"scoreStreak":{"__isSmartRef__":true,"id":9998},"tryToStreak":{"__isSmartRef__":true,"id":10002},"blueDiamond":{"__isSmartRef__":true,"id":10006},"prehnite":{"__isSmartRef__":true,"id":10010},"debugUnmark":{"__isSmartRef__":true,"id":10014},"debugMark":{"__isSmartRef__":true,"id":10018},"citrine":{"__isSmartRef__":true,"id":10022},"move":{"__isSmartRef__":true,"id":10026},"performMovement":{"__isSmartRef__":true,"id":10030},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10034},"zircon":{"__isSmartRef__":true,"id":10038},"emerald":{"__isSmartRef__":true,"id":10042},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10046}},"9922":{"varMapping":{"__isSmartRef__":true,"id":9923},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9924},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9923":{"this":{"__isSmartRef__":true,"id":5732}},"9924":{"timestamp":{"__isSmartRef__":true,"id":9925},"user":"josi","tags":[]},"9925":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"9926":{"varMapping":{"__isSmartRef__":true,"id":9927},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":9932},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9927":{"this":{"__isSmartRef__":true,"id":5732},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":9928}},"9928":{"$super":{"__isSmartRef__":true,"id":9929}},"9929":{"varMapping":{"__isSmartRef__":true,"id":9930},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":9931},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9930":{"obj":{"__isSmartRef__":true,"id":5732},"name":"onMouseDown"},"9931":{},"9932":{"timestamp":{"__isSmartRef__":true,"id":9933},"user":"soergel","tags":[]},"9933":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"9934":{"varMapping":{"__isSmartRef__":true,"id":9935},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":9936},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9935":{"this":{"__isSmartRef__":true,"id":5732}},"9936":{"timestamp":{"__isSmartRef__":true,"id":9937},"user":"soergel","tags":[]},"9937":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"9938":{"varMapping":{"__isSmartRef__":true,"id":9939},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":9940},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9939":{"this":{"__isSmartRef__":true,"id":5732}},"9940":{"timestamp":{"__isSmartRef__":true,"id":9941},"user":"josi","tags":["gemtypes"]},"9941":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"9942":{"varMapping":{"__isSmartRef__":true,"id":9943},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":9944},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9943":{"this":{"__isSmartRef__":true,"id":5732}},"9944":{"timestamp":{"__isSmartRef__":true,"id":9945},"user":"jan.sandbrink","tags":[]},"9945":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"9946":{"varMapping":{"__isSmartRef__":true,"id":9947},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9948},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9947":{"this":{"__isSmartRef__":true,"id":5732}},"9948":{"timestamp":{"__isSmartRef__":true,"id":9949},"user":"jan.sandbrink","tags":[]},"9949":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"9950":{"varMapping":{"__isSmartRef__":true,"id":9951},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":9952},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9951":{"this":{"__isSmartRef__":true,"id":5732}},"9952":{"timestamp":{"__isSmartRef__":true,"id":9953},"user":"josi","tags":["gemtypes"]},"9953":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"9954":{"varMapping":{"__isSmartRef__":true,"id":9955},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":9956},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9955":{"this":{"__isSmartRef__":true,"id":5732}},"9956":{"timestamp":{"__isSmartRef__":true,"id":9957},"user":"josi","tags":["gemtypes"]},"9957":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"9958":{"varMapping":{"__isSmartRef__":true,"id":9959},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":9960},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9959":{"this":{"__isSmartRef__":true,"id":5732}},"9960":{"timestamp":{"__isSmartRef__":true,"id":9961},"user":"josi","tags":[]},"9961":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"9962":{"varMapping":{"__isSmartRef__":true,"id":9963},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":9964},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9963":{"this":{"__isSmartRef__":true,"id":5732}},"9964":{"timestamp":{"__isSmartRef__":true,"id":9965},"user":"josi","tags":[]},"9965":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"9966":{"varMapping":{"__isSmartRef__":true,"id":9967},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":9968},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9967":{"this":{"__isSmartRef__":true,"id":5732}},"9968":{"timestamp":{"__isSmartRef__":true,"id":9969},"user":"soergel","tags":[]},"9969":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"9970":{"varMapping":{"__isSmartRef__":true,"id":9971},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":9972},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9971":{"this":{"__isSmartRef__":true,"id":5732}},"9972":{"timestamp":{"__isSmartRef__":true,"id":9973},"user":"soergel","tags":[]},"9973":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"9974":{"varMapping":{"__isSmartRef__":true,"id":9975},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":9976},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9975":{"this":{"__isSmartRef__":true,"id":5732}},"9976":{"timestamp":{"__isSmartRef__":true,"id":9977},"user":"soergel","tags":[]},"9977":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"9978":{"varMapping":{"__isSmartRef__":true,"id":9979},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9980},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9979":{"this":{"__isSmartRef__":true,"id":5732}},"9980":{"timestamp":{"__isSmartRef__":true,"id":9981},"user":"soergel","tags":["debug"]},"9981":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"9982":{"varMapping":{"__isSmartRef__":true,"id":9983},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":9984},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9983":{"this":{"__isSmartRef__":true,"id":5732}},"9984":{"timestamp":{"__isSmartRef__":true,"id":9985},"user":"soergel","tags":["debug"]},"9985":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"9986":{"varMapping":{"__isSmartRef__":true,"id":9987},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":9988},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9987":{"this":{"__isSmartRef__":true,"id":5732}},"9988":{"timestamp":{"__isSmartRef__":true,"id":9989},"user":"jan.sandbrink","tags":[]},"9989":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"9990":{"varMapping":{"__isSmartRef__":true,"id":9991},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":9992},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9991":{"this":{"__isSmartRef__":true,"id":5732}},"9992":{"timestamp":{"__isSmartRef__":true,"id":9993},"user":"jan.sandbrink","tags":[]},"9993":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"9994":{"varMapping":{"__isSmartRef__":true,"id":9995},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":9996},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9995":{"this":{"__isSmartRef__":true,"id":5732}},"9996":{"timestamp":{"__isSmartRef__":true,"id":9997},"user":"jan.sandbrink","tags":[]},"9997":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"9998":{"varMapping":{"__isSmartRef__":true,"id":9999},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10000},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"9999":{"this":{"__isSmartRef__":true,"id":5732}},"10000":{"timestamp":{"__isSmartRef__":true,"id":10001},"user":"jan.sandbrink","tags":[]},"10001":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10002":{"varMapping":{"__isSmartRef__":true,"id":10003},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10004},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10003":{"this":{"__isSmartRef__":true,"id":5732}},"10004":{"timestamp":{"__isSmartRef__":true,"id":10005},"user":"jan.sandbrink","tags":[]},"10005":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10006":{"varMapping":{"__isSmartRef__":true,"id":10007},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10008},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10007":{"this":{"__isSmartRef__":true,"id":5732}},"10008":{"timestamp":{"__isSmartRef__":true,"id":10009},"user":"josi","tags":["gemtypes"]},"10009":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10010":{"varMapping":{"__isSmartRef__":true,"id":10011},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10012},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10011":{"this":{"__isSmartRef__":true,"id":5732}},"10012":{"timestamp":{"__isSmartRef__":true,"id":10013},"user":"josi","tags":["gemtypes"]},"10013":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10014":{"varMapping":{"__isSmartRef__":true,"id":10015},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10016},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10015":{"this":{"__isSmartRef__":true,"id":5732}},"10016":{"timestamp":{"__isSmartRef__":true,"id":10017},"user":"soergel","tags":["debug"]},"10017":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10018":{"varMapping":{"__isSmartRef__":true,"id":10019},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10020},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10019":{"this":{"__isSmartRef__":true,"id":5732}},"10020":{"timestamp":{"__isSmartRef__":true,"id":10021},"user":"soergel","tags":["debug"]},"10021":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10022":{"varMapping":{"__isSmartRef__":true,"id":10023},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10024},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10023":{"this":{"__isSmartRef__":true,"id":5732}},"10024":{"timestamp":{"__isSmartRef__":true,"id":10025},"user":"josi","tags":["gemtypes"]},"10025":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10026":{"varMapping":{"__isSmartRef__":true,"id":10027},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10028},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10027":{"this":{"__isSmartRef__":true,"id":5732}},"10028":{"timestamp":{"__isSmartRef__":true,"id":10029},"user":"soergel","tags":[]},"10029":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10030":{"varMapping":{"__isSmartRef__":true,"id":10031},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10032},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10031":{"this":{"__isSmartRef__":true,"id":5732}},"10032":{"timestamp":{"__isSmartRef__":true,"id":10033},"user":"soergel","tags":[]},"10033":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10034":{"varMapping":{"__isSmartRef__":true,"id":10035},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10036},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10035":{"this":{"__isSmartRef__":true,"id":5732}},"10036":{"timestamp":{"__isSmartRef__":true,"id":10037},"user":"soergel","tags":[]},"10037":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10038":{"varMapping":{"__isSmartRef__":true,"id":10039},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10040},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10039":{"this":{"__isSmartRef__":true,"id":5732}},"10040":{"timestamp":{"__isSmartRef__":true,"id":10041},"user":"josi","tags":["gemtypes"]},"10041":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10042":{"varMapping":{"__isSmartRef__":true,"id":10043},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10044},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10043":{"this":{"__isSmartRef__":true,"id":5732}},"10044":{"timestamp":{"__isSmartRef__":true,"id":10045},"user":"josi","tags":["gemtypes"]},"10045":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10046":{"varMapping":{"__isSmartRef__":true,"id":10047},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10048},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10047":{"this":{"__isSmartRef__":true,"id":5732}},"10048":{"timestamp":{"__isSmartRef__":true,"id":10049},"user":"jan.sandbrink","tags":[]},"10049":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10050":{"become":{"__isSmartRef__":true,"id":10051},"onMouseDown":{"__isSmartRef__":true,"id":10055},"updatePicture":{"__isSmartRef__":true,"id":10063},"ruby":{"__isSmartRef__":true,"id":10067},"switchPositionWith":{"__isSmartRef__":true,"id":10071},"addNeighbour":{"__isSmartRef__":true,"id":10075},"amethyst":{"__isSmartRef__":true,"id":10079},"diopside":{"__isSmartRef__":true,"id":10083},"gemTypes":{"__isSmartRef__":true,"id":10087},"becomeRandomGem":{"__isSmartRef__":true,"id":10091},"mark":{"__isSmartRef__":true,"id":10095},"unmark":{"__isSmartRef__":true,"id":10099},"hasNeighbour":{"__isSmartRef__":true,"id":10103},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10107},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10111},"disappear":{"__isSmartRef__":true,"id":10115},"findStreakStart":{"__isSmartRef__":true,"id":10119},"buildStreak":{"__isSmartRef__":true,"id":10123},"scoreStreak":{"__isSmartRef__":true,"id":10127},"tryToStreak":{"__isSmartRef__":true,"id":10131},"blueDiamond":{"__isSmartRef__":true,"id":10135},"prehnite":{"__isSmartRef__":true,"id":10139},"debugUnmark":{"__isSmartRef__":true,"id":10143},"debugMark":{"__isSmartRef__":true,"id":10147},"citrine":{"__isSmartRef__":true,"id":10151},"move":{"__isSmartRef__":true,"id":10155},"performMovement":{"__isSmartRef__":true,"id":10159},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10163},"zircon":{"__isSmartRef__":true,"id":10167},"emerald":{"__isSmartRef__":true,"id":10171},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10175}},"10051":{"varMapping":{"__isSmartRef__":true,"id":10052},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10053},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10052":{"this":{"__isSmartRef__":true,"id":5597}},"10053":{"timestamp":{"__isSmartRef__":true,"id":10054},"user":"josi","tags":[]},"10054":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10055":{"varMapping":{"__isSmartRef__":true,"id":10056},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10061},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10056":{"this":{"__isSmartRef__":true,"id":5597},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10057}},"10057":{"$super":{"__isSmartRef__":true,"id":10058}},"10058":{"varMapping":{"__isSmartRef__":true,"id":10059},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10060},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10059":{"obj":{"__isSmartRef__":true,"id":5597},"name":"onMouseDown"},"10060":{},"10061":{"timestamp":{"__isSmartRef__":true,"id":10062},"user":"soergel","tags":[]},"10062":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10063":{"varMapping":{"__isSmartRef__":true,"id":10064},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10065},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10064":{"this":{"__isSmartRef__":true,"id":5597}},"10065":{"timestamp":{"__isSmartRef__":true,"id":10066},"user":"soergel","tags":[]},"10066":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10067":{"varMapping":{"__isSmartRef__":true,"id":10068},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10069},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10068":{"this":{"__isSmartRef__":true,"id":5597}},"10069":{"timestamp":{"__isSmartRef__":true,"id":10070},"user":"josi","tags":["gemtypes"]},"10070":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10071":{"varMapping":{"__isSmartRef__":true,"id":10072},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10073},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10072":{"this":{"__isSmartRef__":true,"id":5597}},"10073":{"timestamp":{"__isSmartRef__":true,"id":10074},"user":"jan.sandbrink","tags":[]},"10074":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10075":{"varMapping":{"__isSmartRef__":true,"id":10076},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10077},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10076":{"this":{"__isSmartRef__":true,"id":5597}},"10077":{"timestamp":{"__isSmartRef__":true,"id":10078},"user":"jan.sandbrink","tags":[]},"10078":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10079":{"varMapping":{"__isSmartRef__":true,"id":10080},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10081},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10080":{"this":{"__isSmartRef__":true,"id":5597}},"10081":{"timestamp":{"__isSmartRef__":true,"id":10082},"user":"josi","tags":["gemtypes"]},"10082":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10083":{"varMapping":{"__isSmartRef__":true,"id":10084},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10085},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10084":{"this":{"__isSmartRef__":true,"id":5597}},"10085":{"timestamp":{"__isSmartRef__":true,"id":10086},"user":"josi","tags":["gemtypes"]},"10086":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10087":{"varMapping":{"__isSmartRef__":true,"id":10088},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10089},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10088":{"this":{"__isSmartRef__":true,"id":5597}},"10089":{"timestamp":{"__isSmartRef__":true,"id":10090},"user":"josi","tags":[]},"10090":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10091":{"varMapping":{"__isSmartRef__":true,"id":10092},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10093},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10092":{"this":{"__isSmartRef__":true,"id":5597}},"10093":{"timestamp":{"__isSmartRef__":true,"id":10094},"user":"josi","tags":[]},"10094":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10095":{"varMapping":{"__isSmartRef__":true,"id":10096},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10097},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10096":{"this":{"__isSmartRef__":true,"id":5597}},"10097":{"timestamp":{"__isSmartRef__":true,"id":10098},"user":"soergel","tags":[]},"10098":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10099":{"varMapping":{"__isSmartRef__":true,"id":10100},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10101},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10100":{"this":{"__isSmartRef__":true,"id":5597}},"10101":{"timestamp":{"__isSmartRef__":true,"id":10102},"user":"soergel","tags":[]},"10102":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10103":{"varMapping":{"__isSmartRef__":true,"id":10104},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10105},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10104":{"this":{"__isSmartRef__":true,"id":5597}},"10105":{"timestamp":{"__isSmartRef__":true,"id":10106},"user":"soergel","tags":[]},"10106":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10107":{"varMapping":{"__isSmartRef__":true,"id":10108},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10109},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10108":{"this":{"__isSmartRef__":true,"id":5597}},"10109":{"timestamp":{"__isSmartRef__":true,"id":10110},"user":"soergel","tags":["debug"]},"10110":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10111":{"varMapping":{"__isSmartRef__":true,"id":10112},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10113},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10112":{"this":{"__isSmartRef__":true,"id":5597}},"10113":{"timestamp":{"__isSmartRef__":true,"id":10114},"user":"soergel","tags":["debug"]},"10114":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10115":{"varMapping":{"__isSmartRef__":true,"id":10116},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10117},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10116":{"this":{"__isSmartRef__":true,"id":5597}},"10117":{"timestamp":{"__isSmartRef__":true,"id":10118},"user":"jan.sandbrink","tags":[]},"10118":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10119":{"varMapping":{"__isSmartRef__":true,"id":10120},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10121},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10120":{"this":{"__isSmartRef__":true,"id":5597}},"10121":{"timestamp":{"__isSmartRef__":true,"id":10122},"user":"jan.sandbrink","tags":[]},"10122":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10123":{"varMapping":{"__isSmartRef__":true,"id":10124},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10125},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10124":{"this":{"__isSmartRef__":true,"id":5597}},"10125":{"timestamp":{"__isSmartRef__":true,"id":10126},"user":"jan.sandbrink","tags":[]},"10126":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10127":{"varMapping":{"__isSmartRef__":true,"id":10128},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10129},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10128":{"this":{"__isSmartRef__":true,"id":5597}},"10129":{"timestamp":{"__isSmartRef__":true,"id":10130},"user":"jan.sandbrink","tags":[]},"10130":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10131":{"varMapping":{"__isSmartRef__":true,"id":10132},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10133},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10132":{"this":{"__isSmartRef__":true,"id":5597}},"10133":{"timestamp":{"__isSmartRef__":true,"id":10134},"user":"jan.sandbrink","tags":[]},"10134":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10135":{"varMapping":{"__isSmartRef__":true,"id":10136},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10137},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10136":{"this":{"__isSmartRef__":true,"id":5597}},"10137":{"timestamp":{"__isSmartRef__":true,"id":10138},"user":"josi","tags":["gemtypes"]},"10138":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10139":{"varMapping":{"__isSmartRef__":true,"id":10140},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10141},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10140":{"this":{"__isSmartRef__":true,"id":5597}},"10141":{"timestamp":{"__isSmartRef__":true,"id":10142},"user":"josi","tags":["gemtypes"]},"10142":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10143":{"varMapping":{"__isSmartRef__":true,"id":10144},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10145},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10144":{"this":{"__isSmartRef__":true,"id":5597}},"10145":{"timestamp":{"__isSmartRef__":true,"id":10146},"user":"soergel","tags":["debug"]},"10146":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10147":{"varMapping":{"__isSmartRef__":true,"id":10148},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10149},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10148":{"this":{"__isSmartRef__":true,"id":5597}},"10149":{"timestamp":{"__isSmartRef__":true,"id":10150},"user":"soergel","tags":["debug"]},"10150":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10151":{"varMapping":{"__isSmartRef__":true,"id":10152},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10153},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10152":{"this":{"__isSmartRef__":true,"id":5597}},"10153":{"timestamp":{"__isSmartRef__":true,"id":10154},"user":"josi","tags":["gemtypes"]},"10154":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10155":{"varMapping":{"__isSmartRef__":true,"id":10156},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10156":{"this":{"__isSmartRef__":true,"id":5597}},"10157":{"timestamp":{"__isSmartRef__":true,"id":10158},"user":"soergel","tags":[]},"10158":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10159":{"varMapping":{"__isSmartRef__":true,"id":10160},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10161},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10160":{"this":{"__isSmartRef__":true,"id":5597}},"10161":{"timestamp":{"__isSmartRef__":true,"id":10162},"user":"soergel","tags":[]},"10162":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10163":{"varMapping":{"__isSmartRef__":true,"id":10164},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10165},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10164":{"this":{"__isSmartRef__":true,"id":5597}},"10165":{"timestamp":{"__isSmartRef__":true,"id":10166},"user":"soergel","tags":[]},"10166":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10167":{"varMapping":{"__isSmartRef__":true,"id":10168},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10169},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10168":{"this":{"__isSmartRef__":true,"id":5597}},"10169":{"timestamp":{"__isSmartRef__":true,"id":10170},"user":"josi","tags":["gemtypes"]},"10170":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10171":{"varMapping":{"__isSmartRef__":true,"id":10172},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10172":{"this":{"__isSmartRef__":true,"id":5597}},"10173":{"timestamp":{"__isSmartRef__":true,"id":10174},"user":"josi","tags":["gemtypes"]},"10174":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10175":{"varMapping":{"__isSmartRef__":true,"id":10176},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10177},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10176":{"this":{"__isSmartRef__":true,"id":5597}},"10177":{"timestamp":{"__isSmartRef__":true,"id":10178},"user":"jan.sandbrink","tags":[]},"10178":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10179":{"become":{"__isSmartRef__":true,"id":10180},"onMouseDown":{"__isSmartRef__":true,"id":10184},"updatePicture":{"__isSmartRef__":true,"id":10192},"ruby":{"__isSmartRef__":true,"id":10196},"switchPositionWith":{"__isSmartRef__":true,"id":10200},"addNeighbour":{"__isSmartRef__":true,"id":10204},"amethyst":{"__isSmartRef__":true,"id":10208},"diopside":{"__isSmartRef__":true,"id":10212},"gemTypes":{"__isSmartRef__":true,"id":10216},"becomeRandomGem":{"__isSmartRef__":true,"id":10220},"mark":{"__isSmartRef__":true,"id":10224},"unmark":{"__isSmartRef__":true,"id":10228},"hasNeighbour":{"__isSmartRef__":true,"id":10232},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10236},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10240},"disappear":{"__isSmartRef__":true,"id":10244},"findStreakStart":{"__isSmartRef__":true,"id":10248},"buildStreak":{"__isSmartRef__":true,"id":10252},"scoreStreak":{"__isSmartRef__":true,"id":10256},"tryToStreak":{"__isSmartRef__":true,"id":10260},"blueDiamond":{"__isSmartRef__":true,"id":10264},"prehnite":{"__isSmartRef__":true,"id":10268},"debugUnmark":{"__isSmartRef__":true,"id":10272},"debugMark":{"__isSmartRef__":true,"id":10276},"citrine":{"__isSmartRef__":true,"id":10280},"move":{"__isSmartRef__":true,"id":10284},"performMovement":{"__isSmartRef__":true,"id":10288},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10292},"zircon":{"__isSmartRef__":true,"id":10296},"emerald":{"__isSmartRef__":true,"id":10300},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10304}},"10180":{"varMapping":{"__isSmartRef__":true,"id":10181},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10182},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10181":{"this":{"__isSmartRef__":true,"id":5462}},"10182":{"timestamp":{"__isSmartRef__":true,"id":10183},"user":"josi","tags":[]},"10183":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10184":{"varMapping":{"__isSmartRef__":true,"id":10185},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10190},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10185":{"this":{"__isSmartRef__":true,"id":5462},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10186}},"10186":{"$super":{"__isSmartRef__":true,"id":10187}},"10187":{"varMapping":{"__isSmartRef__":true,"id":10188},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10189},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10188":{"obj":{"__isSmartRef__":true,"id":5462},"name":"onMouseDown"},"10189":{},"10190":{"timestamp":{"__isSmartRef__":true,"id":10191},"user":"soergel","tags":[]},"10191":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10192":{"varMapping":{"__isSmartRef__":true,"id":10193},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10194},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10193":{"this":{"__isSmartRef__":true,"id":5462}},"10194":{"timestamp":{"__isSmartRef__":true,"id":10195},"user":"soergel","tags":[]},"10195":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10196":{"varMapping":{"__isSmartRef__":true,"id":10197},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10198},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10197":{"this":{"__isSmartRef__":true,"id":5462}},"10198":{"timestamp":{"__isSmartRef__":true,"id":10199},"user":"josi","tags":["gemtypes"]},"10199":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10200":{"varMapping":{"__isSmartRef__":true,"id":10201},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10202},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10201":{"this":{"__isSmartRef__":true,"id":5462}},"10202":{"timestamp":{"__isSmartRef__":true,"id":10203},"user":"jan.sandbrink","tags":[]},"10203":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10204":{"varMapping":{"__isSmartRef__":true,"id":10205},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10206},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10205":{"this":{"__isSmartRef__":true,"id":5462}},"10206":{"timestamp":{"__isSmartRef__":true,"id":10207},"user":"jan.sandbrink","tags":[]},"10207":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10208":{"varMapping":{"__isSmartRef__":true,"id":10209},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10210},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10209":{"this":{"__isSmartRef__":true,"id":5462}},"10210":{"timestamp":{"__isSmartRef__":true,"id":10211},"user":"josi","tags":["gemtypes"]},"10211":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10212":{"varMapping":{"__isSmartRef__":true,"id":10213},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10214},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10213":{"this":{"__isSmartRef__":true,"id":5462}},"10214":{"timestamp":{"__isSmartRef__":true,"id":10215},"user":"josi","tags":["gemtypes"]},"10215":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10216":{"varMapping":{"__isSmartRef__":true,"id":10217},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10218},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10217":{"this":{"__isSmartRef__":true,"id":5462}},"10218":{"timestamp":{"__isSmartRef__":true,"id":10219},"user":"josi","tags":[]},"10219":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10220":{"varMapping":{"__isSmartRef__":true,"id":10221},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10222},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10221":{"this":{"__isSmartRef__":true,"id":5462}},"10222":{"timestamp":{"__isSmartRef__":true,"id":10223},"user":"josi","tags":[]},"10223":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10224":{"varMapping":{"__isSmartRef__":true,"id":10225},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10226},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10225":{"this":{"__isSmartRef__":true,"id":5462}},"10226":{"timestamp":{"__isSmartRef__":true,"id":10227},"user":"soergel","tags":[]},"10227":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10228":{"varMapping":{"__isSmartRef__":true,"id":10229},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10230},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10229":{"this":{"__isSmartRef__":true,"id":5462}},"10230":{"timestamp":{"__isSmartRef__":true,"id":10231},"user":"soergel","tags":[]},"10231":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10232":{"varMapping":{"__isSmartRef__":true,"id":10233},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10234},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10233":{"this":{"__isSmartRef__":true,"id":5462}},"10234":{"timestamp":{"__isSmartRef__":true,"id":10235},"user":"soergel","tags":[]},"10235":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10236":{"varMapping":{"__isSmartRef__":true,"id":10237},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10238},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10237":{"this":{"__isSmartRef__":true,"id":5462}},"10238":{"timestamp":{"__isSmartRef__":true,"id":10239},"user":"soergel","tags":["debug"]},"10239":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10240":{"varMapping":{"__isSmartRef__":true,"id":10241},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10242},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10241":{"this":{"__isSmartRef__":true,"id":5462}},"10242":{"timestamp":{"__isSmartRef__":true,"id":10243},"user":"soergel","tags":["debug"]},"10243":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10244":{"varMapping":{"__isSmartRef__":true,"id":10245},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10246},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10245":{"this":{"__isSmartRef__":true,"id":5462}},"10246":{"timestamp":{"__isSmartRef__":true,"id":10247},"user":"jan.sandbrink","tags":[]},"10247":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10248":{"varMapping":{"__isSmartRef__":true,"id":10249},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10250},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10249":{"this":{"__isSmartRef__":true,"id":5462}},"10250":{"timestamp":{"__isSmartRef__":true,"id":10251},"user":"jan.sandbrink","tags":[]},"10251":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10252":{"varMapping":{"__isSmartRef__":true,"id":10253},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10254},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10253":{"this":{"__isSmartRef__":true,"id":5462}},"10254":{"timestamp":{"__isSmartRef__":true,"id":10255},"user":"jan.sandbrink","tags":[]},"10255":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10256":{"varMapping":{"__isSmartRef__":true,"id":10257},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10258},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10257":{"this":{"__isSmartRef__":true,"id":5462}},"10258":{"timestamp":{"__isSmartRef__":true,"id":10259},"user":"jan.sandbrink","tags":[]},"10259":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10260":{"varMapping":{"__isSmartRef__":true,"id":10261},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10262},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10261":{"this":{"__isSmartRef__":true,"id":5462}},"10262":{"timestamp":{"__isSmartRef__":true,"id":10263},"user":"jan.sandbrink","tags":[]},"10263":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10264":{"varMapping":{"__isSmartRef__":true,"id":10265},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10266},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10265":{"this":{"__isSmartRef__":true,"id":5462}},"10266":{"timestamp":{"__isSmartRef__":true,"id":10267},"user":"josi","tags":["gemtypes"]},"10267":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10268":{"varMapping":{"__isSmartRef__":true,"id":10269},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10270},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10269":{"this":{"__isSmartRef__":true,"id":5462}},"10270":{"timestamp":{"__isSmartRef__":true,"id":10271},"user":"josi","tags":["gemtypes"]},"10271":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10272":{"varMapping":{"__isSmartRef__":true,"id":10273},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10274},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10273":{"this":{"__isSmartRef__":true,"id":5462}},"10274":{"timestamp":{"__isSmartRef__":true,"id":10275},"user":"soergel","tags":["debug"]},"10275":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10276":{"varMapping":{"__isSmartRef__":true,"id":10277},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10278},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10277":{"this":{"__isSmartRef__":true,"id":5462}},"10278":{"timestamp":{"__isSmartRef__":true,"id":10279},"user":"soergel","tags":["debug"]},"10279":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10280":{"varMapping":{"__isSmartRef__":true,"id":10281},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10282},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10281":{"this":{"__isSmartRef__":true,"id":5462}},"10282":{"timestamp":{"__isSmartRef__":true,"id":10283},"user":"josi","tags":["gemtypes"]},"10283":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10284":{"varMapping":{"__isSmartRef__":true,"id":10285},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10286},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10285":{"this":{"__isSmartRef__":true,"id":5462}},"10286":{"timestamp":{"__isSmartRef__":true,"id":10287},"user":"soergel","tags":[]},"10287":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10288":{"varMapping":{"__isSmartRef__":true,"id":10289},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10290},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10289":{"this":{"__isSmartRef__":true,"id":5462}},"10290":{"timestamp":{"__isSmartRef__":true,"id":10291},"user":"soergel","tags":[]},"10291":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10292":{"varMapping":{"__isSmartRef__":true,"id":10293},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10294},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10293":{"this":{"__isSmartRef__":true,"id":5462}},"10294":{"timestamp":{"__isSmartRef__":true,"id":10295},"user":"soergel","tags":[]},"10295":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10296":{"varMapping":{"__isSmartRef__":true,"id":10297},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10298},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10297":{"this":{"__isSmartRef__":true,"id":5462}},"10298":{"timestamp":{"__isSmartRef__":true,"id":10299},"user":"josi","tags":["gemtypes"]},"10299":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10300":{"varMapping":{"__isSmartRef__":true,"id":10301},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10302},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10301":{"this":{"__isSmartRef__":true,"id":5462}},"10302":{"timestamp":{"__isSmartRef__":true,"id":10303},"user":"josi","tags":["gemtypes"]},"10303":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10304":{"varMapping":{"__isSmartRef__":true,"id":10305},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10306},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10305":{"this":{"__isSmartRef__":true,"id":5462}},"10306":{"timestamp":{"__isSmartRef__":true,"id":10307},"user":"jan.sandbrink","tags":[]},"10307":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10308":{"become":{"__isSmartRef__":true,"id":10309},"onMouseDown":{"__isSmartRef__":true,"id":10313},"updatePicture":{"__isSmartRef__":true,"id":10321},"ruby":{"__isSmartRef__":true,"id":10325},"switchPositionWith":{"__isSmartRef__":true,"id":10329},"addNeighbour":{"__isSmartRef__":true,"id":10333},"amethyst":{"__isSmartRef__":true,"id":10337},"diopside":{"__isSmartRef__":true,"id":10341},"gemTypes":{"__isSmartRef__":true,"id":10345},"becomeRandomGem":{"__isSmartRef__":true,"id":10349},"mark":{"__isSmartRef__":true,"id":10353},"unmark":{"__isSmartRef__":true,"id":10357},"hasNeighbour":{"__isSmartRef__":true,"id":10361},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10365},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10369},"disappear":{"__isSmartRef__":true,"id":10373},"findStreakStart":{"__isSmartRef__":true,"id":10377},"buildStreak":{"__isSmartRef__":true,"id":10381},"scoreStreak":{"__isSmartRef__":true,"id":10385},"tryToStreak":{"__isSmartRef__":true,"id":10389},"blueDiamond":{"__isSmartRef__":true,"id":10393},"prehnite":{"__isSmartRef__":true,"id":10397},"debugUnmark":{"__isSmartRef__":true,"id":10401},"debugMark":{"__isSmartRef__":true,"id":10405},"citrine":{"__isSmartRef__":true,"id":10409},"move":{"__isSmartRef__":true,"id":10413},"performMovement":{"__isSmartRef__":true,"id":10417},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10421},"zircon":{"__isSmartRef__":true,"id":10425},"emerald":{"__isSmartRef__":true,"id":10429},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10433}},"10309":{"varMapping":{"__isSmartRef__":true,"id":10310},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10311},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10310":{"this":{"__isSmartRef__":true,"id":5361}},"10311":{"timestamp":{"__isSmartRef__":true,"id":10312},"user":"josi","tags":[]},"10312":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10313":{"varMapping":{"__isSmartRef__":true,"id":10314},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10319},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10314":{"this":{"__isSmartRef__":true,"id":5361},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10315}},"10315":{"$super":{"__isSmartRef__":true,"id":10316}},"10316":{"varMapping":{"__isSmartRef__":true,"id":10317},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10318},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10317":{"obj":{"__isSmartRef__":true,"id":5361},"name":"onMouseDown"},"10318":{},"10319":{"timestamp":{"__isSmartRef__":true,"id":10320},"user":"soergel","tags":[]},"10320":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10321":{"varMapping":{"__isSmartRef__":true,"id":10322},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10323},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10322":{"this":{"__isSmartRef__":true,"id":5361}},"10323":{"timestamp":{"__isSmartRef__":true,"id":10324},"user":"soergel","tags":[]},"10324":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10325":{"varMapping":{"__isSmartRef__":true,"id":10326},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10327},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10326":{"this":{"__isSmartRef__":true,"id":5361}},"10327":{"timestamp":{"__isSmartRef__":true,"id":10328},"user":"josi","tags":["gemtypes"]},"10328":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10329":{"varMapping":{"__isSmartRef__":true,"id":10330},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10331},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10330":{"this":{"__isSmartRef__":true,"id":5361}},"10331":{"timestamp":{"__isSmartRef__":true,"id":10332},"user":"jan.sandbrink","tags":[]},"10332":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10333":{"varMapping":{"__isSmartRef__":true,"id":10334},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10335},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10334":{"this":{"__isSmartRef__":true,"id":5361}},"10335":{"timestamp":{"__isSmartRef__":true,"id":10336},"user":"jan.sandbrink","tags":[]},"10336":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10337":{"varMapping":{"__isSmartRef__":true,"id":10338},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10339},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10338":{"this":{"__isSmartRef__":true,"id":5361}},"10339":{"timestamp":{"__isSmartRef__":true,"id":10340},"user":"josi","tags":["gemtypes"]},"10340":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10341":{"varMapping":{"__isSmartRef__":true,"id":10342},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10343},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10342":{"this":{"__isSmartRef__":true,"id":5361}},"10343":{"timestamp":{"__isSmartRef__":true,"id":10344},"user":"josi","tags":["gemtypes"]},"10344":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10345":{"varMapping":{"__isSmartRef__":true,"id":10346},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10347},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10346":{"this":{"__isSmartRef__":true,"id":5361}},"10347":{"timestamp":{"__isSmartRef__":true,"id":10348},"user":"josi","tags":[]},"10348":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10349":{"varMapping":{"__isSmartRef__":true,"id":10350},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10351},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10350":{"this":{"__isSmartRef__":true,"id":5361}},"10351":{"timestamp":{"__isSmartRef__":true,"id":10352},"user":"josi","tags":[]},"10352":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10353":{"varMapping":{"__isSmartRef__":true,"id":10354},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10355},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10354":{"this":{"__isSmartRef__":true,"id":5361}},"10355":{"timestamp":{"__isSmartRef__":true,"id":10356},"user":"soergel","tags":[]},"10356":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10357":{"varMapping":{"__isSmartRef__":true,"id":10358},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10359},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10358":{"this":{"__isSmartRef__":true,"id":5361}},"10359":{"timestamp":{"__isSmartRef__":true,"id":10360},"user":"soergel","tags":[]},"10360":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10361":{"varMapping":{"__isSmartRef__":true,"id":10362},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10363},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10362":{"this":{"__isSmartRef__":true,"id":5361}},"10363":{"timestamp":{"__isSmartRef__":true,"id":10364},"user":"soergel","tags":[]},"10364":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10365":{"varMapping":{"__isSmartRef__":true,"id":10366},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10367},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10366":{"this":{"__isSmartRef__":true,"id":5361}},"10367":{"timestamp":{"__isSmartRef__":true,"id":10368},"user":"soergel","tags":["debug"]},"10368":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10369":{"varMapping":{"__isSmartRef__":true,"id":10370},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10371},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10370":{"this":{"__isSmartRef__":true,"id":5361}},"10371":{"timestamp":{"__isSmartRef__":true,"id":10372},"user":"soergel","tags":["debug"]},"10372":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10373":{"varMapping":{"__isSmartRef__":true,"id":10374},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10375},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10374":{"this":{"__isSmartRef__":true,"id":5361}},"10375":{"timestamp":{"__isSmartRef__":true,"id":10376},"user":"jan.sandbrink","tags":[]},"10376":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10377":{"varMapping":{"__isSmartRef__":true,"id":10378},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10379},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10378":{"this":{"__isSmartRef__":true,"id":5361}},"10379":{"timestamp":{"__isSmartRef__":true,"id":10380},"user":"jan.sandbrink","tags":[]},"10380":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10381":{"varMapping":{"__isSmartRef__":true,"id":10382},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10383},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10382":{"this":{"__isSmartRef__":true,"id":5361}},"10383":{"timestamp":{"__isSmartRef__":true,"id":10384},"user":"jan.sandbrink","tags":[]},"10384":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10385":{"varMapping":{"__isSmartRef__":true,"id":10386},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10387},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10386":{"this":{"__isSmartRef__":true,"id":5361}},"10387":{"timestamp":{"__isSmartRef__":true,"id":10388},"user":"jan.sandbrink","tags":[]},"10388":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10389":{"varMapping":{"__isSmartRef__":true,"id":10390},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10391},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10390":{"this":{"__isSmartRef__":true,"id":5361}},"10391":{"timestamp":{"__isSmartRef__":true,"id":10392},"user":"jan.sandbrink","tags":[]},"10392":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10393":{"varMapping":{"__isSmartRef__":true,"id":10394},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10395},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10394":{"this":{"__isSmartRef__":true,"id":5361}},"10395":{"timestamp":{"__isSmartRef__":true,"id":10396},"user":"josi","tags":["gemtypes"]},"10396":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10397":{"varMapping":{"__isSmartRef__":true,"id":10398},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10399},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10398":{"this":{"__isSmartRef__":true,"id":5361}},"10399":{"timestamp":{"__isSmartRef__":true,"id":10400},"user":"josi","tags":["gemtypes"]},"10400":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10401":{"varMapping":{"__isSmartRef__":true,"id":10402},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10403},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10402":{"this":{"__isSmartRef__":true,"id":5361}},"10403":{"timestamp":{"__isSmartRef__":true,"id":10404},"user":"soergel","tags":["debug"]},"10404":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10405":{"varMapping":{"__isSmartRef__":true,"id":10406},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10407},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10406":{"this":{"__isSmartRef__":true,"id":5361}},"10407":{"timestamp":{"__isSmartRef__":true,"id":10408},"user":"soergel","tags":["debug"]},"10408":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10409":{"varMapping":{"__isSmartRef__":true,"id":10410},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10411},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10410":{"this":{"__isSmartRef__":true,"id":5361}},"10411":{"timestamp":{"__isSmartRef__":true,"id":10412},"user":"josi","tags":["gemtypes"]},"10412":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10413":{"varMapping":{"__isSmartRef__":true,"id":10414},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10414":{"this":{"__isSmartRef__":true,"id":5361}},"10415":{"timestamp":{"__isSmartRef__":true,"id":10416},"user":"soergel","tags":[]},"10416":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10417":{"varMapping":{"__isSmartRef__":true,"id":10418},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10419},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10418":{"this":{"__isSmartRef__":true,"id":5361}},"10419":{"timestamp":{"__isSmartRef__":true,"id":10420},"user":"soergel","tags":[]},"10420":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10421":{"varMapping":{"__isSmartRef__":true,"id":10422},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10423},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10422":{"this":{"__isSmartRef__":true,"id":5361}},"10423":{"timestamp":{"__isSmartRef__":true,"id":10424},"user":"soergel","tags":[]},"10424":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10425":{"varMapping":{"__isSmartRef__":true,"id":10426},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10427},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10426":{"this":{"__isSmartRef__":true,"id":5361}},"10427":{"timestamp":{"__isSmartRef__":true,"id":10428},"user":"josi","tags":["gemtypes"]},"10428":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10429":{"varMapping":{"__isSmartRef__":true,"id":10430},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10431},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10430":{"this":{"__isSmartRef__":true,"id":5361}},"10431":{"timestamp":{"__isSmartRef__":true,"id":10432},"user":"josi","tags":["gemtypes"]},"10432":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10433":{"varMapping":{"__isSmartRef__":true,"id":10434},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10435},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10434":{"this":{"__isSmartRef__":true,"id":5361}},"10435":{"timestamp":{"__isSmartRef__":true,"id":10436},"user":"jan.sandbrink","tags":[]},"10436":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10437":{"become":{"__isSmartRef__":true,"id":10438},"onMouseDown":{"__isSmartRef__":true,"id":10442},"updatePicture":{"__isSmartRef__":true,"id":10450},"ruby":{"__isSmartRef__":true,"id":10454},"switchPositionWith":{"__isSmartRef__":true,"id":10458},"addNeighbour":{"__isSmartRef__":true,"id":10462},"amethyst":{"__isSmartRef__":true,"id":10466},"diopside":{"__isSmartRef__":true,"id":10470},"gemTypes":{"__isSmartRef__":true,"id":10474},"becomeRandomGem":{"__isSmartRef__":true,"id":10478},"mark":{"__isSmartRef__":true,"id":10482},"unmark":{"__isSmartRef__":true,"id":10486},"hasNeighbour":{"__isSmartRef__":true,"id":10490},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10494},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10498},"disappear":{"__isSmartRef__":true,"id":10502},"findStreakStart":{"__isSmartRef__":true,"id":10506},"buildStreak":{"__isSmartRef__":true,"id":10510},"scoreStreak":{"__isSmartRef__":true,"id":10514},"tryToStreak":{"__isSmartRef__":true,"id":10518},"blueDiamond":{"__isSmartRef__":true,"id":10522},"prehnite":{"__isSmartRef__":true,"id":10526},"debugUnmark":{"__isSmartRef__":true,"id":10530},"debugMark":{"__isSmartRef__":true,"id":10534},"citrine":{"__isSmartRef__":true,"id":10538},"move":{"__isSmartRef__":true,"id":10542},"performMovement":{"__isSmartRef__":true,"id":10546},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10550},"zircon":{"__isSmartRef__":true,"id":10554},"emerald":{"__isSmartRef__":true,"id":10558},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10562}},"10438":{"varMapping":{"__isSmartRef__":true,"id":10439},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10440},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10439":{"this":{"__isSmartRef__":true,"id":5269}},"10440":{"timestamp":{"__isSmartRef__":true,"id":10441},"user":"josi","tags":[]},"10441":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10442":{"varMapping":{"__isSmartRef__":true,"id":10443},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10448},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10443":{"this":{"__isSmartRef__":true,"id":5269},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10444}},"10444":{"$super":{"__isSmartRef__":true,"id":10445}},"10445":{"varMapping":{"__isSmartRef__":true,"id":10446},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10446":{"obj":{"__isSmartRef__":true,"id":5269},"name":"onMouseDown"},"10447":{},"10448":{"timestamp":{"__isSmartRef__":true,"id":10449},"user":"soergel","tags":[]},"10449":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10450":{"varMapping":{"__isSmartRef__":true,"id":10451},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10452},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10451":{"this":{"__isSmartRef__":true,"id":5269}},"10452":{"timestamp":{"__isSmartRef__":true,"id":10453},"user":"soergel","tags":[]},"10453":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10454":{"varMapping":{"__isSmartRef__":true,"id":10455},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10456},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10455":{"this":{"__isSmartRef__":true,"id":5269}},"10456":{"timestamp":{"__isSmartRef__":true,"id":10457},"user":"josi","tags":["gemtypes"]},"10457":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10458":{"varMapping":{"__isSmartRef__":true,"id":10459},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10460},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10459":{"this":{"__isSmartRef__":true,"id":5269}},"10460":{"timestamp":{"__isSmartRef__":true,"id":10461},"user":"jan.sandbrink","tags":[]},"10461":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10462":{"varMapping":{"__isSmartRef__":true,"id":10463},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10464},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10463":{"this":{"__isSmartRef__":true,"id":5269}},"10464":{"timestamp":{"__isSmartRef__":true,"id":10465},"user":"jan.sandbrink","tags":[]},"10465":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10466":{"varMapping":{"__isSmartRef__":true,"id":10467},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10468},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10467":{"this":{"__isSmartRef__":true,"id":5269}},"10468":{"timestamp":{"__isSmartRef__":true,"id":10469},"user":"josi","tags":["gemtypes"]},"10469":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10470":{"varMapping":{"__isSmartRef__":true,"id":10471},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10472},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10471":{"this":{"__isSmartRef__":true,"id":5269}},"10472":{"timestamp":{"__isSmartRef__":true,"id":10473},"user":"josi","tags":["gemtypes"]},"10473":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10474":{"varMapping":{"__isSmartRef__":true,"id":10475},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10476},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10475":{"this":{"__isSmartRef__":true,"id":5269}},"10476":{"timestamp":{"__isSmartRef__":true,"id":10477},"user":"josi","tags":[]},"10477":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10478":{"varMapping":{"__isSmartRef__":true,"id":10479},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10480},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10479":{"this":{"__isSmartRef__":true,"id":5269}},"10480":{"timestamp":{"__isSmartRef__":true,"id":10481},"user":"josi","tags":[]},"10481":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10482":{"varMapping":{"__isSmartRef__":true,"id":10483},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10484},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10483":{"this":{"__isSmartRef__":true,"id":5269}},"10484":{"timestamp":{"__isSmartRef__":true,"id":10485},"user":"soergel","tags":[]},"10485":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10486":{"varMapping":{"__isSmartRef__":true,"id":10487},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10488},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10487":{"this":{"__isSmartRef__":true,"id":5269}},"10488":{"timestamp":{"__isSmartRef__":true,"id":10489},"user":"soergel","tags":[]},"10489":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10490":{"varMapping":{"__isSmartRef__":true,"id":10491},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10492},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10491":{"this":{"__isSmartRef__":true,"id":5269}},"10492":{"timestamp":{"__isSmartRef__":true,"id":10493},"user":"soergel","tags":[]},"10493":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10494":{"varMapping":{"__isSmartRef__":true,"id":10495},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10496},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10495":{"this":{"__isSmartRef__":true,"id":5269}},"10496":{"timestamp":{"__isSmartRef__":true,"id":10497},"user":"soergel","tags":["debug"]},"10497":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10498":{"varMapping":{"__isSmartRef__":true,"id":10499},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10500},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10499":{"this":{"__isSmartRef__":true,"id":5269}},"10500":{"timestamp":{"__isSmartRef__":true,"id":10501},"user":"soergel","tags":["debug"]},"10501":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10502":{"varMapping":{"__isSmartRef__":true,"id":10503},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10504},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10503":{"this":{"__isSmartRef__":true,"id":5269}},"10504":{"timestamp":{"__isSmartRef__":true,"id":10505},"user":"jan.sandbrink","tags":[]},"10505":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10506":{"varMapping":{"__isSmartRef__":true,"id":10507},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10508},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10507":{"this":{"__isSmartRef__":true,"id":5269}},"10508":{"timestamp":{"__isSmartRef__":true,"id":10509},"user":"jan.sandbrink","tags":[]},"10509":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10510":{"varMapping":{"__isSmartRef__":true,"id":10511},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10512},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10511":{"this":{"__isSmartRef__":true,"id":5269}},"10512":{"timestamp":{"__isSmartRef__":true,"id":10513},"user":"jan.sandbrink","tags":[]},"10513":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10514":{"varMapping":{"__isSmartRef__":true,"id":10515},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10516},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10515":{"this":{"__isSmartRef__":true,"id":5269}},"10516":{"timestamp":{"__isSmartRef__":true,"id":10517},"user":"jan.sandbrink","tags":[]},"10517":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10518":{"varMapping":{"__isSmartRef__":true,"id":10519},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10520},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10519":{"this":{"__isSmartRef__":true,"id":5269}},"10520":{"timestamp":{"__isSmartRef__":true,"id":10521},"user":"jan.sandbrink","tags":[]},"10521":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10522":{"varMapping":{"__isSmartRef__":true,"id":10523},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10524},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10523":{"this":{"__isSmartRef__":true,"id":5269}},"10524":{"timestamp":{"__isSmartRef__":true,"id":10525},"user":"josi","tags":["gemtypes"]},"10525":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10526":{"varMapping":{"__isSmartRef__":true,"id":10527},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10528},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10527":{"this":{"__isSmartRef__":true,"id":5269}},"10528":{"timestamp":{"__isSmartRef__":true,"id":10529},"user":"josi","tags":["gemtypes"]},"10529":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10530":{"varMapping":{"__isSmartRef__":true,"id":10531},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10532},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10531":{"this":{"__isSmartRef__":true,"id":5269}},"10532":{"timestamp":{"__isSmartRef__":true,"id":10533},"user":"soergel","tags":["debug"]},"10533":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10534":{"varMapping":{"__isSmartRef__":true,"id":10535},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10536},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10535":{"this":{"__isSmartRef__":true,"id":5269}},"10536":{"timestamp":{"__isSmartRef__":true,"id":10537},"user":"soergel","tags":["debug"]},"10537":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10538":{"varMapping":{"__isSmartRef__":true,"id":10539},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10540},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10539":{"this":{"__isSmartRef__":true,"id":5269}},"10540":{"timestamp":{"__isSmartRef__":true,"id":10541},"user":"josi","tags":["gemtypes"]},"10541":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10542":{"varMapping":{"__isSmartRef__":true,"id":10543},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10544},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10543":{"this":{"__isSmartRef__":true,"id":5269}},"10544":{"timestamp":{"__isSmartRef__":true,"id":10545},"user":"soergel","tags":[]},"10545":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10546":{"varMapping":{"__isSmartRef__":true,"id":10547},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10548},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10547":{"this":{"__isSmartRef__":true,"id":5269}},"10548":{"timestamp":{"__isSmartRef__":true,"id":10549},"user":"soergel","tags":[]},"10549":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10550":{"varMapping":{"__isSmartRef__":true,"id":10551},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10552},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10551":{"this":{"__isSmartRef__":true,"id":5269}},"10552":{"timestamp":{"__isSmartRef__":true,"id":10553},"user":"soergel","tags":[]},"10553":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10554":{"varMapping":{"__isSmartRef__":true,"id":10555},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10556},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10555":{"this":{"__isSmartRef__":true,"id":5269}},"10556":{"timestamp":{"__isSmartRef__":true,"id":10557},"user":"josi","tags":["gemtypes"]},"10557":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10558":{"varMapping":{"__isSmartRef__":true,"id":10559},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10560},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10559":{"this":{"__isSmartRef__":true,"id":5269}},"10560":{"timestamp":{"__isSmartRef__":true,"id":10561},"user":"josi","tags":["gemtypes"]},"10561":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10562":{"varMapping":{"__isSmartRef__":true,"id":10563},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10564},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10563":{"this":{"__isSmartRef__":true,"id":5269}},"10564":{"timestamp":{"__isSmartRef__":true,"id":10565},"user":"jan.sandbrink","tags":[]},"10565":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10566":{"become":{"__isSmartRef__":true,"id":10567},"onMouseDown":{"__isSmartRef__":true,"id":10571},"updatePicture":{"__isSmartRef__":true,"id":10579},"ruby":{"__isSmartRef__":true,"id":10583},"switchPositionWith":{"__isSmartRef__":true,"id":10587},"addNeighbour":{"__isSmartRef__":true,"id":10591},"amethyst":{"__isSmartRef__":true,"id":10595},"diopside":{"__isSmartRef__":true,"id":10599},"gemTypes":{"__isSmartRef__":true,"id":10603},"becomeRandomGem":{"__isSmartRef__":true,"id":10607},"mark":{"__isSmartRef__":true,"id":10611},"unmark":{"__isSmartRef__":true,"id":10615},"hasNeighbour":{"__isSmartRef__":true,"id":10619},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10623},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10627},"disappear":{"__isSmartRef__":true,"id":10631},"findStreakStart":{"__isSmartRef__":true,"id":10635},"buildStreak":{"__isSmartRef__":true,"id":10639},"scoreStreak":{"__isSmartRef__":true,"id":10643},"tryToStreak":{"__isSmartRef__":true,"id":10647},"blueDiamond":{"__isSmartRef__":true,"id":10651},"prehnite":{"__isSmartRef__":true,"id":10655},"debugUnmark":{"__isSmartRef__":true,"id":10659},"debugMark":{"__isSmartRef__":true,"id":10663},"citrine":{"__isSmartRef__":true,"id":10667},"move":{"__isSmartRef__":true,"id":10671},"performMovement":{"__isSmartRef__":true,"id":10675},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10679},"zircon":{"__isSmartRef__":true,"id":10683},"emerald":{"__isSmartRef__":true,"id":10687},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10691}},"10567":{"varMapping":{"__isSmartRef__":true,"id":10568},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10569},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10568":{"this":{"__isSmartRef__":true,"id":5142}},"10569":{"timestamp":{"__isSmartRef__":true,"id":10570},"user":"josi","tags":[]},"10570":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10571":{"varMapping":{"__isSmartRef__":true,"id":10572},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10577},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10572":{"this":{"__isSmartRef__":true,"id":5142},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10573}},"10573":{"$super":{"__isSmartRef__":true,"id":10574}},"10574":{"varMapping":{"__isSmartRef__":true,"id":10575},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10576},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10575":{"obj":{"__isSmartRef__":true,"id":5142},"name":"onMouseDown"},"10576":{},"10577":{"timestamp":{"__isSmartRef__":true,"id":10578},"user":"soergel","tags":[]},"10578":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10579":{"varMapping":{"__isSmartRef__":true,"id":10580},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10581},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10580":{"this":{"__isSmartRef__":true,"id":5142}},"10581":{"timestamp":{"__isSmartRef__":true,"id":10582},"user":"soergel","tags":[]},"10582":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10583":{"varMapping":{"__isSmartRef__":true,"id":10584},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10585},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10584":{"this":{"__isSmartRef__":true,"id":5142}},"10585":{"timestamp":{"__isSmartRef__":true,"id":10586},"user":"josi","tags":["gemtypes"]},"10586":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10587":{"varMapping":{"__isSmartRef__":true,"id":10588},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10589},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10588":{"this":{"__isSmartRef__":true,"id":5142}},"10589":{"timestamp":{"__isSmartRef__":true,"id":10590},"user":"jan.sandbrink","tags":[]},"10590":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10591":{"varMapping":{"__isSmartRef__":true,"id":10592},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10593},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10592":{"this":{"__isSmartRef__":true,"id":5142}},"10593":{"timestamp":{"__isSmartRef__":true,"id":10594},"user":"jan.sandbrink","tags":[]},"10594":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10595":{"varMapping":{"__isSmartRef__":true,"id":10596},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10597},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10596":{"this":{"__isSmartRef__":true,"id":5142}},"10597":{"timestamp":{"__isSmartRef__":true,"id":10598},"user":"josi","tags":["gemtypes"]},"10598":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10599":{"varMapping":{"__isSmartRef__":true,"id":10600},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10601},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10600":{"this":{"__isSmartRef__":true,"id":5142}},"10601":{"timestamp":{"__isSmartRef__":true,"id":10602},"user":"josi","tags":["gemtypes"]},"10602":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10603":{"varMapping":{"__isSmartRef__":true,"id":10604},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10605},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10604":{"this":{"__isSmartRef__":true,"id":5142}},"10605":{"timestamp":{"__isSmartRef__":true,"id":10606},"user":"josi","tags":[]},"10606":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10607":{"varMapping":{"__isSmartRef__":true,"id":10608},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10609},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10608":{"this":{"__isSmartRef__":true,"id":5142}},"10609":{"timestamp":{"__isSmartRef__":true,"id":10610},"user":"josi","tags":[]},"10610":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10611":{"varMapping":{"__isSmartRef__":true,"id":10612},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10613},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10612":{"this":{"__isSmartRef__":true,"id":5142}},"10613":{"timestamp":{"__isSmartRef__":true,"id":10614},"user":"soergel","tags":[]},"10614":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10615":{"varMapping":{"__isSmartRef__":true,"id":10616},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10617},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10616":{"this":{"__isSmartRef__":true,"id":5142}},"10617":{"timestamp":{"__isSmartRef__":true,"id":10618},"user":"soergel","tags":[]},"10618":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10619":{"varMapping":{"__isSmartRef__":true,"id":10620},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10621},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10620":{"this":{"__isSmartRef__":true,"id":5142}},"10621":{"timestamp":{"__isSmartRef__":true,"id":10622},"user":"soergel","tags":[]},"10622":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10623":{"varMapping":{"__isSmartRef__":true,"id":10624},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10625},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10624":{"this":{"__isSmartRef__":true,"id":5142}},"10625":{"timestamp":{"__isSmartRef__":true,"id":10626},"user":"soergel","tags":["debug"]},"10626":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10627":{"varMapping":{"__isSmartRef__":true,"id":10628},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10629},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10628":{"this":{"__isSmartRef__":true,"id":5142}},"10629":{"timestamp":{"__isSmartRef__":true,"id":10630},"user":"soergel","tags":["debug"]},"10630":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10631":{"varMapping":{"__isSmartRef__":true,"id":10632},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10633},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10632":{"this":{"__isSmartRef__":true,"id":5142}},"10633":{"timestamp":{"__isSmartRef__":true,"id":10634},"user":"jan.sandbrink","tags":[]},"10634":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10635":{"varMapping":{"__isSmartRef__":true,"id":10636},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10637},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10636":{"this":{"__isSmartRef__":true,"id":5142}},"10637":{"timestamp":{"__isSmartRef__":true,"id":10638},"user":"jan.sandbrink","tags":[]},"10638":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10639":{"varMapping":{"__isSmartRef__":true,"id":10640},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10641},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10640":{"this":{"__isSmartRef__":true,"id":5142}},"10641":{"timestamp":{"__isSmartRef__":true,"id":10642},"user":"jan.sandbrink","tags":[]},"10642":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10643":{"varMapping":{"__isSmartRef__":true,"id":10644},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10645},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10644":{"this":{"__isSmartRef__":true,"id":5142}},"10645":{"timestamp":{"__isSmartRef__":true,"id":10646},"user":"jan.sandbrink","tags":[]},"10646":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10647":{"varMapping":{"__isSmartRef__":true,"id":10648},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10649},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10648":{"this":{"__isSmartRef__":true,"id":5142}},"10649":{"timestamp":{"__isSmartRef__":true,"id":10650},"user":"jan.sandbrink","tags":[]},"10650":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10651":{"varMapping":{"__isSmartRef__":true,"id":10652},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10653},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10652":{"this":{"__isSmartRef__":true,"id":5142}},"10653":{"timestamp":{"__isSmartRef__":true,"id":10654},"user":"josi","tags":["gemtypes"]},"10654":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10655":{"varMapping":{"__isSmartRef__":true,"id":10656},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10657},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10656":{"this":{"__isSmartRef__":true,"id":5142}},"10657":{"timestamp":{"__isSmartRef__":true,"id":10658},"user":"josi","tags":["gemtypes"]},"10658":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10659":{"varMapping":{"__isSmartRef__":true,"id":10660},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10661},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10660":{"this":{"__isSmartRef__":true,"id":5142}},"10661":{"timestamp":{"__isSmartRef__":true,"id":10662},"user":"soergel","tags":["debug"]},"10662":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10663":{"varMapping":{"__isSmartRef__":true,"id":10664},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10665},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10664":{"this":{"__isSmartRef__":true,"id":5142}},"10665":{"timestamp":{"__isSmartRef__":true,"id":10666},"user":"soergel","tags":["debug"]},"10666":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10667":{"varMapping":{"__isSmartRef__":true,"id":10668},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10669},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10668":{"this":{"__isSmartRef__":true,"id":5142}},"10669":{"timestamp":{"__isSmartRef__":true,"id":10670},"user":"josi","tags":["gemtypes"]},"10670":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10671":{"varMapping":{"__isSmartRef__":true,"id":10672},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10673},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10672":{"this":{"__isSmartRef__":true,"id":5142}},"10673":{"timestamp":{"__isSmartRef__":true,"id":10674},"user":"soergel","tags":[]},"10674":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10675":{"varMapping":{"__isSmartRef__":true,"id":10676},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10677},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10676":{"this":{"__isSmartRef__":true,"id":5142}},"10677":{"timestamp":{"__isSmartRef__":true,"id":10678},"user":"soergel","tags":[]},"10678":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10679":{"varMapping":{"__isSmartRef__":true,"id":10680},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10681},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10680":{"this":{"__isSmartRef__":true,"id":5142}},"10681":{"timestamp":{"__isSmartRef__":true,"id":10682},"user":"soergel","tags":[]},"10682":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10683":{"varMapping":{"__isSmartRef__":true,"id":10684},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10685},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10684":{"this":{"__isSmartRef__":true,"id":5142}},"10685":{"timestamp":{"__isSmartRef__":true,"id":10686},"user":"josi","tags":["gemtypes"]},"10686":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10687":{"varMapping":{"__isSmartRef__":true,"id":10688},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10689},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10688":{"this":{"__isSmartRef__":true,"id":5142}},"10689":{"timestamp":{"__isSmartRef__":true,"id":10690},"user":"josi","tags":["gemtypes"]},"10690":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10691":{"varMapping":{"__isSmartRef__":true,"id":10692},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10693},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10692":{"this":{"__isSmartRef__":true,"id":5142}},"10693":{"timestamp":{"__isSmartRef__":true,"id":10694},"user":"jan.sandbrink","tags":[]},"10694":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10695":{"become":{"__isSmartRef__":true,"id":10696},"onMouseDown":{"__isSmartRef__":true,"id":10700},"updatePicture":{"__isSmartRef__":true,"id":10708},"ruby":{"__isSmartRef__":true,"id":10712},"switchPositionWith":{"__isSmartRef__":true,"id":10716},"addNeighbour":{"__isSmartRef__":true,"id":10720},"amethyst":{"__isSmartRef__":true,"id":10724},"diopside":{"__isSmartRef__":true,"id":10728},"gemTypes":{"__isSmartRef__":true,"id":10732},"becomeRandomGem":{"__isSmartRef__":true,"id":10736},"mark":{"__isSmartRef__":true,"id":10740},"unmark":{"__isSmartRef__":true,"id":10744},"hasNeighbour":{"__isSmartRef__":true,"id":10748},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10752},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10756},"disappear":{"__isSmartRef__":true,"id":10760},"findStreakStart":{"__isSmartRef__":true,"id":10764},"buildStreak":{"__isSmartRef__":true,"id":10768},"scoreStreak":{"__isSmartRef__":true,"id":10772},"tryToStreak":{"__isSmartRef__":true,"id":10776},"blueDiamond":{"__isSmartRef__":true,"id":10780},"prehnite":{"__isSmartRef__":true,"id":10784},"debugUnmark":{"__isSmartRef__":true,"id":10788},"debugMark":{"__isSmartRef__":true,"id":10792},"citrine":{"__isSmartRef__":true,"id":10796},"move":{"__isSmartRef__":true,"id":10800},"performMovement":{"__isSmartRef__":true,"id":10804},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10808},"zircon":{"__isSmartRef__":true,"id":10812},"emerald":{"__isSmartRef__":true,"id":10816},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10820}},"10696":{"varMapping":{"__isSmartRef__":true,"id":10697},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10698},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10697":{"this":{"__isSmartRef__":true,"id":5041}},"10698":{"timestamp":{"__isSmartRef__":true,"id":10699},"user":"josi","tags":[]},"10699":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10700":{"varMapping":{"__isSmartRef__":true,"id":10701},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10706},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10701":{"this":{"__isSmartRef__":true,"id":5041},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10702}},"10702":{"$super":{"__isSmartRef__":true,"id":10703}},"10703":{"varMapping":{"__isSmartRef__":true,"id":10704},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10705},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10704":{"obj":{"__isSmartRef__":true,"id":5041},"name":"onMouseDown"},"10705":{},"10706":{"timestamp":{"__isSmartRef__":true,"id":10707},"user":"soergel","tags":[]},"10707":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10708":{"varMapping":{"__isSmartRef__":true,"id":10709},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10710},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10709":{"this":{"__isSmartRef__":true,"id":5041}},"10710":{"timestamp":{"__isSmartRef__":true,"id":10711},"user":"soergel","tags":[]},"10711":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10712":{"varMapping":{"__isSmartRef__":true,"id":10713},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10714},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10713":{"this":{"__isSmartRef__":true,"id":5041}},"10714":{"timestamp":{"__isSmartRef__":true,"id":10715},"user":"josi","tags":["gemtypes"]},"10715":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10716":{"varMapping":{"__isSmartRef__":true,"id":10717},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10718},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10717":{"this":{"__isSmartRef__":true,"id":5041}},"10718":{"timestamp":{"__isSmartRef__":true,"id":10719},"user":"jan.sandbrink","tags":[]},"10719":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10720":{"varMapping":{"__isSmartRef__":true,"id":10721},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10722},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10721":{"this":{"__isSmartRef__":true,"id":5041}},"10722":{"timestamp":{"__isSmartRef__":true,"id":10723},"user":"jan.sandbrink","tags":[]},"10723":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10724":{"varMapping":{"__isSmartRef__":true,"id":10725},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10726},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10725":{"this":{"__isSmartRef__":true,"id":5041}},"10726":{"timestamp":{"__isSmartRef__":true,"id":10727},"user":"josi","tags":["gemtypes"]},"10727":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10728":{"varMapping":{"__isSmartRef__":true,"id":10729},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10730},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10729":{"this":{"__isSmartRef__":true,"id":5041}},"10730":{"timestamp":{"__isSmartRef__":true,"id":10731},"user":"josi","tags":["gemtypes"]},"10731":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10732":{"varMapping":{"__isSmartRef__":true,"id":10733},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10734},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10733":{"this":{"__isSmartRef__":true,"id":5041}},"10734":{"timestamp":{"__isSmartRef__":true,"id":10735},"user":"josi","tags":[]},"10735":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10736":{"varMapping":{"__isSmartRef__":true,"id":10737},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10738},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10737":{"this":{"__isSmartRef__":true,"id":5041}},"10738":{"timestamp":{"__isSmartRef__":true,"id":10739},"user":"josi","tags":[]},"10739":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10740":{"varMapping":{"__isSmartRef__":true,"id":10741},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10742},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10741":{"this":{"__isSmartRef__":true,"id":5041}},"10742":{"timestamp":{"__isSmartRef__":true,"id":10743},"user":"soergel","tags":[]},"10743":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10744":{"varMapping":{"__isSmartRef__":true,"id":10745},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10746},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10745":{"this":{"__isSmartRef__":true,"id":5041}},"10746":{"timestamp":{"__isSmartRef__":true,"id":10747},"user":"soergel","tags":[]},"10747":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10748":{"varMapping":{"__isSmartRef__":true,"id":10749},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10750},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10749":{"this":{"__isSmartRef__":true,"id":5041}},"10750":{"timestamp":{"__isSmartRef__":true,"id":10751},"user":"soergel","tags":[]},"10751":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10752":{"varMapping":{"__isSmartRef__":true,"id":10753},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10754},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10753":{"this":{"__isSmartRef__":true,"id":5041}},"10754":{"timestamp":{"__isSmartRef__":true,"id":10755},"user":"soergel","tags":["debug"]},"10755":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10756":{"varMapping":{"__isSmartRef__":true,"id":10757},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10758},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10757":{"this":{"__isSmartRef__":true,"id":5041}},"10758":{"timestamp":{"__isSmartRef__":true,"id":10759},"user":"soergel","tags":["debug"]},"10759":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10760":{"varMapping":{"__isSmartRef__":true,"id":10761},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10762},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10761":{"this":{"__isSmartRef__":true,"id":5041}},"10762":{"timestamp":{"__isSmartRef__":true,"id":10763},"user":"jan.sandbrink","tags":[]},"10763":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10764":{"varMapping":{"__isSmartRef__":true,"id":10765},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10766},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10765":{"this":{"__isSmartRef__":true,"id":5041}},"10766":{"timestamp":{"__isSmartRef__":true,"id":10767},"user":"jan.sandbrink","tags":[]},"10767":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10768":{"varMapping":{"__isSmartRef__":true,"id":10769},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10770},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10769":{"this":{"__isSmartRef__":true,"id":5041}},"10770":{"timestamp":{"__isSmartRef__":true,"id":10771},"user":"jan.sandbrink","tags":[]},"10771":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10772":{"varMapping":{"__isSmartRef__":true,"id":10773},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10774},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10773":{"this":{"__isSmartRef__":true,"id":5041}},"10774":{"timestamp":{"__isSmartRef__":true,"id":10775},"user":"jan.sandbrink","tags":[]},"10775":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10776":{"varMapping":{"__isSmartRef__":true,"id":10777},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10778},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10777":{"this":{"__isSmartRef__":true,"id":5041}},"10778":{"timestamp":{"__isSmartRef__":true,"id":10779},"user":"jan.sandbrink","tags":[]},"10779":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10780":{"varMapping":{"__isSmartRef__":true,"id":10781},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10782},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10781":{"this":{"__isSmartRef__":true,"id":5041}},"10782":{"timestamp":{"__isSmartRef__":true,"id":10783},"user":"josi","tags":["gemtypes"]},"10783":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10784":{"varMapping":{"__isSmartRef__":true,"id":10785},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10785":{"this":{"__isSmartRef__":true,"id":5041}},"10786":{"timestamp":{"__isSmartRef__":true,"id":10787},"user":"josi","tags":["gemtypes"]},"10787":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10788":{"varMapping":{"__isSmartRef__":true,"id":10789},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10790},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10789":{"this":{"__isSmartRef__":true,"id":5041}},"10790":{"timestamp":{"__isSmartRef__":true,"id":10791},"user":"soergel","tags":["debug"]},"10791":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10792":{"varMapping":{"__isSmartRef__":true,"id":10793},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10794},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10793":{"this":{"__isSmartRef__":true,"id":5041}},"10794":{"timestamp":{"__isSmartRef__":true,"id":10795},"user":"soergel","tags":["debug"]},"10795":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10796":{"varMapping":{"__isSmartRef__":true,"id":10797},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10798},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10797":{"this":{"__isSmartRef__":true,"id":5041}},"10798":{"timestamp":{"__isSmartRef__":true,"id":10799},"user":"josi","tags":["gemtypes"]},"10799":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10800":{"varMapping":{"__isSmartRef__":true,"id":10801},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10802},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10801":{"this":{"__isSmartRef__":true,"id":5041}},"10802":{"timestamp":{"__isSmartRef__":true,"id":10803},"user":"soergel","tags":[]},"10803":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10804":{"varMapping":{"__isSmartRef__":true,"id":10805},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10806},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10805":{"this":{"__isSmartRef__":true,"id":5041}},"10806":{"timestamp":{"__isSmartRef__":true,"id":10807},"user":"soergel","tags":[]},"10807":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10808":{"varMapping":{"__isSmartRef__":true,"id":10809},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10810},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10809":{"this":{"__isSmartRef__":true,"id":5041}},"10810":{"timestamp":{"__isSmartRef__":true,"id":10811},"user":"soergel","tags":[]},"10811":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10812":{"varMapping":{"__isSmartRef__":true,"id":10813},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10814},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10813":{"this":{"__isSmartRef__":true,"id":5041}},"10814":{"timestamp":{"__isSmartRef__":true,"id":10815},"user":"josi","tags":["gemtypes"]},"10815":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10816":{"varMapping":{"__isSmartRef__":true,"id":10817},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10818},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10817":{"this":{"__isSmartRef__":true,"id":5041}},"10818":{"timestamp":{"__isSmartRef__":true,"id":10819},"user":"josi","tags":["gemtypes"]},"10819":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10820":{"varMapping":{"__isSmartRef__":true,"id":10821},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10822},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10821":{"this":{"__isSmartRef__":true,"id":5041}},"10822":{"timestamp":{"__isSmartRef__":true,"id":10823},"user":"jan.sandbrink","tags":[]},"10823":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10824":{"become":{"__isSmartRef__":true,"id":10825},"onMouseDown":{"__isSmartRef__":true,"id":10829},"updatePicture":{"__isSmartRef__":true,"id":10837},"ruby":{"__isSmartRef__":true,"id":10841},"switchPositionWith":{"__isSmartRef__":true,"id":10845},"addNeighbour":{"__isSmartRef__":true,"id":10849},"amethyst":{"__isSmartRef__":true,"id":10853},"diopside":{"__isSmartRef__":true,"id":10857},"gemTypes":{"__isSmartRef__":true,"id":10861},"becomeRandomGem":{"__isSmartRef__":true,"id":10865},"mark":{"__isSmartRef__":true,"id":10869},"unmark":{"__isSmartRef__":true,"id":10873},"hasNeighbour":{"__isSmartRef__":true,"id":10877},"debugMarkNeighbours":{"__isSmartRef__":true,"id":10881},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":10885},"disappear":{"__isSmartRef__":true,"id":10889},"findStreakStart":{"__isSmartRef__":true,"id":10893},"buildStreak":{"__isSmartRef__":true,"id":10897},"scoreStreak":{"__isSmartRef__":true,"id":10901},"tryToStreak":{"__isSmartRef__":true,"id":10905},"blueDiamond":{"__isSmartRef__":true,"id":10909},"prehnite":{"__isSmartRef__":true,"id":10913},"debugUnmark":{"__isSmartRef__":true,"id":10917},"debugMark":{"__isSmartRef__":true,"id":10921},"citrine":{"__isSmartRef__":true,"id":10925},"move":{"__isSmartRef__":true,"id":10929},"performMovement":{"__isSmartRef__":true,"id":10933},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":10937},"zircon":{"__isSmartRef__":true,"id":10941},"emerald":{"__isSmartRef__":true,"id":10945},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":10949}},"10825":{"varMapping":{"__isSmartRef__":true,"id":10826},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10827},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10826":{"this":{"__isSmartRef__":true,"id":4909}},"10827":{"timestamp":{"__isSmartRef__":true,"id":10828},"user":"josi","tags":[]},"10828":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10829":{"varMapping":{"__isSmartRef__":true,"id":10830},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10835},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10830":{"this":{"__isSmartRef__":true,"id":4909},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10831}},"10831":{"$super":{"__isSmartRef__":true,"id":10832}},"10832":{"varMapping":{"__isSmartRef__":true,"id":10833},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10834},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10833":{"obj":{"__isSmartRef__":true,"id":4909},"name":"onMouseDown"},"10834":{},"10835":{"timestamp":{"__isSmartRef__":true,"id":10836},"user":"soergel","tags":[]},"10836":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10837":{"varMapping":{"__isSmartRef__":true,"id":10838},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10839},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10838":{"this":{"__isSmartRef__":true,"id":4909}},"10839":{"timestamp":{"__isSmartRef__":true,"id":10840},"user":"soergel","tags":[]},"10840":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10841":{"varMapping":{"__isSmartRef__":true,"id":10842},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10843},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10842":{"this":{"__isSmartRef__":true,"id":4909}},"10843":{"timestamp":{"__isSmartRef__":true,"id":10844},"user":"josi","tags":["gemtypes"]},"10844":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10845":{"varMapping":{"__isSmartRef__":true,"id":10846},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10847},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10846":{"this":{"__isSmartRef__":true,"id":4909}},"10847":{"timestamp":{"__isSmartRef__":true,"id":10848},"user":"jan.sandbrink","tags":[]},"10848":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10849":{"varMapping":{"__isSmartRef__":true,"id":10850},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10851},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10850":{"this":{"__isSmartRef__":true,"id":4909}},"10851":{"timestamp":{"__isSmartRef__":true,"id":10852},"user":"jan.sandbrink","tags":[]},"10852":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10853":{"varMapping":{"__isSmartRef__":true,"id":10854},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10855},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10854":{"this":{"__isSmartRef__":true,"id":4909}},"10855":{"timestamp":{"__isSmartRef__":true,"id":10856},"user":"josi","tags":["gemtypes"]},"10856":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10857":{"varMapping":{"__isSmartRef__":true,"id":10858},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10859},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10858":{"this":{"__isSmartRef__":true,"id":4909}},"10859":{"timestamp":{"__isSmartRef__":true,"id":10860},"user":"josi","tags":["gemtypes"]},"10860":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10861":{"varMapping":{"__isSmartRef__":true,"id":10862},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10863},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10862":{"this":{"__isSmartRef__":true,"id":4909}},"10863":{"timestamp":{"__isSmartRef__":true,"id":10864},"user":"josi","tags":[]},"10864":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10865":{"varMapping":{"__isSmartRef__":true,"id":10866},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10867},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10866":{"this":{"__isSmartRef__":true,"id":4909}},"10867":{"timestamp":{"__isSmartRef__":true,"id":10868},"user":"josi","tags":[]},"10868":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10869":{"varMapping":{"__isSmartRef__":true,"id":10870},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10871},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10870":{"this":{"__isSmartRef__":true,"id":4909}},"10871":{"timestamp":{"__isSmartRef__":true,"id":10872},"user":"soergel","tags":[]},"10872":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"10873":{"varMapping":{"__isSmartRef__":true,"id":10874},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":10875},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10874":{"this":{"__isSmartRef__":true,"id":4909}},"10875":{"timestamp":{"__isSmartRef__":true,"id":10876},"user":"soergel","tags":[]},"10876":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"10877":{"varMapping":{"__isSmartRef__":true,"id":10878},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":10879},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10878":{"this":{"__isSmartRef__":true,"id":4909}},"10879":{"timestamp":{"__isSmartRef__":true,"id":10880},"user":"soergel","tags":[]},"10880":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"10881":{"varMapping":{"__isSmartRef__":true,"id":10882},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10883},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10882":{"this":{"__isSmartRef__":true,"id":4909}},"10883":{"timestamp":{"__isSmartRef__":true,"id":10884},"user":"soergel","tags":["debug"]},"10884":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"10885":{"varMapping":{"__isSmartRef__":true,"id":10886},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":10887},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10886":{"this":{"__isSmartRef__":true,"id":4909}},"10887":{"timestamp":{"__isSmartRef__":true,"id":10888},"user":"soergel","tags":["debug"]},"10888":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"10889":{"varMapping":{"__isSmartRef__":true,"id":10890},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":10891},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10890":{"this":{"__isSmartRef__":true,"id":4909}},"10891":{"timestamp":{"__isSmartRef__":true,"id":10892},"user":"jan.sandbrink","tags":[]},"10892":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"10893":{"varMapping":{"__isSmartRef__":true,"id":10894},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10895},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10894":{"this":{"__isSmartRef__":true,"id":4909}},"10895":{"timestamp":{"__isSmartRef__":true,"id":10896},"user":"jan.sandbrink","tags":[]},"10896":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"10897":{"varMapping":{"__isSmartRef__":true,"id":10898},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":10899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10898":{"this":{"__isSmartRef__":true,"id":4909}},"10899":{"timestamp":{"__isSmartRef__":true,"id":10900},"user":"jan.sandbrink","tags":[]},"10900":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"10901":{"varMapping":{"__isSmartRef__":true,"id":10902},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":10903},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10902":{"this":{"__isSmartRef__":true,"id":4909}},"10903":{"timestamp":{"__isSmartRef__":true,"id":10904},"user":"jan.sandbrink","tags":[]},"10904":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"10905":{"varMapping":{"__isSmartRef__":true,"id":10906},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":10907},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10906":{"this":{"__isSmartRef__":true,"id":4909}},"10907":{"timestamp":{"__isSmartRef__":true,"id":10908},"user":"jan.sandbrink","tags":[]},"10908":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"10909":{"varMapping":{"__isSmartRef__":true,"id":10910},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":10911},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10910":{"this":{"__isSmartRef__":true,"id":4909}},"10911":{"timestamp":{"__isSmartRef__":true,"id":10912},"user":"josi","tags":["gemtypes"]},"10912":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"10913":{"varMapping":{"__isSmartRef__":true,"id":10914},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":10915},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10914":{"this":{"__isSmartRef__":true,"id":4909}},"10915":{"timestamp":{"__isSmartRef__":true,"id":10916},"user":"josi","tags":["gemtypes"]},"10916":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"10917":{"varMapping":{"__isSmartRef__":true,"id":10918},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":10919},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10918":{"this":{"__isSmartRef__":true,"id":4909}},"10919":{"timestamp":{"__isSmartRef__":true,"id":10920},"user":"soergel","tags":["debug"]},"10920":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"10921":{"varMapping":{"__isSmartRef__":true,"id":10922},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":10923},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10922":{"this":{"__isSmartRef__":true,"id":4909}},"10923":{"timestamp":{"__isSmartRef__":true,"id":10924},"user":"soergel","tags":["debug"]},"10924":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"10925":{"varMapping":{"__isSmartRef__":true,"id":10926},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":10927},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10926":{"this":{"__isSmartRef__":true,"id":4909}},"10927":{"timestamp":{"__isSmartRef__":true,"id":10928},"user":"josi","tags":["gemtypes"]},"10928":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"10929":{"varMapping":{"__isSmartRef__":true,"id":10930},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":10931},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10930":{"this":{"__isSmartRef__":true,"id":4909}},"10931":{"timestamp":{"__isSmartRef__":true,"id":10932},"user":"soergel","tags":[]},"10932":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"10933":{"varMapping":{"__isSmartRef__":true,"id":10934},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":10935},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10934":{"this":{"__isSmartRef__":true,"id":4909}},"10935":{"timestamp":{"__isSmartRef__":true,"id":10936},"user":"soergel","tags":[]},"10936":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"10937":{"varMapping":{"__isSmartRef__":true,"id":10938},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":10939},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10938":{"this":{"__isSmartRef__":true,"id":4909}},"10939":{"timestamp":{"__isSmartRef__":true,"id":10940},"user":"soergel","tags":[]},"10940":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"10941":{"varMapping":{"__isSmartRef__":true,"id":10942},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":10943},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10942":{"this":{"__isSmartRef__":true,"id":4909}},"10943":{"timestamp":{"__isSmartRef__":true,"id":10944},"user":"josi","tags":["gemtypes"]},"10944":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"10945":{"varMapping":{"__isSmartRef__":true,"id":10946},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":10947},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10946":{"this":{"__isSmartRef__":true,"id":4909}},"10947":{"timestamp":{"__isSmartRef__":true,"id":10948},"user":"josi","tags":["gemtypes"]},"10948":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"10949":{"varMapping":{"__isSmartRef__":true,"id":10950},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":10951},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10950":{"this":{"__isSmartRef__":true,"id":4909}},"10951":{"timestamp":{"__isSmartRef__":true,"id":10952},"user":"jan.sandbrink","tags":[]},"10952":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"10953":{"become":{"__isSmartRef__":true,"id":10954},"onMouseDown":{"__isSmartRef__":true,"id":10958},"updatePicture":{"__isSmartRef__":true,"id":10966},"ruby":{"__isSmartRef__":true,"id":10970},"switchPositionWith":{"__isSmartRef__":true,"id":10974},"addNeighbour":{"__isSmartRef__":true,"id":10978},"amethyst":{"__isSmartRef__":true,"id":10982},"diopside":{"__isSmartRef__":true,"id":10986},"gemTypes":{"__isSmartRef__":true,"id":10990},"becomeRandomGem":{"__isSmartRef__":true,"id":10994},"mark":{"__isSmartRef__":true,"id":10998},"unmark":{"__isSmartRef__":true,"id":11002},"hasNeighbour":{"__isSmartRef__":true,"id":11006},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11010},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11014},"disappear":{"__isSmartRef__":true,"id":11018},"findStreakStart":{"__isSmartRef__":true,"id":11022},"buildStreak":{"__isSmartRef__":true,"id":11026},"scoreStreak":{"__isSmartRef__":true,"id":11030},"tryToStreak":{"__isSmartRef__":true,"id":11034},"blueDiamond":{"__isSmartRef__":true,"id":11038},"prehnite":{"__isSmartRef__":true,"id":11042},"debugUnmark":{"__isSmartRef__":true,"id":11046},"debugMark":{"__isSmartRef__":true,"id":11050},"citrine":{"__isSmartRef__":true,"id":11054},"move":{"__isSmartRef__":true,"id":11058},"performMovement":{"__isSmartRef__":true,"id":11062},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11066},"zircon":{"__isSmartRef__":true,"id":11070},"emerald":{"__isSmartRef__":true,"id":11074},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11078}},"10954":{"varMapping":{"__isSmartRef__":true,"id":10955},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10956},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10955":{"this":{"__isSmartRef__":true,"id":4791}},"10956":{"timestamp":{"__isSmartRef__":true,"id":10957},"user":"josi","tags":[]},"10957":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"10958":{"varMapping":{"__isSmartRef__":true,"id":10959},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":10964},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10959":{"this":{"__isSmartRef__":true,"id":4791},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":10960}},"10960":{"$super":{"__isSmartRef__":true,"id":10961}},"10961":{"varMapping":{"__isSmartRef__":true,"id":10962},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":10963},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10962":{"obj":{"__isSmartRef__":true,"id":4791},"name":"onMouseDown"},"10963":{},"10964":{"timestamp":{"__isSmartRef__":true,"id":10965},"user":"soergel","tags":[]},"10965":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"10966":{"varMapping":{"__isSmartRef__":true,"id":10967},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":10968},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10967":{"this":{"__isSmartRef__":true,"id":4791}},"10968":{"timestamp":{"__isSmartRef__":true,"id":10969},"user":"soergel","tags":[]},"10969":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"10970":{"varMapping":{"__isSmartRef__":true,"id":10971},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":10972},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10971":{"this":{"__isSmartRef__":true,"id":4791}},"10972":{"timestamp":{"__isSmartRef__":true,"id":10973},"user":"josi","tags":["gemtypes"]},"10973":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"10974":{"varMapping":{"__isSmartRef__":true,"id":10975},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":10976},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10975":{"this":{"__isSmartRef__":true,"id":4791}},"10976":{"timestamp":{"__isSmartRef__":true,"id":10977},"user":"jan.sandbrink","tags":[]},"10977":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"10978":{"varMapping":{"__isSmartRef__":true,"id":10979},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":10980},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10979":{"this":{"__isSmartRef__":true,"id":4791}},"10980":{"timestamp":{"__isSmartRef__":true,"id":10981},"user":"jan.sandbrink","tags":[]},"10981":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"10982":{"varMapping":{"__isSmartRef__":true,"id":10983},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":10984},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10983":{"this":{"__isSmartRef__":true,"id":4791}},"10984":{"timestamp":{"__isSmartRef__":true,"id":10985},"user":"josi","tags":["gemtypes"]},"10985":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"10986":{"varMapping":{"__isSmartRef__":true,"id":10987},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":10988},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10987":{"this":{"__isSmartRef__":true,"id":4791}},"10988":{"timestamp":{"__isSmartRef__":true,"id":10989},"user":"josi","tags":["gemtypes"]},"10989":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"10990":{"varMapping":{"__isSmartRef__":true,"id":10991},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":10992},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10991":{"this":{"__isSmartRef__":true,"id":4791}},"10992":{"timestamp":{"__isSmartRef__":true,"id":10993},"user":"josi","tags":[]},"10993":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"10994":{"varMapping":{"__isSmartRef__":true,"id":10995},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":10996},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10995":{"this":{"__isSmartRef__":true,"id":4791}},"10996":{"timestamp":{"__isSmartRef__":true,"id":10997},"user":"josi","tags":[]},"10997":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"10998":{"varMapping":{"__isSmartRef__":true,"id":10999},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11000},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"10999":{"this":{"__isSmartRef__":true,"id":4791}},"11000":{"timestamp":{"__isSmartRef__":true,"id":11001},"user":"soergel","tags":[]},"11001":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11002":{"varMapping":{"__isSmartRef__":true,"id":11003},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11004},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11003":{"this":{"__isSmartRef__":true,"id":4791}},"11004":{"timestamp":{"__isSmartRef__":true,"id":11005},"user":"soergel","tags":[]},"11005":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11006":{"varMapping":{"__isSmartRef__":true,"id":11007},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11008},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11007":{"this":{"__isSmartRef__":true,"id":4791}},"11008":{"timestamp":{"__isSmartRef__":true,"id":11009},"user":"soergel","tags":[]},"11009":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11010":{"varMapping":{"__isSmartRef__":true,"id":11011},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11012},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11011":{"this":{"__isSmartRef__":true,"id":4791}},"11012":{"timestamp":{"__isSmartRef__":true,"id":11013},"user":"soergel","tags":["debug"]},"11013":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11014":{"varMapping":{"__isSmartRef__":true,"id":11015},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11016},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11015":{"this":{"__isSmartRef__":true,"id":4791}},"11016":{"timestamp":{"__isSmartRef__":true,"id":11017},"user":"soergel","tags":["debug"]},"11017":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11018":{"varMapping":{"__isSmartRef__":true,"id":11019},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11020},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11019":{"this":{"__isSmartRef__":true,"id":4791}},"11020":{"timestamp":{"__isSmartRef__":true,"id":11021},"user":"jan.sandbrink","tags":[]},"11021":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11022":{"varMapping":{"__isSmartRef__":true,"id":11023},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11024},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11023":{"this":{"__isSmartRef__":true,"id":4791}},"11024":{"timestamp":{"__isSmartRef__":true,"id":11025},"user":"jan.sandbrink","tags":[]},"11025":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11026":{"varMapping":{"__isSmartRef__":true,"id":11027},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11028},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11027":{"this":{"__isSmartRef__":true,"id":4791}},"11028":{"timestamp":{"__isSmartRef__":true,"id":11029},"user":"jan.sandbrink","tags":[]},"11029":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11030":{"varMapping":{"__isSmartRef__":true,"id":11031},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11032},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11031":{"this":{"__isSmartRef__":true,"id":4791}},"11032":{"timestamp":{"__isSmartRef__":true,"id":11033},"user":"jan.sandbrink","tags":[]},"11033":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11034":{"varMapping":{"__isSmartRef__":true,"id":11035},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11036},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11035":{"this":{"__isSmartRef__":true,"id":4791}},"11036":{"timestamp":{"__isSmartRef__":true,"id":11037},"user":"jan.sandbrink","tags":[]},"11037":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11038":{"varMapping":{"__isSmartRef__":true,"id":11039},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11040},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11039":{"this":{"__isSmartRef__":true,"id":4791}},"11040":{"timestamp":{"__isSmartRef__":true,"id":11041},"user":"josi","tags":["gemtypes"]},"11041":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11042":{"varMapping":{"__isSmartRef__":true,"id":11043},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11044},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11043":{"this":{"__isSmartRef__":true,"id":4791}},"11044":{"timestamp":{"__isSmartRef__":true,"id":11045},"user":"josi","tags":["gemtypes"]},"11045":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11046":{"varMapping":{"__isSmartRef__":true,"id":11047},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11048},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11047":{"this":{"__isSmartRef__":true,"id":4791}},"11048":{"timestamp":{"__isSmartRef__":true,"id":11049},"user":"soergel","tags":["debug"]},"11049":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11050":{"varMapping":{"__isSmartRef__":true,"id":11051},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11052},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11051":{"this":{"__isSmartRef__":true,"id":4791}},"11052":{"timestamp":{"__isSmartRef__":true,"id":11053},"user":"soergel","tags":["debug"]},"11053":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11054":{"varMapping":{"__isSmartRef__":true,"id":11055},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11056},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11055":{"this":{"__isSmartRef__":true,"id":4791}},"11056":{"timestamp":{"__isSmartRef__":true,"id":11057},"user":"josi","tags":["gemtypes"]},"11057":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11058":{"varMapping":{"__isSmartRef__":true,"id":11059},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11060},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11059":{"this":{"__isSmartRef__":true,"id":4791}},"11060":{"timestamp":{"__isSmartRef__":true,"id":11061},"user":"soergel","tags":[]},"11061":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11062":{"varMapping":{"__isSmartRef__":true,"id":11063},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11064},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11063":{"this":{"__isSmartRef__":true,"id":4791}},"11064":{"timestamp":{"__isSmartRef__":true,"id":11065},"user":"soergel","tags":[]},"11065":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11066":{"varMapping":{"__isSmartRef__":true,"id":11067},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11068},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11067":{"this":{"__isSmartRef__":true,"id":4791}},"11068":{"timestamp":{"__isSmartRef__":true,"id":11069},"user":"soergel","tags":[]},"11069":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11070":{"varMapping":{"__isSmartRef__":true,"id":11071},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11072},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11071":{"this":{"__isSmartRef__":true,"id":4791}},"11072":{"timestamp":{"__isSmartRef__":true,"id":11073},"user":"josi","tags":["gemtypes"]},"11073":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11074":{"varMapping":{"__isSmartRef__":true,"id":11075},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11076},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11075":{"this":{"__isSmartRef__":true,"id":4791}},"11076":{"timestamp":{"__isSmartRef__":true,"id":11077},"user":"josi","tags":["gemtypes"]},"11077":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11078":{"varMapping":{"__isSmartRef__":true,"id":11079},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11080},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11079":{"this":{"__isSmartRef__":true,"id":4791}},"11080":{"timestamp":{"__isSmartRef__":true,"id":11081},"user":"jan.sandbrink","tags":[]},"11081":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11082":{"become":{"__isSmartRef__":true,"id":11083},"onMouseDown":{"__isSmartRef__":true,"id":11087},"updatePicture":{"__isSmartRef__":true,"id":11095},"ruby":{"__isSmartRef__":true,"id":11099},"switchPositionWith":{"__isSmartRef__":true,"id":11103},"addNeighbour":{"__isSmartRef__":true,"id":11107},"amethyst":{"__isSmartRef__":true,"id":11111},"diopside":{"__isSmartRef__":true,"id":11115},"gemTypes":{"__isSmartRef__":true,"id":11119},"becomeRandomGem":{"__isSmartRef__":true,"id":11123},"mark":{"__isSmartRef__":true,"id":11127},"unmark":{"__isSmartRef__":true,"id":11131},"hasNeighbour":{"__isSmartRef__":true,"id":11135},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11139},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11143},"disappear":{"__isSmartRef__":true,"id":11147},"findStreakStart":{"__isSmartRef__":true,"id":11151},"buildStreak":{"__isSmartRef__":true,"id":11155},"scoreStreak":{"__isSmartRef__":true,"id":11159},"tryToStreak":{"__isSmartRef__":true,"id":11163},"blueDiamond":{"__isSmartRef__":true,"id":11167},"prehnite":{"__isSmartRef__":true,"id":11171},"debugUnmark":{"__isSmartRef__":true,"id":11175},"debugMark":{"__isSmartRef__":true,"id":11179},"citrine":{"__isSmartRef__":true,"id":11183},"move":{"__isSmartRef__":true,"id":11187},"performMovement":{"__isSmartRef__":true,"id":11191},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11195},"zircon":{"__isSmartRef__":true,"id":11199},"emerald":{"__isSmartRef__":true,"id":11203},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11207}},"11083":{"varMapping":{"__isSmartRef__":true,"id":11084},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11085},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11084":{"this":{"__isSmartRef__":true,"id":4659}},"11085":{"timestamp":{"__isSmartRef__":true,"id":11086},"user":"josi","tags":[]},"11086":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11087":{"varMapping":{"__isSmartRef__":true,"id":11088},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11093},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11088":{"this":{"__isSmartRef__":true,"id":4659},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11089}},"11089":{"$super":{"__isSmartRef__":true,"id":11090}},"11090":{"varMapping":{"__isSmartRef__":true,"id":11091},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11092},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11091":{"obj":{"__isSmartRef__":true,"id":4659},"name":"onMouseDown"},"11092":{},"11093":{"timestamp":{"__isSmartRef__":true,"id":11094},"user":"soergel","tags":[]},"11094":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11095":{"varMapping":{"__isSmartRef__":true,"id":11096},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11097},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11096":{"this":{"__isSmartRef__":true,"id":4659}},"11097":{"timestamp":{"__isSmartRef__":true,"id":11098},"user":"soergel","tags":[]},"11098":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11099":{"varMapping":{"__isSmartRef__":true,"id":11100},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11101},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11100":{"this":{"__isSmartRef__":true,"id":4659}},"11101":{"timestamp":{"__isSmartRef__":true,"id":11102},"user":"josi","tags":["gemtypes"]},"11102":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11103":{"varMapping":{"__isSmartRef__":true,"id":11104},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11105},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11104":{"this":{"__isSmartRef__":true,"id":4659}},"11105":{"timestamp":{"__isSmartRef__":true,"id":11106},"user":"jan.sandbrink","tags":[]},"11106":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11107":{"varMapping":{"__isSmartRef__":true,"id":11108},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11109},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11108":{"this":{"__isSmartRef__":true,"id":4659}},"11109":{"timestamp":{"__isSmartRef__":true,"id":11110},"user":"jan.sandbrink","tags":[]},"11110":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11111":{"varMapping":{"__isSmartRef__":true,"id":11112},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11113},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11112":{"this":{"__isSmartRef__":true,"id":4659}},"11113":{"timestamp":{"__isSmartRef__":true,"id":11114},"user":"josi","tags":["gemtypes"]},"11114":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11115":{"varMapping":{"__isSmartRef__":true,"id":11116},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11117},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11116":{"this":{"__isSmartRef__":true,"id":4659}},"11117":{"timestamp":{"__isSmartRef__":true,"id":11118},"user":"josi","tags":["gemtypes"]},"11118":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11119":{"varMapping":{"__isSmartRef__":true,"id":11120},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11121},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11120":{"this":{"__isSmartRef__":true,"id":4659}},"11121":{"timestamp":{"__isSmartRef__":true,"id":11122},"user":"josi","tags":[]},"11122":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11123":{"varMapping":{"__isSmartRef__":true,"id":11124},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11125},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11124":{"this":{"__isSmartRef__":true,"id":4659}},"11125":{"timestamp":{"__isSmartRef__":true,"id":11126},"user":"josi","tags":[]},"11126":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11127":{"varMapping":{"__isSmartRef__":true,"id":11128},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11129},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11128":{"this":{"__isSmartRef__":true,"id":4659}},"11129":{"timestamp":{"__isSmartRef__":true,"id":11130},"user":"soergel","tags":[]},"11130":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11131":{"varMapping":{"__isSmartRef__":true,"id":11132},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11133},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11132":{"this":{"__isSmartRef__":true,"id":4659}},"11133":{"timestamp":{"__isSmartRef__":true,"id":11134},"user":"soergel","tags":[]},"11134":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11135":{"varMapping":{"__isSmartRef__":true,"id":11136},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11137},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11136":{"this":{"__isSmartRef__":true,"id":4659}},"11137":{"timestamp":{"__isSmartRef__":true,"id":11138},"user":"soergel","tags":[]},"11138":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11139":{"varMapping":{"__isSmartRef__":true,"id":11140},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11141},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11140":{"this":{"__isSmartRef__":true,"id":4659}},"11141":{"timestamp":{"__isSmartRef__":true,"id":11142},"user":"soergel","tags":["debug"]},"11142":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11143":{"varMapping":{"__isSmartRef__":true,"id":11144},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11145},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11144":{"this":{"__isSmartRef__":true,"id":4659}},"11145":{"timestamp":{"__isSmartRef__":true,"id":11146},"user":"soergel","tags":["debug"]},"11146":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11147":{"varMapping":{"__isSmartRef__":true,"id":11148},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11149},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11148":{"this":{"__isSmartRef__":true,"id":4659}},"11149":{"timestamp":{"__isSmartRef__":true,"id":11150},"user":"jan.sandbrink","tags":[]},"11150":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11151":{"varMapping":{"__isSmartRef__":true,"id":11152},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11153},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11152":{"this":{"__isSmartRef__":true,"id":4659}},"11153":{"timestamp":{"__isSmartRef__":true,"id":11154},"user":"jan.sandbrink","tags":[]},"11154":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11155":{"varMapping":{"__isSmartRef__":true,"id":11156},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11156":{"this":{"__isSmartRef__":true,"id":4659}},"11157":{"timestamp":{"__isSmartRef__":true,"id":11158},"user":"jan.sandbrink","tags":[]},"11158":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11159":{"varMapping":{"__isSmartRef__":true,"id":11160},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11161},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11160":{"this":{"__isSmartRef__":true,"id":4659}},"11161":{"timestamp":{"__isSmartRef__":true,"id":11162},"user":"jan.sandbrink","tags":[]},"11162":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11163":{"varMapping":{"__isSmartRef__":true,"id":11164},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11165},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11164":{"this":{"__isSmartRef__":true,"id":4659}},"11165":{"timestamp":{"__isSmartRef__":true,"id":11166},"user":"jan.sandbrink","tags":[]},"11166":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11167":{"varMapping":{"__isSmartRef__":true,"id":11168},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11169},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11168":{"this":{"__isSmartRef__":true,"id":4659}},"11169":{"timestamp":{"__isSmartRef__":true,"id":11170},"user":"josi","tags":["gemtypes"]},"11170":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11171":{"varMapping":{"__isSmartRef__":true,"id":11172},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11172":{"this":{"__isSmartRef__":true,"id":4659}},"11173":{"timestamp":{"__isSmartRef__":true,"id":11174},"user":"josi","tags":["gemtypes"]},"11174":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11175":{"varMapping":{"__isSmartRef__":true,"id":11176},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11177},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11176":{"this":{"__isSmartRef__":true,"id":4659}},"11177":{"timestamp":{"__isSmartRef__":true,"id":11178},"user":"soergel","tags":["debug"]},"11178":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11179":{"varMapping":{"__isSmartRef__":true,"id":11180},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11181},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11180":{"this":{"__isSmartRef__":true,"id":4659}},"11181":{"timestamp":{"__isSmartRef__":true,"id":11182},"user":"soergel","tags":["debug"]},"11182":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11183":{"varMapping":{"__isSmartRef__":true,"id":11184},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11185},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11184":{"this":{"__isSmartRef__":true,"id":4659}},"11185":{"timestamp":{"__isSmartRef__":true,"id":11186},"user":"josi","tags":["gemtypes"]},"11186":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11187":{"varMapping":{"__isSmartRef__":true,"id":11188},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11189},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11188":{"this":{"__isSmartRef__":true,"id":4659}},"11189":{"timestamp":{"__isSmartRef__":true,"id":11190},"user":"soergel","tags":[]},"11190":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11191":{"varMapping":{"__isSmartRef__":true,"id":11192},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11193},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11192":{"this":{"__isSmartRef__":true,"id":4659}},"11193":{"timestamp":{"__isSmartRef__":true,"id":11194},"user":"soergel","tags":[]},"11194":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11195":{"varMapping":{"__isSmartRef__":true,"id":11196},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11197},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11196":{"this":{"__isSmartRef__":true,"id":4659}},"11197":{"timestamp":{"__isSmartRef__":true,"id":11198},"user":"soergel","tags":[]},"11198":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11199":{"varMapping":{"__isSmartRef__":true,"id":11200},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11201},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11200":{"this":{"__isSmartRef__":true,"id":4659}},"11201":{"timestamp":{"__isSmartRef__":true,"id":11202},"user":"josi","tags":["gemtypes"]},"11202":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11203":{"varMapping":{"__isSmartRef__":true,"id":11204},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11205},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11204":{"this":{"__isSmartRef__":true,"id":4659}},"11205":{"timestamp":{"__isSmartRef__":true,"id":11206},"user":"josi","tags":["gemtypes"]},"11206":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11207":{"varMapping":{"__isSmartRef__":true,"id":11208},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11209},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11208":{"this":{"__isSmartRef__":true,"id":4659}},"11209":{"timestamp":{"__isSmartRef__":true,"id":11210},"user":"jan.sandbrink","tags":[]},"11210":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11211":{"become":{"__isSmartRef__":true,"id":11212},"onMouseDown":{"__isSmartRef__":true,"id":11216},"updatePicture":{"__isSmartRef__":true,"id":11224},"ruby":{"__isSmartRef__":true,"id":11228},"switchPositionWith":{"__isSmartRef__":true,"id":11232},"addNeighbour":{"__isSmartRef__":true,"id":11236},"amethyst":{"__isSmartRef__":true,"id":11240},"diopside":{"__isSmartRef__":true,"id":11244},"gemTypes":{"__isSmartRef__":true,"id":11248},"becomeRandomGem":{"__isSmartRef__":true,"id":11252},"mark":{"__isSmartRef__":true,"id":11256},"unmark":{"__isSmartRef__":true,"id":11260},"hasNeighbour":{"__isSmartRef__":true,"id":11264},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11268},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11272},"disappear":{"__isSmartRef__":true,"id":11276},"findStreakStart":{"__isSmartRef__":true,"id":11280},"buildStreak":{"__isSmartRef__":true,"id":11284},"scoreStreak":{"__isSmartRef__":true,"id":11288},"tryToStreak":{"__isSmartRef__":true,"id":11292},"blueDiamond":{"__isSmartRef__":true,"id":11296},"prehnite":{"__isSmartRef__":true,"id":11300},"debugUnmark":{"__isSmartRef__":true,"id":11304},"debugMark":{"__isSmartRef__":true,"id":11308},"citrine":{"__isSmartRef__":true,"id":11312},"move":{"__isSmartRef__":true,"id":11316},"performMovement":{"__isSmartRef__":true,"id":11320},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11324},"zircon":{"__isSmartRef__":true,"id":11328},"emerald":{"__isSmartRef__":true,"id":11332},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11336}},"11212":{"varMapping":{"__isSmartRef__":true,"id":11213},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11214},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11213":{"this":{"__isSmartRef__":true,"id":4527}},"11214":{"timestamp":{"__isSmartRef__":true,"id":11215},"user":"josi","tags":[]},"11215":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11216":{"varMapping":{"__isSmartRef__":true,"id":11217},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11222},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11217":{"this":{"__isSmartRef__":true,"id":4527},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11218}},"11218":{"$super":{"__isSmartRef__":true,"id":11219}},"11219":{"varMapping":{"__isSmartRef__":true,"id":11220},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11221},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11220":{"obj":{"__isSmartRef__":true,"id":4527},"name":"onMouseDown"},"11221":{},"11222":{"timestamp":{"__isSmartRef__":true,"id":11223},"user":"soergel","tags":[]},"11223":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11224":{"varMapping":{"__isSmartRef__":true,"id":11225},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11226},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11225":{"this":{"__isSmartRef__":true,"id":4527}},"11226":{"timestamp":{"__isSmartRef__":true,"id":11227},"user":"soergel","tags":[]},"11227":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11228":{"varMapping":{"__isSmartRef__":true,"id":11229},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11230},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11229":{"this":{"__isSmartRef__":true,"id":4527}},"11230":{"timestamp":{"__isSmartRef__":true,"id":11231},"user":"josi","tags":["gemtypes"]},"11231":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11232":{"varMapping":{"__isSmartRef__":true,"id":11233},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11234},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11233":{"this":{"__isSmartRef__":true,"id":4527}},"11234":{"timestamp":{"__isSmartRef__":true,"id":11235},"user":"jan.sandbrink","tags":[]},"11235":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11236":{"varMapping":{"__isSmartRef__":true,"id":11237},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11238},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11237":{"this":{"__isSmartRef__":true,"id":4527}},"11238":{"timestamp":{"__isSmartRef__":true,"id":11239},"user":"jan.sandbrink","tags":[]},"11239":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11240":{"varMapping":{"__isSmartRef__":true,"id":11241},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11242},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11241":{"this":{"__isSmartRef__":true,"id":4527}},"11242":{"timestamp":{"__isSmartRef__":true,"id":11243},"user":"josi","tags":["gemtypes"]},"11243":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11244":{"varMapping":{"__isSmartRef__":true,"id":11245},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11246},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11245":{"this":{"__isSmartRef__":true,"id":4527}},"11246":{"timestamp":{"__isSmartRef__":true,"id":11247},"user":"josi","tags":["gemtypes"]},"11247":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11248":{"varMapping":{"__isSmartRef__":true,"id":11249},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11250},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11249":{"this":{"__isSmartRef__":true,"id":4527}},"11250":{"timestamp":{"__isSmartRef__":true,"id":11251},"user":"josi","tags":[]},"11251":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11252":{"varMapping":{"__isSmartRef__":true,"id":11253},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11254},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11253":{"this":{"__isSmartRef__":true,"id":4527}},"11254":{"timestamp":{"__isSmartRef__":true,"id":11255},"user":"josi","tags":[]},"11255":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11256":{"varMapping":{"__isSmartRef__":true,"id":11257},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11258},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11257":{"this":{"__isSmartRef__":true,"id":4527}},"11258":{"timestamp":{"__isSmartRef__":true,"id":11259},"user":"soergel","tags":[]},"11259":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11260":{"varMapping":{"__isSmartRef__":true,"id":11261},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11262},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11261":{"this":{"__isSmartRef__":true,"id":4527}},"11262":{"timestamp":{"__isSmartRef__":true,"id":11263},"user":"soergel","tags":[]},"11263":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11264":{"varMapping":{"__isSmartRef__":true,"id":11265},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11266},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11265":{"this":{"__isSmartRef__":true,"id":4527}},"11266":{"timestamp":{"__isSmartRef__":true,"id":11267},"user":"soergel","tags":[]},"11267":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11268":{"varMapping":{"__isSmartRef__":true,"id":11269},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11270},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11269":{"this":{"__isSmartRef__":true,"id":4527}},"11270":{"timestamp":{"__isSmartRef__":true,"id":11271},"user":"soergel","tags":["debug"]},"11271":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11272":{"varMapping":{"__isSmartRef__":true,"id":11273},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11274},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11273":{"this":{"__isSmartRef__":true,"id":4527}},"11274":{"timestamp":{"__isSmartRef__":true,"id":11275},"user":"soergel","tags":["debug"]},"11275":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11276":{"varMapping":{"__isSmartRef__":true,"id":11277},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11278},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11277":{"this":{"__isSmartRef__":true,"id":4527}},"11278":{"timestamp":{"__isSmartRef__":true,"id":11279},"user":"jan.sandbrink","tags":[]},"11279":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11280":{"varMapping":{"__isSmartRef__":true,"id":11281},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11282},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11281":{"this":{"__isSmartRef__":true,"id":4527}},"11282":{"timestamp":{"__isSmartRef__":true,"id":11283},"user":"jan.sandbrink","tags":[]},"11283":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11284":{"varMapping":{"__isSmartRef__":true,"id":11285},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11286},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11285":{"this":{"__isSmartRef__":true,"id":4527}},"11286":{"timestamp":{"__isSmartRef__":true,"id":11287},"user":"jan.sandbrink","tags":[]},"11287":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11288":{"varMapping":{"__isSmartRef__":true,"id":11289},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11290},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11289":{"this":{"__isSmartRef__":true,"id":4527}},"11290":{"timestamp":{"__isSmartRef__":true,"id":11291},"user":"jan.sandbrink","tags":[]},"11291":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11292":{"varMapping":{"__isSmartRef__":true,"id":11293},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11294},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11293":{"this":{"__isSmartRef__":true,"id":4527}},"11294":{"timestamp":{"__isSmartRef__":true,"id":11295},"user":"jan.sandbrink","tags":[]},"11295":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11296":{"varMapping":{"__isSmartRef__":true,"id":11297},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11298},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11297":{"this":{"__isSmartRef__":true,"id":4527}},"11298":{"timestamp":{"__isSmartRef__":true,"id":11299},"user":"josi","tags":["gemtypes"]},"11299":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11300":{"varMapping":{"__isSmartRef__":true,"id":11301},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11302},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11301":{"this":{"__isSmartRef__":true,"id":4527}},"11302":{"timestamp":{"__isSmartRef__":true,"id":11303},"user":"josi","tags":["gemtypes"]},"11303":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11304":{"varMapping":{"__isSmartRef__":true,"id":11305},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11306},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11305":{"this":{"__isSmartRef__":true,"id":4527}},"11306":{"timestamp":{"__isSmartRef__":true,"id":11307},"user":"soergel","tags":["debug"]},"11307":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11308":{"varMapping":{"__isSmartRef__":true,"id":11309},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11310},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11309":{"this":{"__isSmartRef__":true,"id":4527}},"11310":{"timestamp":{"__isSmartRef__":true,"id":11311},"user":"soergel","tags":["debug"]},"11311":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11312":{"varMapping":{"__isSmartRef__":true,"id":11313},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11314},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11313":{"this":{"__isSmartRef__":true,"id":4527}},"11314":{"timestamp":{"__isSmartRef__":true,"id":11315},"user":"josi","tags":["gemtypes"]},"11315":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11316":{"varMapping":{"__isSmartRef__":true,"id":11317},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11318},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11317":{"this":{"__isSmartRef__":true,"id":4527}},"11318":{"timestamp":{"__isSmartRef__":true,"id":11319},"user":"soergel","tags":[]},"11319":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11320":{"varMapping":{"__isSmartRef__":true,"id":11321},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11322},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11321":{"this":{"__isSmartRef__":true,"id":4527}},"11322":{"timestamp":{"__isSmartRef__":true,"id":11323},"user":"soergel","tags":[]},"11323":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11324":{"varMapping":{"__isSmartRef__":true,"id":11325},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11326},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11325":{"this":{"__isSmartRef__":true,"id":4527}},"11326":{"timestamp":{"__isSmartRef__":true,"id":11327},"user":"soergel","tags":[]},"11327":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11328":{"varMapping":{"__isSmartRef__":true,"id":11329},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11330},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11329":{"this":{"__isSmartRef__":true,"id":4527}},"11330":{"timestamp":{"__isSmartRef__":true,"id":11331},"user":"josi","tags":["gemtypes"]},"11331":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11332":{"varMapping":{"__isSmartRef__":true,"id":11333},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11334},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11333":{"this":{"__isSmartRef__":true,"id":4527}},"11334":{"timestamp":{"__isSmartRef__":true,"id":11335},"user":"josi","tags":["gemtypes"]},"11335":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11336":{"varMapping":{"__isSmartRef__":true,"id":11337},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11338},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11337":{"this":{"__isSmartRef__":true,"id":4527}},"11338":{"timestamp":{"__isSmartRef__":true,"id":11339},"user":"jan.sandbrink","tags":[]},"11339":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11340":{"become":{"__isSmartRef__":true,"id":11341},"onMouseDown":{"__isSmartRef__":true,"id":11345},"updatePicture":{"__isSmartRef__":true,"id":11353},"ruby":{"__isSmartRef__":true,"id":11357},"switchPositionWith":{"__isSmartRef__":true,"id":11361},"addNeighbour":{"__isSmartRef__":true,"id":11365},"amethyst":{"__isSmartRef__":true,"id":11369},"diopside":{"__isSmartRef__":true,"id":11373},"gemTypes":{"__isSmartRef__":true,"id":11377},"becomeRandomGem":{"__isSmartRef__":true,"id":11381},"mark":{"__isSmartRef__":true,"id":11385},"unmark":{"__isSmartRef__":true,"id":11389},"hasNeighbour":{"__isSmartRef__":true,"id":11393},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11397},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11401},"disappear":{"__isSmartRef__":true,"id":11405},"findStreakStart":{"__isSmartRef__":true,"id":11409},"buildStreak":{"__isSmartRef__":true,"id":11413},"scoreStreak":{"__isSmartRef__":true,"id":11417},"tryToStreak":{"__isSmartRef__":true,"id":11421},"blueDiamond":{"__isSmartRef__":true,"id":11425},"prehnite":{"__isSmartRef__":true,"id":11429},"debugUnmark":{"__isSmartRef__":true,"id":11433},"debugMark":{"__isSmartRef__":true,"id":11437},"citrine":{"__isSmartRef__":true,"id":11441},"move":{"__isSmartRef__":true,"id":11445},"performMovement":{"__isSmartRef__":true,"id":11449},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11453},"zircon":{"__isSmartRef__":true,"id":11457},"emerald":{"__isSmartRef__":true,"id":11461},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11465}},"11341":{"varMapping":{"__isSmartRef__":true,"id":11342},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11343},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11342":{"this":{"__isSmartRef__":true,"id":4435}},"11343":{"timestamp":{"__isSmartRef__":true,"id":11344},"user":"josi","tags":[]},"11344":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11345":{"varMapping":{"__isSmartRef__":true,"id":11346},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11351},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11346":{"this":{"__isSmartRef__":true,"id":4435},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11347}},"11347":{"$super":{"__isSmartRef__":true,"id":11348}},"11348":{"varMapping":{"__isSmartRef__":true,"id":11349},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11350},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11349":{"obj":{"__isSmartRef__":true,"id":4435},"name":"onMouseDown"},"11350":{},"11351":{"timestamp":{"__isSmartRef__":true,"id":11352},"user":"soergel","tags":[]},"11352":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11353":{"varMapping":{"__isSmartRef__":true,"id":11354},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11355},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11354":{"this":{"__isSmartRef__":true,"id":4435}},"11355":{"timestamp":{"__isSmartRef__":true,"id":11356},"user":"soergel","tags":[]},"11356":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11357":{"varMapping":{"__isSmartRef__":true,"id":11358},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11359},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11358":{"this":{"__isSmartRef__":true,"id":4435}},"11359":{"timestamp":{"__isSmartRef__":true,"id":11360},"user":"josi","tags":["gemtypes"]},"11360":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11361":{"varMapping":{"__isSmartRef__":true,"id":11362},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11363},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11362":{"this":{"__isSmartRef__":true,"id":4435}},"11363":{"timestamp":{"__isSmartRef__":true,"id":11364},"user":"jan.sandbrink","tags":[]},"11364":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11365":{"varMapping":{"__isSmartRef__":true,"id":11366},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11367},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11366":{"this":{"__isSmartRef__":true,"id":4435}},"11367":{"timestamp":{"__isSmartRef__":true,"id":11368},"user":"jan.sandbrink","tags":[]},"11368":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11369":{"varMapping":{"__isSmartRef__":true,"id":11370},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11371},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11370":{"this":{"__isSmartRef__":true,"id":4435}},"11371":{"timestamp":{"__isSmartRef__":true,"id":11372},"user":"josi","tags":["gemtypes"]},"11372":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11373":{"varMapping":{"__isSmartRef__":true,"id":11374},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11375},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11374":{"this":{"__isSmartRef__":true,"id":4435}},"11375":{"timestamp":{"__isSmartRef__":true,"id":11376},"user":"josi","tags":["gemtypes"]},"11376":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11377":{"varMapping":{"__isSmartRef__":true,"id":11378},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11379},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11378":{"this":{"__isSmartRef__":true,"id":4435}},"11379":{"timestamp":{"__isSmartRef__":true,"id":11380},"user":"josi","tags":[]},"11380":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11381":{"varMapping":{"__isSmartRef__":true,"id":11382},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11383},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11382":{"this":{"__isSmartRef__":true,"id":4435}},"11383":{"timestamp":{"__isSmartRef__":true,"id":11384},"user":"josi","tags":[]},"11384":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11385":{"varMapping":{"__isSmartRef__":true,"id":11386},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11387},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11386":{"this":{"__isSmartRef__":true,"id":4435}},"11387":{"timestamp":{"__isSmartRef__":true,"id":11388},"user":"soergel","tags":[]},"11388":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11389":{"varMapping":{"__isSmartRef__":true,"id":11390},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11391},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11390":{"this":{"__isSmartRef__":true,"id":4435}},"11391":{"timestamp":{"__isSmartRef__":true,"id":11392},"user":"soergel","tags":[]},"11392":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11393":{"varMapping":{"__isSmartRef__":true,"id":11394},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11395},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11394":{"this":{"__isSmartRef__":true,"id":4435}},"11395":{"timestamp":{"__isSmartRef__":true,"id":11396},"user":"soergel","tags":[]},"11396":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11397":{"varMapping":{"__isSmartRef__":true,"id":11398},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11399},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11398":{"this":{"__isSmartRef__":true,"id":4435}},"11399":{"timestamp":{"__isSmartRef__":true,"id":11400},"user":"soergel","tags":["debug"]},"11400":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11401":{"varMapping":{"__isSmartRef__":true,"id":11402},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11403},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11402":{"this":{"__isSmartRef__":true,"id":4435}},"11403":{"timestamp":{"__isSmartRef__":true,"id":11404},"user":"soergel","tags":["debug"]},"11404":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11405":{"varMapping":{"__isSmartRef__":true,"id":11406},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11407},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11406":{"this":{"__isSmartRef__":true,"id":4435}},"11407":{"timestamp":{"__isSmartRef__":true,"id":11408},"user":"jan.sandbrink","tags":[]},"11408":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11409":{"varMapping":{"__isSmartRef__":true,"id":11410},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11411},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11410":{"this":{"__isSmartRef__":true,"id":4435}},"11411":{"timestamp":{"__isSmartRef__":true,"id":11412},"user":"jan.sandbrink","tags":[]},"11412":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11413":{"varMapping":{"__isSmartRef__":true,"id":11414},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11414":{"this":{"__isSmartRef__":true,"id":4435}},"11415":{"timestamp":{"__isSmartRef__":true,"id":11416},"user":"jan.sandbrink","tags":[]},"11416":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11417":{"varMapping":{"__isSmartRef__":true,"id":11418},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11419},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11418":{"this":{"__isSmartRef__":true,"id":4435}},"11419":{"timestamp":{"__isSmartRef__":true,"id":11420},"user":"jan.sandbrink","tags":[]},"11420":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11421":{"varMapping":{"__isSmartRef__":true,"id":11422},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11423},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11422":{"this":{"__isSmartRef__":true,"id":4435}},"11423":{"timestamp":{"__isSmartRef__":true,"id":11424},"user":"jan.sandbrink","tags":[]},"11424":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11425":{"varMapping":{"__isSmartRef__":true,"id":11426},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11427},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11426":{"this":{"__isSmartRef__":true,"id":4435}},"11427":{"timestamp":{"__isSmartRef__":true,"id":11428},"user":"josi","tags":["gemtypes"]},"11428":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11429":{"varMapping":{"__isSmartRef__":true,"id":11430},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11431},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11430":{"this":{"__isSmartRef__":true,"id":4435}},"11431":{"timestamp":{"__isSmartRef__":true,"id":11432},"user":"josi","tags":["gemtypes"]},"11432":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11433":{"varMapping":{"__isSmartRef__":true,"id":11434},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11435},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11434":{"this":{"__isSmartRef__":true,"id":4435}},"11435":{"timestamp":{"__isSmartRef__":true,"id":11436},"user":"soergel","tags":["debug"]},"11436":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11437":{"varMapping":{"__isSmartRef__":true,"id":11438},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11439},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11438":{"this":{"__isSmartRef__":true,"id":4435}},"11439":{"timestamp":{"__isSmartRef__":true,"id":11440},"user":"soergel","tags":["debug"]},"11440":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11441":{"varMapping":{"__isSmartRef__":true,"id":11442},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11443},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11442":{"this":{"__isSmartRef__":true,"id":4435}},"11443":{"timestamp":{"__isSmartRef__":true,"id":11444},"user":"josi","tags":["gemtypes"]},"11444":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11445":{"varMapping":{"__isSmartRef__":true,"id":11446},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11446":{"this":{"__isSmartRef__":true,"id":4435}},"11447":{"timestamp":{"__isSmartRef__":true,"id":11448},"user":"soergel","tags":[]},"11448":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11449":{"varMapping":{"__isSmartRef__":true,"id":11450},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11451},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11450":{"this":{"__isSmartRef__":true,"id":4435}},"11451":{"timestamp":{"__isSmartRef__":true,"id":11452},"user":"soergel","tags":[]},"11452":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11453":{"varMapping":{"__isSmartRef__":true,"id":11454},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11455},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11454":{"this":{"__isSmartRef__":true,"id":4435}},"11455":{"timestamp":{"__isSmartRef__":true,"id":11456},"user":"soergel","tags":[]},"11456":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11457":{"varMapping":{"__isSmartRef__":true,"id":11458},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11458":{"this":{"__isSmartRef__":true,"id":4435}},"11459":{"timestamp":{"__isSmartRef__":true,"id":11460},"user":"josi","tags":["gemtypes"]},"11460":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11461":{"varMapping":{"__isSmartRef__":true,"id":11462},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11463},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11462":{"this":{"__isSmartRef__":true,"id":4435}},"11463":{"timestamp":{"__isSmartRef__":true,"id":11464},"user":"josi","tags":["gemtypes"]},"11464":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11465":{"varMapping":{"__isSmartRef__":true,"id":11466},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11467},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11466":{"this":{"__isSmartRef__":true,"id":4435}},"11467":{"timestamp":{"__isSmartRef__":true,"id":11468},"user":"jan.sandbrink","tags":[]},"11468":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11469":{"become":{"__isSmartRef__":true,"id":11470},"onMouseDown":{"__isSmartRef__":true,"id":11474},"updatePicture":{"__isSmartRef__":true,"id":11482},"ruby":{"__isSmartRef__":true,"id":11486},"switchPositionWith":{"__isSmartRef__":true,"id":11490},"addNeighbour":{"__isSmartRef__":true,"id":11494},"amethyst":{"__isSmartRef__":true,"id":11498},"diopside":{"__isSmartRef__":true,"id":11502},"gemTypes":{"__isSmartRef__":true,"id":11506},"becomeRandomGem":{"__isSmartRef__":true,"id":11510},"mark":{"__isSmartRef__":true,"id":11514},"unmark":{"__isSmartRef__":true,"id":11518},"hasNeighbour":{"__isSmartRef__":true,"id":11522},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11526},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11530},"disappear":{"__isSmartRef__":true,"id":11534},"findStreakStart":{"__isSmartRef__":true,"id":11538},"buildStreak":{"__isSmartRef__":true,"id":11542},"scoreStreak":{"__isSmartRef__":true,"id":11546},"tryToStreak":{"__isSmartRef__":true,"id":11550},"blueDiamond":{"__isSmartRef__":true,"id":11554},"prehnite":{"__isSmartRef__":true,"id":11558},"debugUnmark":{"__isSmartRef__":true,"id":11562},"debugMark":{"__isSmartRef__":true,"id":11566},"citrine":{"__isSmartRef__":true,"id":11570},"move":{"__isSmartRef__":true,"id":11574},"performMovement":{"__isSmartRef__":true,"id":11578},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11582},"zircon":{"__isSmartRef__":true,"id":11586},"emerald":{"__isSmartRef__":true,"id":11590},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11594}},"11470":{"varMapping":{"__isSmartRef__":true,"id":11471},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11472},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11471":{"this":{"__isSmartRef__":true,"id":4343}},"11472":{"timestamp":{"__isSmartRef__":true,"id":11473},"user":"josi","tags":[]},"11473":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11474":{"varMapping":{"__isSmartRef__":true,"id":11475},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11480},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11475":{"this":{"__isSmartRef__":true,"id":4343},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11476}},"11476":{"$super":{"__isSmartRef__":true,"id":11477}},"11477":{"varMapping":{"__isSmartRef__":true,"id":11478},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11478":{"obj":{"__isSmartRef__":true,"id":4343},"name":"onMouseDown"},"11479":{},"11480":{"timestamp":{"__isSmartRef__":true,"id":11481},"user":"soergel","tags":[]},"11481":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11482":{"varMapping":{"__isSmartRef__":true,"id":11483},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11484},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11483":{"this":{"__isSmartRef__":true,"id":4343}},"11484":{"timestamp":{"__isSmartRef__":true,"id":11485},"user":"soergel","tags":[]},"11485":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11486":{"varMapping":{"__isSmartRef__":true,"id":11487},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11488},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11487":{"this":{"__isSmartRef__":true,"id":4343}},"11488":{"timestamp":{"__isSmartRef__":true,"id":11489},"user":"josi","tags":["gemtypes"]},"11489":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11490":{"varMapping":{"__isSmartRef__":true,"id":11491},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11492},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11491":{"this":{"__isSmartRef__":true,"id":4343}},"11492":{"timestamp":{"__isSmartRef__":true,"id":11493},"user":"jan.sandbrink","tags":[]},"11493":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11494":{"varMapping":{"__isSmartRef__":true,"id":11495},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11496},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11495":{"this":{"__isSmartRef__":true,"id":4343}},"11496":{"timestamp":{"__isSmartRef__":true,"id":11497},"user":"jan.sandbrink","tags":[]},"11497":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11498":{"varMapping":{"__isSmartRef__":true,"id":11499},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11500},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11499":{"this":{"__isSmartRef__":true,"id":4343}},"11500":{"timestamp":{"__isSmartRef__":true,"id":11501},"user":"josi","tags":["gemtypes"]},"11501":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11502":{"varMapping":{"__isSmartRef__":true,"id":11503},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11504},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11503":{"this":{"__isSmartRef__":true,"id":4343}},"11504":{"timestamp":{"__isSmartRef__":true,"id":11505},"user":"josi","tags":["gemtypes"]},"11505":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11506":{"varMapping":{"__isSmartRef__":true,"id":11507},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11508},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11507":{"this":{"__isSmartRef__":true,"id":4343}},"11508":{"timestamp":{"__isSmartRef__":true,"id":11509},"user":"josi","tags":[]},"11509":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11510":{"varMapping":{"__isSmartRef__":true,"id":11511},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11512},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11511":{"this":{"__isSmartRef__":true,"id":4343}},"11512":{"timestamp":{"__isSmartRef__":true,"id":11513},"user":"josi","tags":[]},"11513":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11514":{"varMapping":{"__isSmartRef__":true,"id":11515},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11516},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11515":{"this":{"__isSmartRef__":true,"id":4343}},"11516":{"timestamp":{"__isSmartRef__":true,"id":11517},"user":"soergel","tags":[]},"11517":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11518":{"varMapping":{"__isSmartRef__":true,"id":11519},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11520},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11519":{"this":{"__isSmartRef__":true,"id":4343}},"11520":{"timestamp":{"__isSmartRef__":true,"id":11521},"user":"soergel","tags":[]},"11521":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11522":{"varMapping":{"__isSmartRef__":true,"id":11523},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11524},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11523":{"this":{"__isSmartRef__":true,"id":4343}},"11524":{"timestamp":{"__isSmartRef__":true,"id":11525},"user":"soergel","tags":[]},"11525":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11526":{"varMapping":{"__isSmartRef__":true,"id":11527},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11528},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11527":{"this":{"__isSmartRef__":true,"id":4343}},"11528":{"timestamp":{"__isSmartRef__":true,"id":11529},"user":"soergel","tags":["debug"]},"11529":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11530":{"varMapping":{"__isSmartRef__":true,"id":11531},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11532},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11531":{"this":{"__isSmartRef__":true,"id":4343}},"11532":{"timestamp":{"__isSmartRef__":true,"id":11533},"user":"soergel","tags":["debug"]},"11533":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11534":{"varMapping":{"__isSmartRef__":true,"id":11535},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11536},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11535":{"this":{"__isSmartRef__":true,"id":4343}},"11536":{"timestamp":{"__isSmartRef__":true,"id":11537},"user":"jan.sandbrink","tags":[]},"11537":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11538":{"varMapping":{"__isSmartRef__":true,"id":11539},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11540},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11539":{"this":{"__isSmartRef__":true,"id":4343}},"11540":{"timestamp":{"__isSmartRef__":true,"id":11541},"user":"jan.sandbrink","tags":[]},"11541":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11542":{"varMapping":{"__isSmartRef__":true,"id":11543},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11544},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11543":{"this":{"__isSmartRef__":true,"id":4343}},"11544":{"timestamp":{"__isSmartRef__":true,"id":11545},"user":"jan.sandbrink","tags":[]},"11545":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11546":{"varMapping":{"__isSmartRef__":true,"id":11547},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11548},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11547":{"this":{"__isSmartRef__":true,"id":4343}},"11548":{"timestamp":{"__isSmartRef__":true,"id":11549},"user":"jan.sandbrink","tags":[]},"11549":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11550":{"varMapping":{"__isSmartRef__":true,"id":11551},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11552},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11551":{"this":{"__isSmartRef__":true,"id":4343}},"11552":{"timestamp":{"__isSmartRef__":true,"id":11553},"user":"jan.sandbrink","tags":[]},"11553":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11554":{"varMapping":{"__isSmartRef__":true,"id":11555},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11556},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11555":{"this":{"__isSmartRef__":true,"id":4343}},"11556":{"timestamp":{"__isSmartRef__":true,"id":11557},"user":"josi","tags":["gemtypes"]},"11557":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11558":{"varMapping":{"__isSmartRef__":true,"id":11559},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11560},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11559":{"this":{"__isSmartRef__":true,"id":4343}},"11560":{"timestamp":{"__isSmartRef__":true,"id":11561},"user":"josi","tags":["gemtypes"]},"11561":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11562":{"varMapping":{"__isSmartRef__":true,"id":11563},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11564},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11563":{"this":{"__isSmartRef__":true,"id":4343}},"11564":{"timestamp":{"__isSmartRef__":true,"id":11565},"user":"soergel","tags":["debug"]},"11565":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11566":{"varMapping":{"__isSmartRef__":true,"id":11567},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11568},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11567":{"this":{"__isSmartRef__":true,"id":4343}},"11568":{"timestamp":{"__isSmartRef__":true,"id":11569},"user":"soergel","tags":["debug"]},"11569":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11570":{"varMapping":{"__isSmartRef__":true,"id":11571},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11572},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11571":{"this":{"__isSmartRef__":true,"id":4343}},"11572":{"timestamp":{"__isSmartRef__":true,"id":11573},"user":"josi","tags":["gemtypes"]},"11573":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11574":{"varMapping":{"__isSmartRef__":true,"id":11575},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11576},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11575":{"this":{"__isSmartRef__":true,"id":4343}},"11576":{"timestamp":{"__isSmartRef__":true,"id":11577},"user":"soergel","tags":[]},"11577":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11578":{"varMapping":{"__isSmartRef__":true,"id":11579},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11580},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11579":{"this":{"__isSmartRef__":true,"id":4343}},"11580":{"timestamp":{"__isSmartRef__":true,"id":11581},"user":"soergel","tags":[]},"11581":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11582":{"varMapping":{"__isSmartRef__":true,"id":11583},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11584},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11583":{"this":{"__isSmartRef__":true,"id":4343}},"11584":{"timestamp":{"__isSmartRef__":true,"id":11585},"user":"soergel","tags":[]},"11585":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11586":{"varMapping":{"__isSmartRef__":true,"id":11587},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11588},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11587":{"this":{"__isSmartRef__":true,"id":4343}},"11588":{"timestamp":{"__isSmartRef__":true,"id":11589},"user":"josi","tags":["gemtypes"]},"11589":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11590":{"varMapping":{"__isSmartRef__":true,"id":11591},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11592},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11591":{"this":{"__isSmartRef__":true,"id":4343}},"11592":{"timestamp":{"__isSmartRef__":true,"id":11593},"user":"josi","tags":["gemtypes"]},"11593":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11594":{"varMapping":{"__isSmartRef__":true,"id":11595},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11596},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11595":{"this":{"__isSmartRef__":true,"id":4343}},"11596":{"timestamp":{"__isSmartRef__":true,"id":11597},"user":"jan.sandbrink","tags":[]},"11597":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11598":{"become":{"__isSmartRef__":true,"id":11599},"onMouseDown":{"__isSmartRef__":true,"id":11603},"updatePicture":{"__isSmartRef__":true,"id":11611},"ruby":{"__isSmartRef__":true,"id":11615},"switchPositionWith":{"__isSmartRef__":true,"id":11619},"addNeighbour":{"__isSmartRef__":true,"id":11623},"amethyst":{"__isSmartRef__":true,"id":11627},"diopside":{"__isSmartRef__":true,"id":11631},"gemTypes":{"__isSmartRef__":true,"id":11635},"becomeRandomGem":{"__isSmartRef__":true,"id":11639},"mark":{"__isSmartRef__":true,"id":11643},"unmark":{"__isSmartRef__":true,"id":11647},"hasNeighbour":{"__isSmartRef__":true,"id":11651},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11655},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11659},"disappear":{"__isSmartRef__":true,"id":11663},"findStreakStart":{"__isSmartRef__":true,"id":11667},"buildStreak":{"__isSmartRef__":true,"id":11671},"scoreStreak":{"__isSmartRef__":true,"id":11675},"tryToStreak":{"__isSmartRef__":true,"id":11679},"blueDiamond":{"__isSmartRef__":true,"id":11683},"prehnite":{"__isSmartRef__":true,"id":11687},"debugUnmark":{"__isSmartRef__":true,"id":11691},"debugMark":{"__isSmartRef__":true,"id":11695},"citrine":{"__isSmartRef__":true,"id":11699},"move":{"__isSmartRef__":true,"id":11703},"performMovement":{"__isSmartRef__":true,"id":11707},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11711},"zircon":{"__isSmartRef__":true,"id":11715},"emerald":{"__isSmartRef__":true,"id":11719},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11723}},"11599":{"varMapping":{"__isSmartRef__":true,"id":11600},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11601},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11600":{"this":{"__isSmartRef__":true,"id":4216}},"11601":{"timestamp":{"__isSmartRef__":true,"id":11602},"user":"josi","tags":[]},"11602":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11603":{"varMapping":{"__isSmartRef__":true,"id":11604},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11609},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11604":{"this":{"__isSmartRef__":true,"id":4216},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11605}},"11605":{"$super":{"__isSmartRef__":true,"id":11606}},"11606":{"varMapping":{"__isSmartRef__":true,"id":11607},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11608},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11607":{"obj":{"__isSmartRef__":true,"id":4216},"name":"onMouseDown"},"11608":{},"11609":{"timestamp":{"__isSmartRef__":true,"id":11610},"user":"soergel","tags":[]},"11610":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11611":{"varMapping":{"__isSmartRef__":true,"id":11612},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11613},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11612":{"this":{"__isSmartRef__":true,"id":4216}},"11613":{"timestamp":{"__isSmartRef__":true,"id":11614},"user":"soergel","tags":[]},"11614":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11615":{"varMapping":{"__isSmartRef__":true,"id":11616},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11617},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11616":{"this":{"__isSmartRef__":true,"id":4216}},"11617":{"timestamp":{"__isSmartRef__":true,"id":11618},"user":"josi","tags":["gemtypes"]},"11618":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11619":{"varMapping":{"__isSmartRef__":true,"id":11620},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11621},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11620":{"this":{"__isSmartRef__":true,"id":4216}},"11621":{"timestamp":{"__isSmartRef__":true,"id":11622},"user":"jan.sandbrink","tags":[]},"11622":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11623":{"varMapping":{"__isSmartRef__":true,"id":11624},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11625},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11624":{"this":{"__isSmartRef__":true,"id":4216}},"11625":{"timestamp":{"__isSmartRef__":true,"id":11626},"user":"jan.sandbrink","tags":[]},"11626":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11627":{"varMapping":{"__isSmartRef__":true,"id":11628},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11629},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11628":{"this":{"__isSmartRef__":true,"id":4216}},"11629":{"timestamp":{"__isSmartRef__":true,"id":11630},"user":"josi","tags":["gemtypes"]},"11630":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11631":{"varMapping":{"__isSmartRef__":true,"id":11632},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11633},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11632":{"this":{"__isSmartRef__":true,"id":4216}},"11633":{"timestamp":{"__isSmartRef__":true,"id":11634},"user":"josi","tags":["gemtypes"]},"11634":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11635":{"varMapping":{"__isSmartRef__":true,"id":11636},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11637},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11636":{"this":{"__isSmartRef__":true,"id":4216}},"11637":{"timestamp":{"__isSmartRef__":true,"id":11638},"user":"josi","tags":[]},"11638":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11639":{"varMapping":{"__isSmartRef__":true,"id":11640},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11641},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11640":{"this":{"__isSmartRef__":true,"id":4216}},"11641":{"timestamp":{"__isSmartRef__":true,"id":11642},"user":"josi","tags":[]},"11642":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11643":{"varMapping":{"__isSmartRef__":true,"id":11644},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11645},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11644":{"this":{"__isSmartRef__":true,"id":4216}},"11645":{"timestamp":{"__isSmartRef__":true,"id":11646},"user":"soergel","tags":[]},"11646":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11647":{"varMapping":{"__isSmartRef__":true,"id":11648},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11649},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11648":{"this":{"__isSmartRef__":true,"id":4216}},"11649":{"timestamp":{"__isSmartRef__":true,"id":11650},"user":"soergel","tags":[]},"11650":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11651":{"varMapping":{"__isSmartRef__":true,"id":11652},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11653},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11652":{"this":{"__isSmartRef__":true,"id":4216}},"11653":{"timestamp":{"__isSmartRef__":true,"id":11654},"user":"soergel","tags":[]},"11654":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11655":{"varMapping":{"__isSmartRef__":true,"id":11656},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11657},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11656":{"this":{"__isSmartRef__":true,"id":4216}},"11657":{"timestamp":{"__isSmartRef__":true,"id":11658},"user":"soergel","tags":["debug"]},"11658":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11659":{"varMapping":{"__isSmartRef__":true,"id":11660},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11661},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11660":{"this":{"__isSmartRef__":true,"id":4216}},"11661":{"timestamp":{"__isSmartRef__":true,"id":11662},"user":"soergel","tags":["debug"]},"11662":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11663":{"varMapping":{"__isSmartRef__":true,"id":11664},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11665},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11664":{"this":{"__isSmartRef__":true,"id":4216}},"11665":{"timestamp":{"__isSmartRef__":true,"id":11666},"user":"jan.sandbrink","tags":[]},"11666":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11667":{"varMapping":{"__isSmartRef__":true,"id":11668},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11669},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11668":{"this":{"__isSmartRef__":true,"id":4216}},"11669":{"timestamp":{"__isSmartRef__":true,"id":11670},"user":"jan.sandbrink","tags":[]},"11670":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11671":{"varMapping":{"__isSmartRef__":true,"id":11672},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11673},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11672":{"this":{"__isSmartRef__":true,"id":4216}},"11673":{"timestamp":{"__isSmartRef__":true,"id":11674},"user":"jan.sandbrink","tags":[]},"11674":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11675":{"varMapping":{"__isSmartRef__":true,"id":11676},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11677},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11676":{"this":{"__isSmartRef__":true,"id":4216}},"11677":{"timestamp":{"__isSmartRef__":true,"id":11678},"user":"jan.sandbrink","tags":[]},"11678":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11679":{"varMapping":{"__isSmartRef__":true,"id":11680},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11681},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11680":{"this":{"__isSmartRef__":true,"id":4216}},"11681":{"timestamp":{"__isSmartRef__":true,"id":11682},"user":"jan.sandbrink","tags":[]},"11682":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11683":{"varMapping":{"__isSmartRef__":true,"id":11684},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11685},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11684":{"this":{"__isSmartRef__":true,"id":4216}},"11685":{"timestamp":{"__isSmartRef__":true,"id":11686},"user":"josi","tags":["gemtypes"]},"11686":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11687":{"varMapping":{"__isSmartRef__":true,"id":11688},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11689},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11688":{"this":{"__isSmartRef__":true,"id":4216}},"11689":{"timestamp":{"__isSmartRef__":true,"id":11690},"user":"josi","tags":["gemtypes"]},"11690":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11691":{"varMapping":{"__isSmartRef__":true,"id":11692},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11693},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11692":{"this":{"__isSmartRef__":true,"id":4216}},"11693":{"timestamp":{"__isSmartRef__":true,"id":11694},"user":"soergel","tags":["debug"]},"11694":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11695":{"varMapping":{"__isSmartRef__":true,"id":11696},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11697},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11696":{"this":{"__isSmartRef__":true,"id":4216}},"11697":{"timestamp":{"__isSmartRef__":true,"id":11698},"user":"soergel","tags":["debug"]},"11698":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11699":{"varMapping":{"__isSmartRef__":true,"id":11700},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11701},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11700":{"this":{"__isSmartRef__":true,"id":4216}},"11701":{"timestamp":{"__isSmartRef__":true,"id":11702},"user":"josi","tags":["gemtypes"]},"11702":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11703":{"varMapping":{"__isSmartRef__":true,"id":11704},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11705},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11704":{"this":{"__isSmartRef__":true,"id":4216}},"11705":{"timestamp":{"__isSmartRef__":true,"id":11706},"user":"soergel","tags":[]},"11706":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11707":{"varMapping":{"__isSmartRef__":true,"id":11708},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11709},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11708":{"this":{"__isSmartRef__":true,"id":4216}},"11709":{"timestamp":{"__isSmartRef__":true,"id":11710},"user":"soergel","tags":[]},"11710":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11711":{"varMapping":{"__isSmartRef__":true,"id":11712},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11713},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11712":{"this":{"__isSmartRef__":true,"id":4216}},"11713":{"timestamp":{"__isSmartRef__":true,"id":11714},"user":"soergel","tags":[]},"11714":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11715":{"varMapping":{"__isSmartRef__":true,"id":11716},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11717},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11716":{"this":{"__isSmartRef__":true,"id":4216}},"11717":{"timestamp":{"__isSmartRef__":true,"id":11718},"user":"josi","tags":["gemtypes"]},"11718":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11719":{"varMapping":{"__isSmartRef__":true,"id":11720},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11721},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11720":{"this":{"__isSmartRef__":true,"id":4216}},"11721":{"timestamp":{"__isSmartRef__":true,"id":11722},"user":"josi","tags":["gemtypes"]},"11722":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11723":{"varMapping":{"__isSmartRef__":true,"id":11724},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11725},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11724":{"this":{"__isSmartRef__":true,"id":4216}},"11725":{"timestamp":{"__isSmartRef__":true,"id":11726},"user":"jan.sandbrink","tags":[]},"11726":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11727":{"become":{"__isSmartRef__":true,"id":11728},"onMouseDown":{"__isSmartRef__":true,"id":11732},"updatePicture":{"__isSmartRef__":true,"id":11740},"ruby":{"__isSmartRef__":true,"id":11744},"switchPositionWith":{"__isSmartRef__":true,"id":11748},"addNeighbour":{"__isSmartRef__":true,"id":11752},"amethyst":{"__isSmartRef__":true,"id":11756},"diopside":{"__isSmartRef__":true,"id":11760},"gemTypes":{"__isSmartRef__":true,"id":11764},"becomeRandomGem":{"__isSmartRef__":true,"id":11768},"mark":{"__isSmartRef__":true,"id":11772},"unmark":{"__isSmartRef__":true,"id":11776},"hasNeighbour":{"__isSmartRef__":true,"id":11780},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11784},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11788},"disappear":{"__isSmartRef__":true,"id":11792},"findStreakStart":{"__isSmartRef__":true,"id":11796},"buildStreak":{"__isSmartRef__":true,"id":11800},"scoreStreak":{"__isSmartRef__":true,"id":11804},"tryToStreak":{"__isSmartRef__":true,"id":11808},"blueDiamond":{"__isSmartRef__":true,"id":11812},"prehnite":{"__isSmartRef__":true,"id":11816},"debugUnmark":{"__isSmartRef__":true,"id":11820},"debugMark":{"__isSmartRef__":true,"id":11824},"citrine":{"__isSmartRef__":true,"id":11828},"move":{"__isSmartRef__":true,"id":11832},"performMovement":{"__isSmartRef__":true,"id":11836},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11840},"zircon":{"__isSmartRef__":true,"id":11844},"emerald":{"__isSmartRef__":true,"id":11848},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11852}},"11728":{"varMapping":{"__isSmartRef__":true,"id":11729},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11730},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11729":{"this":{"__isSmartRef__":true,"id":4115}},"11730":{"timestamp":{"__isSmartRef__":true,"id":11731},"user":"josi","tags":[]},"11731":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11732":{"varMapping":{"__isSmartRef__":true,"id":11733},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11738},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11733":{"this":{"__isSmartRef__":true,"id":4115},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11734}},"11734":{"$super":{"__isSmartRef__":true,"id":11735}},"11735":{"varMapping":{"__isSmartRef__":true,"id":11736},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11737},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11736":{"obj":{"__isSmartRef__":true,"id":4115},"name":"onMouseDown"},"11737":{},"11738":{"timestamp":{"__isSmartRef__":true,"id":11739},"user":"soergel","tags":[]},"11739":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11740":{"varMapping":{"__isSmartRef__":true,"id":11741},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11742},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11741":{"this":{"__isSmartRef__":true,"id":4115}},"11742":{"timestamp":{"__isSmartRef__":true,"id":11743},"user":"soergel","tags":[]},"11743":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11744":{"varMapping":{"__isSmartRef__":true,"id":11745},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11746},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11745":{"this":{"__isSmartRef__":true,"id":4115}},"11746":{"timestamp":{"__isSmartRef__":true,"id":11747},"user":"josi","tags":["gemtypes"]},"11747":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11748":{"varMapping":{"__isSmartRef__":true,"id":11749},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11750},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11749":{"this":{"__isSmartRef__":true,"id":4115}},"11750":{"timestamp":{"__isSmartRef__":true,"id":11751},"user":"jan.sandbrink","tags":[]},"11751":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11752":{"varMapping":{"__isSmartRef__":true,"id":11753},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11754},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11753":{"this":{"__isSmartRef__":true,"id":4115}},"11754":{"timestamp":{"__isSmartRef__":true,"id":11755},"user":"jan.sandbrink","tags":[]},"11755":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11756":{"varMapping":{"__isSmartRef__":true,"id":11757},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11758},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11757":{"this":{"__isSmartRef__":true,"id":4115}},"11758":{"timestamp":{"__isSmartRef__":true,"id":11759},"user":"josi","tags":["gemtypes"]},"11759":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11760":{"varMapping":{"__isSmartRef__":true,"id":11761},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11762},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11761":{"this":{"__isSmartRef__":true,"id":4115}},"11762":{"timestamp":{"__isSmartRef__":true,"id":11763},"user":"josi","tags":["gemtypes"]},"11763":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11764":{"varMapping":{"__isSmartRef__":true,"id":11765},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11766},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11765":{"this":{"__isSmartRef__":true,"id":4115}},"11766":{"timestamp":{"__isSmartRef__":true,"id":11767},"user":"josi","tags":[]},"11767":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11768":{"varMapping":{"__isSmartRef__":true,"id":11769},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11770},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11769":{"this":{"__isSmartRef__":true,"id":4115}},"11770":{"timestamp":{"__isSmartRef__":true,"id":11771},"user":"josi","tags":[]},"11771":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11772":{"varMapping":{"__isSmartRef__":true,"id":11773},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11774},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11773":{"this":{"__isSmartRef__":true,"id":4115}},"11774":{"timestamp":{"__isSmartRef__":true,"id":11775},"user":"soergel","tags":[]},"11775":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11776":{"varMapping":{"__isSmartRef__":true,"id":11777},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11778},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11777":{"this":{"__isSmartRef__":true,"id":4115}},"11778":{"timestamp":{"__isSmartRef__":true,"id":11779},"user":"soergel","tags":[]},"11779":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11780":{"varMapping":{"__isSmartRef__":true,"id":11781},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11782},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11781":{"this":{"__isSmartRef__":true,"id":4115}},"11782":{"timestamp":{"__isSmartRef__":true,"id":11783},"user":"soergel","tags":[]},"11783":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11784":{"varMapping":{"__isSmartRef__":true,"id":11785},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11785":{"this":{"__isSmartRef__":true,"id":4115}},"11786":{"timestamp":{"__isSmartRef__":true,"id":11787},"user":"soergel","tags":["debug"]},"11787":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11788":{"varMapping":{"__isSmartRef__":true,"id":11789},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11790},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11789":{"this":{"__isSmartRef__":true,"id":4115}},"11790":{"timestamp":{"__isSmartRef__":true,"id":11791},"user":"soergel","tags":["debug"]},"11791":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11792":{"varMapping":{"__isSmartRef__":true,"id":11793},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11794},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11793":{"this":{"__isSmartRef__":true,"id":4115}},"11794":{"timestamp":{"__isSmartRef__":true,"id":11795},"user":"jan.sandbrink","tags":[]},"11795":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11796":{"varMapping":{"__isSmartRef__":true,"id":11797},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11798},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11797":{"this":{"__isSmartRef__":true,"id":4115}},"11798":{"timestamp":{"__isSmartRef__":true,"id":11799},"user":"jan.sandbrink","tags":[]},"11799":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11800":{"varMapping":{"__isSmartRef__":true,"id":11801},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11802},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11801":{"this":{"__isSmartRef__":true,"id":4115}},"11802":{"timestamp":{"__isSmartRef__":true,"id":11803},"user":"jan.sandbrink","tags":[]},"11803":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11804":{"varMapping":{"__isSmartRef__":true,"id":11805},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11806},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11805":{"this":{"__isSmartRef__":true,"id":4115}},"11806":{"timestamp":{"__isSmartRef__":true,"id":11807},"user":"jan.sandbrink","tags":[]},"11807":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11808":{"varMapping":{"__isSmartRef__":true,"id":11809},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11810},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11809":{"this":{"__isSmartRef__":true,"id":4115}},"11810":{"timestamp":{"__isSmartRef__":true,"id":11811},"user":"jan.sandbrink","tags":[]},"11811":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11812":{"varMapping":{"__isSmartRef__":true,"id":11813},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11814},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11813":{"this":{"__isSmartRef__":true,"id":4115}},"11814":{"timestamp":{"__isSmartRef__":true,"id":11815},"user":"josi","tags":["gemtypes"]},"11815":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11816":{"varMapping":{"__isSmartRef__":true,"id":11817},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11818},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11817":{"this":{"__isSmartRef__":true,"id":4115}},"11818":{"timestamp":{"__isSmartRef__":true,"id":11819},"user":"josi","tags":["gemtypes"]},"11819":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11820":{"varMapping":{"__isSmartRef__":true,"id":11821},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11822},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11821":{"this":{"__isSmartRef__":true,"id":4115}},"11822":{"timestamp":{"__isSmartRef__":true,"id":11823},"user":"soergel","tags":["debug"]},"11823":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11824":{"varMapping":{"__isSmartRef__":true,"id":11825},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11826},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11825":{"this":{"__isSmartRef__":true,"id":4115}},"11826":{"timestamp":{"__isSmartRef__":true,"id":11827},"user":"soergel","tags":["debug"]},"11827":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11828":{"varMapping":{"__isSmartRef__":true,"id":11829},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11830},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11829":{"this":{"__isSmartRef__":true,"id":4115}},"11830":{"timestamp":{"__isSmartRef__":true,"id":11831},"user":"josi","tags":["gemtypes"]},"11831":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11832":{"varMapping":{"__isSmartRef__":true,"id":11833},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11834},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11833":{"this":{"__isSmartRef__":true,"id":4115}},"11834":{"timestamp":{"__isSmartRef__":true,"id":11835},"user":"soergel","tags":[]},"11835":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11836":{"varMapping":{"__isSmartRef__":true,"id":11837},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11838},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11837":{"this":{"__isSmartRef__":true,"id":4115}},"11838":{"timestamp":{"__isSmartRef__":true,"id":11839},"user":"soergel","tags":[]},"11839":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11840":{"varMapping":{"__isSmartRef__":true,"id":11841},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11842},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11841":{"this":{"__isSmartRef__":true,"id":4115}},"11842":{"timestamp":{"__isSmartRef__":true,"id":11843},"user":"soergel","tags":[]},"11843":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11844":{"varMapping":{"__isSmartRef__":true,"id":11845},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11846},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11845":{"this":{"__isSmartRef__":true,"id":4115}},"11846":{"timestamp":{"__isSmartRef__":true,"id":11847},"user":"josi","tags":["gemtypes"]},"11847":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11848":{"varMapping":{"__isSmartRef__":true,"id":11849},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11850},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11849":{"this":{"__isSmartRef__":true,"id":4115}},"11850":{"timestamp":{"__isSmartRef__":true,"id":11851},"user":"josi","tags":["gemtypes"]},"11851":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11852":{"varMapping":{"__isSmartRef__":true,"id":11853},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11854},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11853":{"this":{"__isSmartRef__":true,"id":4115}},"11854":{"timestamp":{"__isSmartRef__":true,"id":11855},"user":"jan.sandbrink","tags":[]},"11855":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11856":{"become":{"__isSmartRef__":true,"id":11857},"onMouseDown":{"__isSmartRef__":true,"id":11861},"updatePicture":{"__isSmartRef__":true,"id":11869},"ruby":{"__isSmartRef__":true,"id":11873},"switchPositionWith":{"__isSmartRef__":true,"id":11877},"addNeighbour":{"__isSmartRef__":true,"id":11881},"amethyst":{"__isSmartRef__":true,"id":11885},"diopside":{"__isSmartRef__":true,"id":11889},"gemTypes":{"__isSmartRef__":true,"id":11893},"becomeRandomGem":{"__isSmartRef__":true,"id":11897},"mark":{"__isSmartRef__":true,"id":11901},"unmark":{"__isSmartRef__":true,"id":11905},"hasNeighbour":{"__isSmartRef__":true,"id":11909},"debugMarkNeighbours":{"__isSmartRef__":true,"id":11913},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":11917},"disappear":{"__isSmartRef__":true,"id":11921},"findStreakStart":{"__isSmartRef__":true,"id":11925},"buildStreak":{"__isSmartRef__":true,"id":11929},"scoreStreak":{"__isSmartRef__":true,"id":11933},"tryToStreak":{"__isSmartRef__":true,"id":11937},"blueDiamond":{"__isSmartRef__":true,"id":11941},"prehnite":{"__isSmartRef__":true,"id":11945},"debugUnmark":{"__isSmartRef__":true,"id":11949},"debugMark":{"__isSmartRef__":true,"id":11953},"citrine":{"__isSmartRef__":true,"id":11957},"move":{"__isSmartRef__":true,"id":11961},"performMovement":{"__isSmartRef__":true,"id":11965},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":11969},"zircon":{"__isSmartRef__":true,"id":11973},"emerald":{"__isSmartRef__":true,"id":11977},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":11981}},"11857":{"varMapping":{"__isSmartRef__":true,"id":11858},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11859},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11858":{"this":{"__isSmartRef__":true,"id":3988}},"11859":{"timestamp":{"__isSmartRef__":true,"id":11860},"user":"josi","tags":[]},"11860":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11861":{"varMapping":{"__isSmartRef__":true,"id":11862},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11867},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11862":{"this":{"__isSmartRef__":true,"id":3988},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11863}},"11863":{"$super":{"__isSmartRef__":true,"id":11864}},"11864":{"varMapping":{"__isSmartRef__":true,"id":11865},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11866},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11865":{"obj":{"__isSmartRef__":true,"id":3988},"name":"onMouseDown"},"11866":{},"11867":{"timestamp":{"__isSmartRef__":true,"id":11868},"user":"soergel","tags":[]},"11868":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11869":{"varMapping":{"__isSmartRef__":true,"id":11870},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":11871},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11870":{"this":{"__isSmartRef__":true,"id":3988}},"11871":{"timestamp":{"__isSmartRef__":true,"id":11872},"user":"soergel","tags":[]},"11872":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"11873":{"varMapping":{"__isSmartRef__":true,"id":11874},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":11875},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11874":{"this":{"__isSmartRef__":true,"id":3988}},"11875":{"timestamp":{"__isSmartRef__":true,"id":11876},"user":"josi","tags":["gemtypes"]},"11876":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"11877":{"varMapping":{"__isSmartRef__":true,"id":11878},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11879},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11878":{"this":{"__isSmartRef__":true,"id":3988}},"11879":{"timestamp":{"__isSmartRef__":true,"id":11880},"user":"jan.sandbrink","tags":[]},"11880":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"11881":{"varMapping":{"__isSmartRef__":true,"id":11882},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11883},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11882":{"this":{"__isSmartRef__":true,"id":3988}},"11883":{"timestamp":{"__isSmartRef__":true,"id":11884},"user":"jan.sandbrink","tags":[]},"11884":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"11885":{"varMapping":{"__isSmartRef__":true,"id":11886},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":11887},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11886":{"this":{"__isSmartRef__":true,"id":3988}},"11887":{"timestamp":{"__isSmartRef__":true,"id":11888},"user":"josi","tags":["gemtypes"]},"11888":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"11889":{"varMapping":{"__isSmartRef__":true,"id":11890},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":11891},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11890":{"this":{"__isSmartRef__":true,"id":3988}},"11891":{"timestamp":{"__isSmartRef__":true,"id":11892},"user":"josi","tags":["gemtypes"]},"11892":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"11893":{"varMapping":{"__isSmartRef__":true,"id":11894},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":11895},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11894":{"this":{"__isSmartRef__":true,"id":3988}},"11895":{"timestamp":{"__isSmartRef__":true,"id":11896},"user":"josi","tags":[]},"11896":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"11897":{"varMapping":{"__isSmartRef__":true,"id":11898},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":11899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11898":{"this":{"__isSmartRef__":true,"id":3988}},"11899":{"timestamp":{"__isSmartRef__":true,"id":11900},"user":"josi","tags":[]},"11900":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"11901":{"varMapping":{"__isSmartRef__":true,"id":11902},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":11903},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11902":{"this":{"__isSmartRef__":true,"id":3988}},"11903":{"timestamp":{"__isSmartRef__":true,"id":11904},"user":"soergel","tags":[]},"11904":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"11905":{"varMapping":{"__isSmartRef__":true,"id":11906},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":11907},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11906":{"this":{"__isSmartRef__":true,"id":3988}},"11907":{"timestamp":{"__isSmartRef__":true,"id":11908},"user":"soergel","tags":[]},"11908":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"11909":{"varMapping":{"__isSmartRef__":true,"id":11910},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":11911},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11910":{"this":{"__isSmartRef__":true,"id":3988}},"11911":{"timestamp":{"__isSmartRef__":true,"id":11912},"user":"soergel","tags":[]},"11912":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"11913":{"varMapping":{"__isSmartRef__":true,"id":11914},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11915},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11914":{"this":{"__isSmartRef__":true,"id":3988}},"11915":{"timestamp":{"__isSmartRef__":true,"id":11916},"user":"soergel","tags":["debug"]},"11916":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"11917":{"varMapping":{"__isSmartRef__":true,"id":11918},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":11919},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11918":{"this":{"__isSmartRef__":true,"id":3988}},"11919":{"timestamp":{"__isSmartRef__":true,"id":11920},"user":"soergel","tags":["debug"]},"11920":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"11921":{"varMapping":{"__isSmartRef__":true,"id":11922},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":11923},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11922":{"this":{"__isSmartRef__":true,"id":3988}},"11923":{"timestamp":{"__isSmartRef__":true,"id":11924},"user":"jan.sandbrink","tags":[]},"11924":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"11925":{"varMapping":{"__isSmartRef__":true,"id":11926},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11927},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11926":{"this":{"__isSmartRef__":true,"id":3988}},"11927":{"timestamp":{"__isSmartRef__":true,"id":11928},"user":"jan.sandbrink","tags":[]},"11928":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"11929":{"varMapping":{"__isSmartRef__":true,"id":11930},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":11931},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11930":{"this":{"__isSmartRef__":true,"id":3988}},"11931":{"timestamp":{"__isSmartRef__":true,"id":11932},"user":"jan.sandbrink","tags":[]},"11932":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"11933":{"varMapping":{"__isSmartRef__":true,"id":11934},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":11935},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11934":{"this":{"__isSmartRef__":true,"id":3988}},"11935":{"timestamp":{"__isSmartRef__":true,"id":11936},"user":"jan.sandbrink","tags":[]},"11936":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"11937":{"varMapping":{"__isSmartRef__":true,"id":11938},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":11939},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11938":{"this":{"__isSmartRef__":true,"id":3988}},"11939":{"timestamp":{"__isSmartRef__":true,"id":11940},"user":"jan.sandbrink","tags":[]},"11940":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"11941":{"varMapping":{"__isSmartRef__":true,"id":11942},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":11943},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11942":{"this":{"__isSmartRef__":true,"id":3988}},"11943":{"timestamp":{"__isSmartRef__":true,"id":11944},"user":"josi","tags":["gemtypes"]},"11944":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"11945":{"varMapping":{"__isSmartRef__":true,"id":11946},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":11947},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11946":{"this":{"__isSmartRef__":true,"id":3988}},"11947":{"timestamp":{"__isSmartRef__":true,"id":11948},"user":"josi","tags":["gemtypes"]},"11948":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"11949":{"varMapping":{"__isSmartRef__":true,"id":11950},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":11951},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11950":{"this":{"__isSmartRef__":true,"id":3988}},"11951":{"timestamp":{"__isSmartRef__":true,"id":11952},"user":"soergel","tags":["debug"]},"11952":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"11953":{"varMapping":{"__isSmartRef__":true,"id":11954},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":11955},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11954":{"this":{"__isSmartRef__":true,"id":3988}},"11955":{"timestamp":{"__isSmartRef__":true,"id":11956},"user":"soergel","tags":["debug"]},"11956":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"11957":{"varMapping":{"__isSmartRef__":true,"id":11958},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":11959},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11958":{"this":{"__isSmartRef__":true,"id":3988}},"11959":{"timestamp":{"__isSmartRef__":true,"id":11960},"user":"josi","tags":["gemtypes"]},"11960":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"11961":{"varMapping":{"__isSmartRef__":true,"id":11962},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":11963},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11962":{"this":{"__isSmartRef__":true,"id":3988}},"11963":{"timestamp":{"__isSmartRef__":true,"id":11964},"user":"soergel","tags":[]},"11964":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"11965":{"varMapping":{"__isSmartRef__":true,"id":11966},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":11967},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11966":{"this":{"__isSmartRef__":true,"id":3988}},"11967":{"timestamp":{"__isSmartRef__":true,"id":11968},"user":"soergel","tags":[]},"11968":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"11969":{"varMapping":{"__isSmartRef__":true,"id":11970},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":11971},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11970":{"this":{"__isSmartRef__":true,"id":3988}},"11971":{"timestamp":{"__isSmartRef__":true,"id":11972},"user":"soergel","tags":[]},"11972":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"11973":{"varMapping":{"__isSmartRef__":true,"id":11974},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":11975},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11974":{"this":{"__isSmartRef__":true,"id":3988}},"11975":{"timestamp":{"__isSmartRef__":true,"id":11976},"user":"josi","tags":["gemtypes"]},"11976":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"11977":{"varMapping":{"__isSmartRef__":true,"id":11978},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":11979},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11978":{"this":{"__isSmartRef__":true,"id":3988}},"11979":{"timestamp":{"__isSmartRef__":true,"id":11980},"user":"josi","tags":["gemtypes"]},"11980":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"11981":{"varMapping":{"__isSmartRef__":true,"id":11982},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":11983},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11982":{"this":{"__isSmartRef__":true,"id":3988}},"11983":{"timestamp":{"__isSmartRef__":true,"id":11984},"user":"jan.sandbrink","tags":[]},"11984":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"11985":{"become":{"__isSmartRef__":true,"id":11986},"onMouseDown":{"__isSmartRef__":true,"id":11990},"updatePicture":{"__isSmartRef__":true,"id":11998},"ruby":{"__isSmartRef__":true,"id":12002},"switchPositionWith":{"__isSmartRef__":true,"id":12006},"addNeighbour":{"__isSmartRef__":true,"id":12010},"amethyst":{"__isSmartRef__":true,"id":12014},"diopside":{"__isSmartRef__":true,"id":12018},"gemTypes":{"__isSmartRef__":true,"id":12022},"becomeRandomGem":{"__isSmartRef__":true,"id":12026},"mark":{"__isSmartRef__":true,"id":12030},"unmark":{"__isSmartRef__":true,"id":12034},"hasNeighbour":{"__isSmartRef__":true,"id":12038},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12042},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12046},"disappear":{"__isSmartRef__":true,"id":12050},"findStreakStart":{"__isSmartRef__":true,"id":12054},"buildStreak":{"__isSmartRef__":true,"id":12058},"scoreStreak":{"__isSmartRef__":true,"id":12062},"tryToStreak":{"__isSmartRef__":true,"id":12066},"blueDiamond":{"__isSmartRef__":true,"id":12070},"prehnite":{"__isSmartRef__":true,"id":12074},"debugUnmark":{"__isSmartRef__":true,"id":12078},"debugMark":{"__isSmartRef__":true,"id":12082},"citrine":{"__isSmartRef__":true,"id":12086},"move":{"__isSmartRef__":true,"id":12090},"performMovement":{"__isSmartRef__":true,"id":12094},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12098},"zircon":{"__isSmartRef__":true,"id":12102},"emerald":{"__isSmartRef__":true,"id":12106},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12110}},"11986":{"varMapping":{"__isSmartRef__":true,"id":11987},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":11988},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11987":{"this":{"__isSmartRef__":true,"id":3870}},"11988":{"timestamp":{"__isSmartRef__":true,"id":11989},"user":"josi","tags":[]},"11989":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"11990":{"varMapping":{"__isSmartRef__":true,"id":11991},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":11996},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11991":{"this":{"__isSmartRef__":true,"id":3870},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":11992}},"11992":{"$super":{"__isSmartRef__":true,"id":11993}},"11993":{"varMapping":{"__isSmartRef__":true,"id":11994},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":11995},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11994":{"obj":{"__isSmartRef__":true,"id":3870},"name":"onMouseDown"},"11995":{},"11996":{"timestamp":{"__isSmartRef__":true,"id":11997},"user":"soergel","tags":[]},"11997":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"11998":{"varMapping":{"__isSmartRef__":true,"id":11999},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12000},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"11999":{"this":{"__isSmartRef__":true,"id":3870}},"12000":{"timestamp":{"__isSmartRef__":true,"id":12001},"user":"soergel","tags":[]},"12001":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12002":{"varMapping":{"__isSmartRef__":true,"id":12003},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12004},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12003":{"this":{"__isSmartRef__":true,"id":3870}},"12004":{"timestamp":{"__isSmartRef__":true,"id":12005},"user":"josi","tags":["gemtypes"]},"12005":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12006":{"varMapping":{"__isSmartRef__":true,"id":12007},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12008},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12007":{"this":{"__isSmartRef__":true,"id":3870}},"12008":{"timestamp":{"__isSmartRef__":true,"id":12009},"user":"jan.sandbrink","tags":[]},"12009":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12010":{"varMapping":{"__isSmartRef__":true,"id":12011},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12012},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12011":{"this":{"__isSmartRef__":true,"id":3870}},"12012":{"timestamp":{"__isSmartRef__":true,"id":12013},"user":"jan.sandbrink","tags":[]},"12013":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12014":{"varMapping":{"__isSmartRef__":true,"id":12015},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12016},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12015":{"this":{"__isSmartRef__":true,"id":3870}},"12016":{"timestamp":{"__isSmartRef__":true,"id":12017},"user":"josi","tags":["gemtypes"]},"12017":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12018":{"varMapping":{"__isSmartRef__":true,"id":12019},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12020},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12019":{"this":{"__isSmartRef__":true,"id":3870}},"12020":{"timestamp":{"__isSmartRef__":true,"id":12021},"user":"josi","tags":["gemtypes"]},"12021":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12022":{"varMapping":{"__isSmartRef__":true,"id":12023},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12024},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12023":{"this":{"__isSmartRef__":true,"id":3870}},"12024":{"timestamp":{"__isSmartRef__":true,"id":12025},"user":"josi","tags":[]},"12025":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12026":{"varMapping":{"__isSmartRef__":true,"id":12027},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12028},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12027":{"this":{"__isSmartRef__":true,"id":3870}},"12028":{"timestamp":{"__isSmartRef__":true,"id":12029},"user":"josi","tags":[]},"12029":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12030":{"varMapping":{"__isSmartRef__":true,"id":12031},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12032},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12031":{"this":{"__isSmartRef__":true,"id":3870}},"12032":{"timestamp":{"__isSmartRef__":true,"id":12033},"user":"soergel","tags":[]},"12033":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12034":{"varMapping":{"__isSmartRef__":true,"id":12035},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12036},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12035":{"this":{"__isSmartRef__":true,"id":3870}},"12036":{"timestamp":{"__isSmartRef__":true,"id":12037},"user":"soergel","tags":[]},"12037":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12038":{"varMapping":{"__isSmartRef__":true,"id":12039},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12040},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12039":{"this":{"__isSmartRef__":true,"id":3870}},"12040":{"timestamp":{"__isSmartRef__":true,"id":12041},"user":"soergel","tags":[]},"12041":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12042":{"varMapping":{"__isSmartRef__":true,"id":12043},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12044},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12043":{"this":{"__isSmartRef__":true,"id":3870}},"12044":{"timestamp":{"__isSmartRef__":true,"id":12045},"user":"soergel","tags":["debug"]},"12045":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12046":{"varMapping":{"__isSmartRef__":true,"id":12047},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12048},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12047":{"this":{"__isSmartRef__":true,"id":3870}},"12048":{"timestamp":{"__isSmartRef__":true,"id":12049},"user":"soergel","tags":["debug"]},"12049":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12050":{"varMapping":{"__isSmartRef__":true,"id":12051},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12052},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12051":{"this":{"__isSmartRef__":true,"id":3870}},"12052":{"timestamp":{"__isSmartRef__":true,"id":12053},"user":"jan.sandbrink","tags":[]},"12053":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12054":{"varMapping":{"__isSmartRef__":true,"id":12055},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12056},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12055":{"this":{"__isSmartRef__":true,"id":3870}},"12056":{"timestamp":{"__isSmartRef__":true,"id":12057},"user":"jan.sandbrink","tags":[]},"12057":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12058":{"varMapping":{"__isSmartRef__":true,"id":12059},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12060},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12059":{"this":{"__isSmartRef__":true,"id":3870}},"12060":{"timestamp":{"__isSmartRef__":true,"id":12061},"user":"jan.sandbrink","tags":[]},"12061":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12062":{"varMapping":{"__isSmartRef__":true,"id":12063},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12064},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12063":{"this":{"__isSmartRef__":true,"id":3870}},"12064":{"timestamp":{"__isSmartRef__":true,"id":12065},"user":"jan.sandbrink","tags":[]},"12065":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12066":{"varMapping":{"__isSmartRef__":true,"id":12067},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12068},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12067":{"this":{"__isSmartRef__":true,"id":3870}},"12068":{"timestamp":{"__isSmartRef__":true,"id":12069},"user":"jan.sandbrink","tags":[]},"12069":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12070":{"varMapping":{"__isSmartRef__":true,"id":12071},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12072},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12071":{"this":{"__isSmartRef__":true,"id":3870}},"12072":{"timestamp":{"__isSmartRef__":true,"id":12073},"user":"josi","tags":["gemtypes"]},"12073":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12074":{"varMapping":{"__isSmartRef__":true,"id":12075},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12076},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12075":{"this":{"__isSmartRef__":true,"id":3870}},"12076":{"timestamp":{"__isSmartRef__":true,"id":12077},"user":"josi","tags":["gemtypes"]},"12077":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12078":{"varMapping":{"__isSmartRef__":true,"id":12079},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12080},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12079":{"this":{"__isSmartRef__":true,"id":3870}},"12080":{"timestamp":{"__isSmartRef__":true,"id":12081},"user":"soergel","tags":["debug"]},"12081":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12082":{"varMapping":{"__isSmartRef__":true,"id":12083},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12084},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12083":{"this":{"__isSmartRef__":true,"id":3870}},"12084":{"timestamp":{"__isSmartRef__":true,"id":12085},"user":"soergel","tags":["debug"]},"12085":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12086":{"varMapping":{"__isSmartRef__":true,"id":12087},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12088},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12087":{"this":{"__isSmartRef__":true,"id":3870}},"12088":{"timestamp":{"__isSmartRef__":true,"id":12089},"user":"josi","tags":["gemtypes"]},"12089":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12090":{"varMapping":{"__isSmartRef__":true,"id":12091},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12092},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12091":{"this":{"__isSmartRef__":true,"id":3870}},"12092":{"timestamp":{"__isSmartRef__":true,"id":12093},"user":"soergel","tags":[]},"12093":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12094":{"varMapping":{"__isSmartRef__":true,"id":12095},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12096},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12095":{"this":{"__isSmartRef__":true,"id":3870}},"12096":{"timestamp":{"__isSmartRef__":true,"id":12097},"user":"soergel","tags":[]},"12097":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12098":{"varMapping":{"__isSmartRef__":true,"id":12099},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12100},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12099":{"this":{"__isSmartRef__":true,"id":3870}},"12100":{"timestamp":{"__isSmartRef__":true,"id":12101},"user":"soergel","tags":[]},"12101":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12102":{"varMapping":{"__isSmartRef__":true,"id":12103},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12104},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12103":{"this":{"__isSmartRef__":true,"id":3870}},"12104":{"timestamp":{"__isSmartRef__":true,"id":12105},"user":"josi","tags":["gemtypes"]},"12105":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12106":{"varMapping":{"__isSmartRef__":true,"id":12107},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12108},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12107":{"this":{"__isSmartRef__":true,"id":3870}},"12108":{"timestamp":{"__isSmartRef__":true,"id":12109},"user":"josi","tags":["gemtypes"]},"12109":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12110":{"varMapping":{"__isSmartRef__":true,"id":12111},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12112},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12111":{"this":{"__isSmartRef__":true,"id":3870}},"12112":{"timestamp":{"__isSmartRef__":true,"id":12113},"user":"jan.sandbrink","tags":[]},"12113":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12114":{"become":{"__isSmartRef__":true,"id":12115},"onMouseDown":{"__isSmartRef__":true,"id":12119},"updatePicture":{"__isSmartRef__":true,"id":12127},"ruby":{"__isSmartRef__":true,"id":12131},"switchPositionWith":{"__isSmartRef__":true,"id":12135},"addNeighbour":{"__isSmartRef__":true,"id":12139},"amethyst":{"__isSmartRef__":true,"id":12143},"diopside":{"__isSmartRef__":true,"id":12147},"gemTypes":{"__isSmartRef__":true,"id":12151},"becomeRandomGem":{"__isSmartRef__":true,"id":12155},"mark":{"__isSmartRef__":true,"id":12159},"unmark":{"__isSmartRef__":true,"id":12163},"hasNeighbour":{"__isSmartRef__":true,"id":12167},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12171},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12175},"disappear":{"__isSmartRef__":true,"id":12179},"findStreakStart":{"__isSmartRef__":true,"id":12183},"buildStreak":{"__isSmartRef__":true,"id":12187},"scoreStreak":{"__isSmartRef__":true,"id":12191},"tryToStreak":{"__isSmartRef__":true,"id":12195},"blueDiamond":{"__isSmartRef__":true,"id":12199},"prehnite":{"__isSmartRef__":true,"id":12203},"debugUnmark":{"__isSmartRef__":true,"id":12207},"debugMark":{"__isSmartRef__":true,"id":12211},"citrine":{"__isSmartRef__":true,"id":12215},"move":{"__isSmartRef__":true,"id":12219},"performMovement":{"__isSmartRef__":true,"id":12223},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12227},"zircon":{"__isSmartRef__":true,"id":12231},"emerald":{"__isSmartRef__":true,"id":12235},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12239}},"12115":{"varMapping":{"__isSmartRef__":true,"id":12116},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12117},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12116":{"this":{"__isSmartRef__":true,"id":3735}},"12117":{"timestamp":{"__isSmartRef__":true,"id":12118},"user":"josi","tags":[]},"12118":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12119":{"varMapping":{"__isSmartRef__":true,"id":12120},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12125},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12120":{"this":{"__isSmartRef__":true,"id":3735},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12121}},"12121":{"$super":{"__isSmartRef__":true,"id":12122}},"12122":{"varMapping":{"__isSmartRef__":true,"id":12123},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12124},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12123":{"obj":{"__isSmartRef__":true,"id":3735},"name":"onMouseDown"},"12124":{},"12125":{"timestamp":{"__isSmartRef__":true,"id":12126},"user":"soergel","tags":[]},"12126":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12127":{"varMapping":{"__isSmartRef__":true,"id":12128},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12129},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12128":{"this":{"__isSmartRef__":true,"id":3735}},"12129":{"timestamp":{"__isSmartRef__":true,"id":12130},"user":"soergel","tags":[]},"12130":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12131":{"varMapping":{"__isSmartRef__":true,"id":12132},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12133},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12132":{"this":{"__isSmartRef__":true,"id":3735}},"12133":{"timestamp":{"__isSmartRef__":true,"id":12134},"user":"josi","tags":["gemtypes"]},"12134":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12135":{"varMapping":{"__isSmartRef__":true,"id":12136},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12137},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12136":{"this":{"__isSmartRef__":true,"id":3735}},"12137":{"timestamp":{"__isSmartRef__":true,"id":12138},"user":"jan.sandbrink","tags":[]},"12138":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12139":{"varMapping":{"__isSmartRef__":true,"id":12140},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12141},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12140":{"this":{"__isSmartRef__":true,"id":3735}},"12141":{"timestamp":{"__isSmartRef__":true,"id":12142},"user":"jan.sandbrink","tags":[]},"12142":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12143":{"varMapping":{"__isSmartRef__":true,"id":12144},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12145},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12144":{"this":{"__isSmartRef__":true,"id":3735}},"12145":{"timestamp":{"__isSmartRef__":true,"id":12146},"user":"josi","tags":["gemtypes"]},"12146":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12147":{"varMapping":{"__isSmartRef__":true,"id":12148},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12149},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12148":{"this":{"__isSmartRef__":true,"id":3735}},"12149":{"timestamp":{"__isSmartRef__":true,"id":12150},"user":"josi","tags":["gemtypes"]},"12150":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12151":{"varMapping":{"__isSmartRef__":true,"id":12152},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12153},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12152":{"this":{"__isSmartRef__":true,"id":3735}},"12153":{"timestamp":{"__isSmartRef__":true,"id":12154},"user":"josi","tags":[]},"12154":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12155":{"varMapping":{"__isSmartRef__":true,"id":12156},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12156":{"this":{"__isSmartRef__":true,"id":3735}},"12157":{"timestamp":{"__isSmartRef__":true,"id":12158},"user":"josi","tags":[]},"12158":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12159":{"varMapping":{"__isSmartRef__":true,"id":12160},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12161},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12160":{"this":{"__isSmartRef__":true,"id":3735}},"12161":{"timestamp":{"__isSmartRef__":true,"id":12162},"user":"soergel","tags":[]},"12162":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12163":{"varMapping":{"__isSmartRef__":true,"id":12164},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12165},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12164":{"this":{"__isSmartRef__":true,"id":3735}},"12165":{"timestamp":{"__isSmartRef__":true,"id":12166},"user":"soergel","tags":[]},"12166":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12167":{"varMapping":{"__isSmartRef__":true,"id":12168},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12169},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12168":{"this":{"__isSmartRef__":true,"id":3735}},"12169":{"timestamp":{"__isSmartRef__":true,"id":12170},"user":"soergel","tags":[]},"12170":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12171":{"varMapping":{"__isSmartRef__":true,"id":12172},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12172":{"this":{"__isSmartRef__":true,"id":3735}},"12173":{"timestamp":{"__isSmartRef__":true,"id":12174},"user":"soergel","tags":["debug"]},"12174":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12175":{"varMapping":{"__isSmartRef__":true,"id":12176},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12177},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12176":{"this":{"__isSmartRef__":true,"id":3735}},"12177":{"timestamp":{"__isSmartRef__":true,"id":12178},"user":"soergel","tags":["debug"]},"12178":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12179":{"varMapping":{"__isSmartRef__":true,"id":12180},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12181},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12180":{"this":{"__isSmartRef__":true,"id":3735}},"12181":{"timestamp":{"__isSmartRef__":true,"id":12182},"user":"jan.sandbrink","tags":[]},"12182":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12183":{"varMapping":{"__isSmartRef__":true,"id":12184},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12185},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12184":{"this":{"__isSmartRef__":true,"id":3735}},"12185":{"timestamp":{"__isSmartRef__":true,"id":12186},"user":"jan.sandbrink","tags":[]},"12186":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12187":{"varMapping":{"__isSmartRef__":true,"id":12188},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12189},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12188":{"this":{"__isSmartRef__":true,"id":3735}},"12189":{"timestamp":{"__isSmartRef__":true,"id":12190},"user":"jan.sandbrink","tags":[]},"12190":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12191":{"varMapping":{"__isSmartRef__":true,"id":12192},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12193},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12192":{"this":{"__isSmartRef__":true,"id":3735}},"12193":{"timestamp":{"__isSmartRef__":true,"id":12194},"user":"jan.sandbrink","tags":[]},"12194":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12195":{"varMapping":{"__isSmartRef__":true,"id":12196},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12197},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12196":{"this":{"__isSmartRef__":true,"id":3735}},"12197":{"timestamp":{"__isSmartRef__":true,"id":12198},"user":"jan.sandbrink","tags":[]},"12198":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12199":{"varMapping":{"__isSmartRef__":true,"id":12200},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12201},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12200":{"this":{"__isSmartRef__":true,"id":3735}},"12201":{"timestamp":{"__isSmartRef__":true,"id":12202},"user":"josi","tags":["gemtypes"]},"12202":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12203":{"varMapping":{"__isSmartRef__":true,"id":12204},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12205},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12204":{"this":{"__isSmartRef__":true,"id":3735}},"12205":{"timestamp":{"__isSmartRef__":true,"id":12206},"user":"josi","tags":["gemtypes"]},"12206":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12207":{"varMapping":{"__isSmartRef__":true,"id":12208},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12209},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12208":{"this":{"__isSmartRef__":true,"id":3735}},"12209":{"timestamp":{"__isSmartRef__":true,"id":12210},"user":"soergel","tags":["debug"]},"12210":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12211":{"varMapping":{"__isSmartRef__":true,"id":12212},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12213},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12212":{"this":{"__isSmartRef__":true,"id":3735}},"12213":{"timestamp":{"__isSmartRef__":true,"id":12214},"user":"soergel","tags":["debug"]},"12214":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12215":{"varMapping":{"__isSmartRef__":true,"id":12216},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12217},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12216":{"this":{"__isSmartRef__":true,"id":3735}},"12217":{"timestamp":{"__isSmartRef__":true,"id":12218},"user":"josi","tags":["gemtypes"]},"12218":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12219":{"varMapping":{"__isSmartRef__":true,"id":12220},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12221},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12220":{"this":{"__isSmartRef__":true,"id":3735}},"12221":{"timestamp":{"__isSmartRef__":true,"id":12222},"user":"soergel","tags":[]},"12222":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12223":{"varMapping":{"__isSmartRef__":true,"id":12224},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12225},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12224":{"this":{"__isSmartRef__":true,"id":3735}},"12225":{"timestamp":{"__isSmartRef__":true,"id":12226},"user":"soergel","tags":[]},"12226":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12227":{"varMapping":{"__isSmartRef__":true,"id":12228},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12229},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12228":{"this":{"__isSmartRef__":true,"id":3735}},"12229":{"timestamp":{"__isSmartRef__":true,"id":12230},"user":"soergel","tags":[]},"12230":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12231":{"varMapping":{"__isSmartRef__":true,"id":12232},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12233},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12232":{"this":{"__isSmartRef__":true,"id":3735}},"12233":{"timestamp":{"__isSmartRef__":true,"id":12234},"user":"josi","tags":["gemtypes"]},"12234":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12235":{"varMapping":{"__isSmartRef__":true,"id":12236},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12237},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12236":{"this":{"__isSmartRef__":true,"id":3735}},"12237":{"timestamp":{"__isSmartRef__":true,"id":12238},"user":"josi","tags":["gemtypes"]},"12238":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12239":{"varMapping":{"__isSmartRef__":true,"id":12240},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12241},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12240":{"this":{"__isSmartRef__":true,"id":3735}},"12241":{"timestamp":{"__isSmartRef__":true,"id":12242},"user":"jan.sandbrink","tags":[]},"12242":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12243":{"become":{"__isSmartRef__":true,"id":12244},"onMouseDown":{"__isSmartRef__":true,"id":12248},"updatePicture":{"__isSmartRef__":true,"id":12256},"ruby":{"__isSmartRef__":true,"id":12260},"switchPositionWith":{"__isSmartRef__":true,"id":12264},"addNeighbour":{"__isSmartRef__":true,"id":12268},"amethyst":{"__isSmartRef__":true,"id":12272},"diopside":{"__isSmartRef__":true,"id":12276},"gemTypes":{"__isSmartRef__":true,"id":12280},"becomeRandomGem":{"__isSmartRef__":true,"id":12284},"mark":{"__isSmartRef__":true,"id":12288},"unmark":{"__isSmartRef__":true,"id":12292},"hasNeighbour":{"__isSmartRef__":true,"id":12296},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12300},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12304},"disappear":{"__isSmartRef__":true,"id":12308},"findStreakStart":{"__isSmartRef__":true,"id":12312},"buildStreak":{"__isSmartRef__":true,"id":12316},"scoreStreak":{"__isSmartRef__":true,"id":12320},"tryToStreak":{"__isSmartRef__":true,"id":12324},"blueDiamond":{"__isSmartRef__":true,"id":12328},"prehnite":{"__isSmartRef__":true,"id":12332},"debugUnmark":{"__isSmartRef__":true,"id":12336},"debugMark":{"__isSmartRef__":true,"id":12340},"citrine":{"__isSmartRef__":true,"id":12344},"move":{"__isSmartRef__":true,"id":12348},"performMovement":{"__isSmartRef__":true,"id":12352},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12356},"zircon":{"__isSmartRef__":true,"id":12360},"emerald":{"__isSmartRef__":true,"id":12364},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12368}},"12244":{"varMapping":{"__isSmartRef__":true,"id":12245},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12246},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12245":{"this":{"__isSmartRef__":true,"id":3608}},"12246":{"timestamp":{"__isSmartRef__":true,"id":12247},"user":"josi","tags":[]},"12247":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12248":{"varMapping":{"__isSmartRef__":true,"id":12249},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12254},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12249":{"this":{"__isSmartRef__":true,"id":3608},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12250}},"12250":{"$super":{"__isSmartRef__":true,"id":12251}},"12251":{"varMapping":{"__isSmartRef__":true,"id":12252},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12253},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12252":{"obj":{"__isSmartRef__":true,"id":3608},"name":"onMouseDown"},"12253":{},"12254":{"timestamp":{"__isSmartRef__":true,"id":12255},"user":"soergel","tags":[]},"12255":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12256":{"varMapping":{"__isSmartRef__":true,"id":12257},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12258},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12257":{"this":{"__isSmartRef__":true,"id":3608}},"12258":{"timestamp":{"__isSmartRef__":true,"id":12259},"user":"soergel","tags":[]},"12259":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12260":{"varMapping":{"__isSmartRef__":true,"id":12261},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12262},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12261":{"this":{"__isSmartRef__":true,"id":3608}},"12262":{"timestamp":{"__isSmartRef__":true,"id":12263},"user":"josi","tags":["gemtypes"]},"12263":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12264":{"varMapping":{"__isSmartRef__":true,"id":12265},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12266},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12265":{"this":{"__isSmartRef__":true,"id":3608}},"12266":{"timestamp":{"__isSmartRef__":true,"id":12267},"user":"jan.sandbrink","tags":[]},"12267":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12268":{"varMapping":{"__isSmartRef__":true,"id":12269},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12270},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12269":{"this":{"__isSmartRef__":true,"id":3608}},"12270":{"timestamp":{"__isSmartRef__":true,"id":12271},"user":"jan.sandbrink","tags":[]},"12271":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12272":{"varMapping":{"__isSmartRef__":true,"id":12273},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12274},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12273":{"this":{"__isSmartRef__":true,"id":3608}},"12274":{"timestamp":{"__isSmartRef__":true,"id":12275},"user":"josi","tags":["gemtypes"]},"12275":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12276":{"varMapping":{"__isSmartRef__":true,"id":12277},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12278},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12277":{"this":{"__isSmartRef__":true,"id":3608}},"12278":{"timestamp":{"__isSmartRef__":true,"id":12279},"user":"josi","tags":["gemtypes"]},"12279":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12280":{"varMapping":{"__isSmartRef__":true,"id":12281},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12282},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12281":{"this":{"__isSmartRef__":true,"id":3608}},"12282":{"timestamp":{"__isSmartRef__":true,"id":12283},"user":"josi","tags":[]},"12283":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12284":{"varMapping":{"__isSmartRef__":true,"id":12285},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12286},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12285":{"this":{"__isSmartRef__":true,"id":3608}},"12286":{"timestamp":{"__isSmartRef__":true,"id":12287},"user":"josi","tags":[]},"12287":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12288":{"varMapping":{"__isSmartRef__":true,"id":12289},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12290},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12289":{"this":{"__isSmartRef__":true,"id":3608}},"12290":{"timestamp":{"__isSmartRef__":true,"id":12291},"user":"soergel","tags":[]},"12291":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12292":{"varMapping":{"__isSmartRef__":true,"id":12293},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12294},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12293":{"this":{"__isSmartRef__":true,"id":3608}},"12294":{"timestamp":{"__isSmartRef__":true,"id":12295},"user":"soergel","tags":[]},"12295":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12296":{"varMapping":{"__isSmartRef__":true,"id":12297},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12298},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12297":{"this":{"__isSmartRef__":true,"id":3608}},"12298":{"timestamp":{"__isSmartRef__":true,"id":12299},"user":"soergel","tags":[]},"12299":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12300":{"varMapping":{"__isSmartRef__":true,"id":12301},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12302},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12301":{"this":{"__isSmartRef__":true,"id":3608}},"12302":{"timestamp":{"__isSmartRef__":true,"id":12303},"user":"soergel","tags":["debug"]},"12303":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12304":{"varMapping":{"__isSmartRef__":true,"id":12305},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12306},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12305":{"this":{"__isSmartRef__":true,"id":3608}},"12306":{"timestamp":{"__isSmartRef__":true,"id":12307},"user":"soergel","tags":["debug"]},"12307":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12308":{"varMapping":{"__isSmartRef__":true,"id":12309},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12310},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12309":{"this":{"__isSmartRef__":true,"id":3608}},"12310":{"timestamp":{"__isSmartRef__":true,"id":12311},"user":"jan.sandbrink","tags":[]},"12311":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12312":{"varMapping":{"__isSmartRef__":true,"id":12313},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12314},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12313":{"this":{"__isSmartRef__":true,"id":3608}},"12314":{"timestamp":{"__isSmartRef__":true,"id":12315},"user":"jan.sandbrink","tags":[]},"12315":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12316":{"varMapping":{"__isSmartRef__":true,"id":12317},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12318},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12317":{"this":{"__isSmartRef__":true,"id":3608}},"12318":{"timestamp":{"__isSmartRef__":true,"id":12319},"user":"jan.sandbrink","tags":[]},"12319":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12320":{"varMapping":{"__isSmartRef__":true,"id":12321},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12322},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12321":{"this":{"__isSmartRef__":true,"id":3608}},"12322":{"timestamp":{"__isSmartRef__":true,"id":12323},"user":"jan.sandbrink","tags":[]},"12323":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12324":{"varMapping":{"__isSmartRef__":true,"id":12325},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12326},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12325":{"this":{"__isSmartRef__":true,"id":3608}},"12326":{"timestamp":{"__isSmartRef__":true,"id":12327},"user":"jan.sandbrink","tags":[]},"12327":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12328":{"varMapping":{"__isSmartRef__":true,"id":12329},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12330},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12329":{"this":{"__isSmartRef__":true,"id":3608}},"12330":{"timestamp":{"__isSmartRef__":true,"id":12331},"user":"josi","tags":["gemtypes"]},"12331":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12332":{"varMapping":{"__isSmartRef__":true,"id":12333},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12334},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12333":{"this":{"__isSmartRef__":true,"id":3608}},"12334":{"timestamp":{"__isSmartRef__":true,"id":12335},"user":"josi","tags":["gemtypes"]},"12335":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12336":{"varMapping":{"__isSmartRef__":true,"id":12337},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12338},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12337":{"this":{"__isSmartRef__":true,"id":3608}},"12338":{"timestamp":{"__isSmartRef__":true,"id":12339},"user":"soergel","tags":["debug"]},"12339":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12340":{"varMapping":{"__isSmartRef__":true,"id":12341},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12342},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12341":{"this":{"__isSmartRef__":true,"id":3608}},"12342":{"timestamp":{"__isSmartRef__":true,"id":12343},"user":"soergel","tags":["debug"]},"12343":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12344":{"varMapping":{"__isSmartRef__":true,"id":12345},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12346},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12345":{"this":{"__isSmartRef__":true,"id":3608}},"12346":{"timestamp":{"__isSmartRef__":true,"id":12347},"user":"josi","tags":["gemtypes"]},"12347":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12348":{"varMapping":{"__isSmartRef__":true,"id":12349},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12350},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12349":{"this":{"__isSmartRef__":true,"id":3608}},"12350":{"timestamp":{"__isSmartRef__":true,"id":12351},"user":"soergel","tags":[]},"12351":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12352":{"varMapping":{"__isSmartRef__":true,"id":12353},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12354},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12353":{"this":{"__isSmartRef__":true,"id":3608}},"12354":{"timestamp":{"__isSmartRef__":true,"id":12355},"user":"soergel","tags":[]},"12355":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12356":{"varMapping":{"__isSmartRef__":true,"id":12357},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12358},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12357":{"this":{"__isSmartRef__":true,"id":3608}},"12358":{"timestamp":{"__isSmartRef__":true,"id":12359},"user":"soergel","tags":[]},"12359":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12360":{"varMapping":{"__isSmartRef__":true,"id":12361},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12362},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12361":{"this":{"__isSmartRef__":true,"id":3608}},"12362":{"timestamp":{"__isSmartRef__":true,"id":12363},"user":"josi","tags":["gemtypes"]},"12363":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12364":{"varMapping":{"__isSmartRef__":true,"id":12365},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12366},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12365":{"this":{"__isSmartRef__":true,"id":3608}},"12366":{"timestamp":{"__isSmartRef__":true,"id":12367},"user":"josi","tags":["gemtypes"]},"12367":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12368":{"varMapping":{"__isSmartRef__":true,"id":12369},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12370},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12369":{"this":{"__isSmartRef__":true,"id":3608}},"12370":{"timestamp":{"__isSmartRef__":true,"id":12371},"user":"jan.sandbrink","tags":[]},"12371":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12372":{"become":{"__isSmartRef__":true,"id":12373},"onMouseDown":{"__isSmartRef__":true,"id":12377},"updatePicture":{"__isSmartRef__":true,"id":12385},"ruby":{"__isSmartRef__":true,"id":12389},"switchPositionWith":{"__isSmartRef__":true,"id":12393},"addNeighbour":{"__isSmartRef__":true,"id":12397},"amethyst":{"__isSmartRef__":true,"id":12401},"diopside":{"__isSmartRef__":true,"id":12405},"gemTypes":{"__isSmartRef__":true,"id":12409},"becomeRandomGem":{"__isSmartRef__":true,"id":12413},"mark":{"__isSmartRef__":true,"id":12417},"unmark":{"__isSmartRef__":true,"id":12421},"hasNeighbour":{"__isSmartRef__":true,"id":12425},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12429},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12433},"disappear":{"__isSmartRef__":true,"id":12437},"findStreakStart":{"__isSmartRef__":true,"id":12441},"buildStreak":{"__isSmartRef__":true,"id":12445},"scoreStreak":{"__isSmartRef__":true,"id":12449},"tryToStreak":{"__isSmartRef__":true,"id":12453},"blueDiamond":{"__isSmartRef__":true,"id":12457},"prehnite":{"__isSmartRef__":true,"id":12461},"debugUnmark":{"__isSmartRef__":true,"id":12465},"debugMark":{"__isSmartRef__":true,"id":12469},"citrine":{"__isSmartRef__":true,"id":12473},"move":{"__isSmartRef__":true,"id":12477},"performMovement":{"__isSmartRef__":true,"id":12481},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12485},"zircon":{"__isSmartRef__":true,"id":12489},"emerald":{"__isSmartRef__":true,"id":12493},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12497}},"12373":{"varMapping":{"__isSmartRef__":true,"id":12374},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12375},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12374":{"this":{"__isSmartRef__":true,"id":3516}},"12375":{"timestamp":{"__isSmartRef__":true,"id":12376},"user":"josi","tags":[]},"12376":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12377":{"varMapping":{"__isSmartRef__":true,"id":12378},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12383},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12378":{"this":{"__isSmartRef__":true,"id":3516},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12379}},"12379":{"$super":{"__isSmartRef__":true,"id":12380}},"12380":{"varMapping":{"__isSmartRef__":true,"id":12381},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12382},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12381":{"obj":{"__isSmartRef__":true,"id":3516},"name":"onMouseDown"},"12382":{},"12383":{"timestamp":{"__isSmartRef__":true,"id":12384},"user":"soergel","tags":[]},"12384":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12385":{"varMapping":{"__isSmartRef__":true,"id":12386},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12387},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12386":{"this":{"__isSmartRef__":true,"id":3516}},"12387":{"timestamp":{"__isSmartRef__":true,"id":12388},"user":"soergel","tags":[]},"12388":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12389":{"varMapping":{"__isSmartRef__":true,"id":12390},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12391},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12390":{"this":{"__isSmartRef__":true,"id":3516}},"12391":{"timestamp":{"__isSmartRef__":true,"id":12392},"user":"josi","tags":["gemtypes"]},"12392":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12393":{"varMapping":{"__isSmartRef__":true,"id":12394},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12395},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12394":{"this":{"__isSmartRef__":true,"id":3516}},"12395":{"timestamp":{"__isSmartRef__":true,"id":12396},"user":"jan.sandbrink","tags":[]},"12396":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12397":{"varMapping":{"__isSmartRef__":true,"id":12398},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12399},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12398":{"this":{"__isSmartRef__":true,"id":3516}},"12399":{"timestamp":{"__isSmartRef__":true,"id":12400},"user":"jan.sandbrink","tags":[]},"12400":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12401":{"varMapping":{"__isSmartRef__":true,"id":12402},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12403},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12402":{"this":{"__isSmartRef__":true,"id":3516}},"12403":{"timestamp":{"__isSmartRef__":true,"id":12404},"user":"josi","tags":["gemtypes"]},"12404":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12405":{"varMapping":{"__isSmartRef__":true,"id":12406},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12407},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12406":{"this":{"__isSmartRef__":true,"id":3516}},"12407":{"timestamp":{"__isSmartRef__":true,"id":12408},"user":"josi","tags":["gemtypes"]},"12408":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12409":{"varMapping":{"__isSmartRef__":true,"id":12410},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12411},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12410":{"this":{"__isSmartRef__":true,"id":3516}},"12411":{"timestamp":{"__isSmartRef__":true,"id":12412},"user":"josi","tags":[]},"12412":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12413":{"varMapping":{"__isSmartRef__":true,"id":12414},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12414":{"this":{"__isSmartRef__":true,"id":3516}},"12415":{"timestamp":{"__isSmartRef__":true,"id":12416},"user":"josi","tags":[]},"12416":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12417":{"varMapping":{"__isSmartRef__":true,"id":12418},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12419},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12418":{"this":{"__isSmartRef__":true,"id":3516}},"12419":{"timestamp":{"__isSmartRef__":true,"id":12420},"user":"soergel","tags":[]},"12420":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12421":{"varMapping":{"__isSmartRef__":true,"id":12422},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12423},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12422":{"this":{"__isSmartRef__":true,"id":3516}},"12423":{"timestamp":{"__isSmartRef__":true,"id":12424},"user":"soergel","tags":[]},"12424":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12425":{"varMapping":{"__isSmartRef__":true,"id":12426},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12427},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12426":{"this":{"__isSmartRef__":true,"id":3516}},"12427":{"timestamp":{"__isSmartRef__":true,"id":12428},"user":"soergel","tags":[]},"12428":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12429":{"varMapping":{"__isSmartRef__":true,"id":12430},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12431},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12430":{"this":{"__isSmartRef__":true,"id":3516}},"12431":{"timestamp":{"__isSmartRef__":true,"id":12432},"user":"soergel","tags":["debug"]},"12432":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12433":{"varMapping":{"__isSmartRef__":true,"id":12434},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12435},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12434":{"this":{"__isSmartRef__":true,"id":3516}},"12435":{"timestamp":{"__isSmartRef__":true,"id":12436},"user":"soergel","tags":["debug"]},"12436":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12437":{"varMapping":{"__isSmartRef__":true,"id":12438},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12439},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12438":{"this":{"__isSmartRef__":true,"id":3516}},"12439":{"timestamp":{"__isSmartRef__":true,"id":12440},"user":"jan.sandbrink","tags":[]},"12440":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12441":{"varMapping":{"__isSmartRef__":true,"id":12442},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12443},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12442":{"this":{"__isSmartRef__":true,"id":3516}},"12443":{"timestamp":{"__isSmartRef__":true,"id":12444},"user":"jan.sandbrink","tags":[]},"12444":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12445":{"varMapping":{"__isSmartRef__":true,"id":12446},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12446":{"this":{"__isSmartRef__":true,"id":3516}},"12447":{"timestamp":{"__isSmartRef__":true,"id":12448},"user":"jan.sandbrink","tags":[]},"12448":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12449":{"varMapping":{"__isSmartRef__":true,"id":12450},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12451},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12450":{"this":{"__isSmartRef__":true,"id":3516}},"12451":{"timestamp":{"__isSmartRef__":true,"id":12452},"user":"jan.sandbrink","tags":[]},"12452":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12453":{"varMapping":{"__isSmartRef__":true,"id":12454},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12455},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12454":{"this":{"__isSmartRef__":true,"id":3516}},"12455":{"timestamp":{"__isSmartRef__":true,"id":12456},"user":"jan.sandbrink","tags":[]},"12456":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12457":{"varMapping":{"__isSmartRef__":true,"id":12458},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12458":{"this":{"__isSmartRef__":true,"id":3516}},"12459":{"timestamp":{"__isSmartRef__":true,"id":12460},"user":"josi","tags":["gemtypes"]},"12460":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12461":{"varMapping":{"__isSmartRef__":true,"id":12462},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12463},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12462":{"this":{"__isSmartRef__":true,"id":3516}},"12463":{"timestamp":{"__isSmartRef__":true,"id":12464},"user":"josi","tags":["gemtypes"]},"12464":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12465":{"varMapping":{"__isSmartRef__":true,"id":12466},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12467},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12466":{"this":{"__isSmartRef__":true,"id":3516}},"12467":{"timestamp":{"__isSmartRef__":true,"id":12468},"user":"soergel","tags":["debug"]},"12468":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12469":{"varMapping":{"__isSmartRef__":true,"id":12470},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12471},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12470":{"this":{"__isSmartRef__":true,"id":3516}},"12471":{"timestamp":{"__isSmartRef__":true,"id":12472},"user":"soergel","tags":["debug"]},"12472":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12473":{"varMapping":{"__isSmartRef__":true,"id":12474},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12475},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12474":{"this":{"__isSmartRef__":true,"id":3516}},"12475":{"timestamp":{"__isSmartRef__":true,"id":12476},"user":"josi","tags":["gemtypes"]},"12476":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12477":{"varMapping":{"__isSmartRef__":true,"id":12478},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12478":{"this":{"__isSmartRef__":true,"id":3516}},"12479":{"timestamp":{"__isSmartRef__":true,"id":12480},"user":"soergel","tags":[]},"12480":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12481":{"varMapping":{"__isSmartRef__":true,"id":12482},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12483},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12482":{"this":{"__isSmartRef__":true,"id":3516}},"12483":{"timestamp":{"__isSmartRef__":true,"id":12484},"user":"soergel","tags":[]},"12484":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12485":{"varMapping":{"__isSmartRef__":true,"id":12486},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12487},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12486":{"this":{"__isSmartRef__":true,"id":3516}},"12487":{"timestamp":{"__isSmartRef__":true,"id":12488},"user":"soergel","tags":[]},"12488":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12489":{"varMapping":{"__isSmartRef__":true,"id":12490},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12491},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12490":{"this":{"__isSmartRef__":true,"id":3516}},"12491":{"timestamp":{"__isSmartRef__":true,"id":12492},"user":"josi","tags":["gemtypes"]},"12492":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12493":{"varMapping":{"__isSmartRef__":true,"id":12494},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12495},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12494":{"this":{"__isSmartRef__":true,"id":3516}},"12495":{"timestamp":{"__isSmartRef__":true,"id":12496},"user":"josi","tags":["gemtypes"]},"12496":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12497":{"varMapping":{"__isSmartRef__":true,"id":12498},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12498":{"this":{"__isSmartRef__":true,"id":3516}},"12499":{"timestamp":{"__isSmartRef__":true,"id":12500},"user":"jan.sandbrink","tags":[]},"12500":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12501":{"become":{"__isSmartRef__":true,"id":12502},"onMouseDown":{"__isSmartRef__":true,"id":12506},"updatePicture":{"__isSmartRef__":true,"id":12514},"ruby":{"__isSmartRef__":true,"id":12518},"switchPositionWith":{"__isSmartRef__":true,"id":12522},"addNeighbour":{"__isSmartRef__":true,"id":12526},"amethyst":{"__isSmartRef__":true,"id":12530},"diopside":{"__isSmartRef__":true,"id":12534},"gemTypes":{"__isSmartRef__":true,"id":12538},"becomeRandomGem":{"__isSmartRef__":true,"id":12542},"mark":{"__isSmartRef__":true,"id":12546},"unmark":{"__isSmartRef__":true,"id":12550},"hasNeighbour":{"__isSmartRef__":true,"id":12554},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12558},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12562},"disappear":{"__isSmartRef__":true,"id":12566},"findStreakStart":{"__isSmartRef__":true,"id":12570},"buildStreak":{"__isSmartRef__":true,"id":12574},"scoreStreak":{"__isSmartRef__":true,"id":12578},"tryToStreak":{"__isSmartRef__":true,"id":12582},"blueDiamond":{"__isSmartRef__":true,"id":12586},"prehnite":{"__isSmartRef__":true,"id":12590},"debugUnmark":{"__isSmartRef__":true,"id":12594},"debugMark":{"__isSmartRef__":true,"id":12598},"citrine":{"__isSmartRef__":true,"id":12602},"move":{"__isSmartRef__":true,"id":12606},"performMovement":{"__isSmartRef__":true,"id":12610},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12614},"zircon":{"__isSmartRef__":true,"id":12618},"emerald":{"__isSmartRef__":true,"id":12622},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12626}},"12502":{"varMapping":{"__isSmartRef__":true,"id":12503},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12504},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12503":{"this":{"__isSmartRef__":true,"id":3415}},"12504":{"timestamp":{"__isSmartRef__":true,"id":12505},"user":"josi","tags":[]},"12505":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12506":{"varMapping":{"__isSmartRef__":true,"id":12507},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12512},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12507":{"this":{"__isSmartRef__":true,"id":3415},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12508}},"12508":{"$super":{"__isSmartRef__":true,"id":12509}},"12509":{"varMapping":{"__isSmartRef__":true,"id":12510},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12511},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12510":{"obj":{"__isSmartRef__":true,"id":3415},"name":"onMouseDown"},"12511":{},"12512":{"timestamp":{"__isSmartRef__":true,"id":12513},"user":"soergel","tags":[]},"12513":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12514":{"varMapping":{"__isSmartRef__":true,"id":12515},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12516},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12515":{"this":{"__isSmartRef__":true,"id":3415}},"12516":{"timestamp":{"__isSmartRef__":true,"id":12517},"user":"soergel","tags":[]},"12517":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12518":{"varMapping":{"__isSmartRef__":true,"id":12519},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12520},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12519":{"this":{"__isSmartRef__":true,"id":3415}},"12520":{"timestamp":{"__isSmartRef__":true,"id":12521},"user":"josi","tags":["gemtypes"]},"12521":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12522":{"varMapping":{"__isSmartRef__":true,"id":12523},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12524},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12523":{"this":{"__isSmartRef__":true,"id":3415}},"12524":{"timestamp":{"__isSmartRef__":true,"id":12525},"user":"jan.sandbrink","tags":[]},"12525":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12526":{"varMapping":{"__isSmartRef__":true,"id":12527},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12528},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12527":{"this":{"__isSmartRef__":true,"id":3415}},"12528":{"timestamp":{"__isSmartRef__":true,"id":12529},"user":"jan.sandbrink","tags":[]},"12529":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12530":{"varMapping":{"__isSmartRef__":true,"id":12531},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12532},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12531":{"this":{"__isSmartRef__":true,"id":3415}},"12532":{"timestamp":{"__isSmartRef__":true,"id":12533},"user":"josi","tags":["gemtypes"]},"12533":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12534":{"varMapping":{"__isSmartRef__":true,"id":12535},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12536},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12535":{"this":{"__isSmartRef__":true,"id":3415}},"12536":{"timestamp":{"__isSmartRef__":true,"id":12537},"user":"josi","tags":["gemtypes"]},"12537":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12538":{"varMapping":{"__isSmartRef__":true,"id":12539},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12540},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12539":{"this":{"__isSmartRef__":true,"id":3415}},"12540":{"timestamp":{"__isSmartRef__":true,"id":12541},"user":"josi","tags":[]},"12541":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12542":{"varMapping":{"__isSmartRef__":true,"id":12543},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12544},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12543":{"this":{"__isSmartRef__":true,"id":3415}},"12544":{"timestamp":{"__isSmartRef__":true,"id":12545},"user":"josi","tags":[]},"12545":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12546":{"varMapping":{"__isSmartRef__":true,"id":12547},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12548},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12547":{"this":{"__isSmartRef__":true,"id":3415}},"12548":{"timestamp":{"__isSmartRef__":true,"id":12549},"user":"soergel","tags":[]},"12549":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12550":{"varMapping":{"__isSmartRef__":true,"id":12551},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12552},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12551":{"this":{"__isSmartRef__":true,"id":3415}},"12552":{"timestamp":{"__isSmartRef__":true,"id":12553},"user":"soergel","tags":[]},"12553":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12554":{"varMapping":{"__isSmartRef__":true,"id":12555},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12556},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12555":{"this":{"__isSmartRef__":true,"id":3415}},"12556":{"timestamp":{"__isSmartRef__":true,"id":12557},"user":"soergel","tags":[]},"12557":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12558":{"varMapping":{"__isSmartRef__":true,"id":12559},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12560},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12559":{"this":{"__isSmartRef__":true,"id":3415}},"12560":{"timestamp":{"__isSmartRef__":true,"id":12561},"user":"soergel","tags":["debug"]},"12561":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12562":{"varMapping":{"__isSmartRef__":true,"id":12563},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12564},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12563":{"this":{"__isSmartRef__":true,"id":3415}},"12564":{"timestamp":{"__isSmartRef__":true,"id":12565},"user":"soergel","tags":["debug"]},"12565":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12566":{"varMapping":{"__isSmartRef__":true,"id":12567},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12568},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12567":{"this":{"__isSmartRef__":true,"id":3415}},"12568":{"timestamp":{"__isSmartRef__":true,"id":12569},"user":"jan.sandbrink","tags":[]},"12569":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12570":{"varMapping":{"__isSmartRef__":true,"id":12571},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12572},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12571":{"this":{"__isSmartRef__":true,"id":3415}},"12572":{"timestamp":{"__isSmartRef__":true,"id":12573},"user":"jan.sandbrink","tags":[]},"12573":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12574":{"varMapping":{"__isSmartRef__":true,"id":12575},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12576},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12575":{"this":{"__isSmartRef__":true,"id":3415}},"12576":{"timestamp":{"__isSmartRef__":true,"id":12577},"user":"jan.sandbrink","tags":[]},"12577":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12578":{"varMapping":{"__isSmartRef__":true,"id":12579},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12580},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12579":{"this":{"__isSmartRef__":true,"id":3415}},"12580":{"timestamp":{"__isSmartRef__":true,"id":12581},"user":"jan.sandbrink","tags":[]},"12581":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12582":{"varMapping":{"__isSmartRef__":true,"id":12583},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12584},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12583":{"this":{"__isSmartRef__":true,"id":3415}},"12584":{"timestamp":{"__isSmartRef__":true,"id":12585},"user":"jan.sandbrink","tags":[]},"12585":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12586":{"varMapping":{"__isSmartRef__":true,"id":12587},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12588},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12587":{"this":{"__isSmartRef__":true,"id":3415}},"12588":{"timestamp":{"__isSmartRef__":true,"id":12589},"user":"josi","tags":["gemtypes"]},"12589":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12590":{"varMapping":{"__isSmartRef__":true,"id":12591},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12592},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12591":{"this":{"__isSmartRef__":true,"id":3415}},"12592":{"timestamp":{"__isSmartRef__":true,"id":12593},"user":"josi","tags":["gemtypes"]},"12593":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12594":{"varMapping":{"__isSmartRef__":true,"id":12595},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12596},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12595":{"this":{"__isSmartRef__":true,"id":3415}},"12596":{"timestamp":{"__isSmartRef__":true,"id":12597},"user":"soergel","tags":["debug"]},"12597":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12598":{"varMapping":{"__isSmartRef__":true,"id":12599},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12600},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12599":{"this":{"__isSmartRef__":true,"id":3415}},"12600":{"timestamp":{"__isSmartRef__":true,"id":12601},"user":"soergel","tags":["debug"]},"12601":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12602":{"varMapping":{"__isSmartRef__":true,"id":12603},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12604},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12603":{"this":{"__isSmartRef__":true,"id":3415}},"12604":{"timestamp":{"__isSmartRef__":true,"id":12605},"user":"josi","tags":["gemtypes"]},"12605":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12606":{"varMapping":{"__isSmartRef__":true,"id":12607},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12608},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12607":{"this":{"__isSmartRef__":true,"id":3415}},"12608":{"timestamp":{"__isSmartRef__":true,"id":12609},"user":"soergel","tags":[]},"12609":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12610":{"varMapping":{"__isSmartRef__":true,"id":12611},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12612},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12611":{"this":{"__isSmartRef__":true,"id":3415}},"12612":{"timestamp":{"__isSmartRef__":true,"id":12613},"user":"soergel","tags":[]},"12613":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12614":{"varMapping":{"__isSmartRef__":true,"id":12615},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12616},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12615":{"this":{"__isSmartRef__":true,"id":3415}},"12616":{"timestamp":{"__isSmartRef__":true,"id":12617},"user":"soergel","tags":[]},"12617":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12618":{"varMapping":{"__isSmartRef__":true,"id":12619},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12620},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12619":{"this":{"__isSmartRef__":true,"id":3415}},"12620":{"timestamp":{"__isSmartRef__":true,"id":12621},"user":"josi","tags":["gemtypes"]},"12621":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12622":{"varMapping":{"__isSmartRef__":true,"id":12623},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12624},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12623":{"this":{"__isSmartRef__":true,"id":3415}},"12624":{"timestamp":{"__isSmartRef__":true,"id":12625},"user":"josi","tags":["gemtypes"]},"12625":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12626":{"varMapping":{"__isSmartRef__":true,"id":12627},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12628},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12627":{"this":{"__isSmartRef__":true,"id":3415}},"12628":{"timestamp":{"__isSmartRef__":true,"id":12629},"user":"jan.sandbrink","tags":[]},"12629":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12630":{"become":{"__isSmartRef__":true,"id":12631},"onMouseDown":{"__isSmartRef__":true,"id":12635},"updatePicture":{"__isSmartRef__":true,"id":12643},"ruby":{"__isSmartRef__":true,"id":12647},"switchPositionWith":{"__isSmartRef__":true,"id":12651},"addNeighbour":{"__isSmartRef__":true,"id":12655},"amethyst":{"__isSmartRef__":true,"id":12659},"diopside":{"__isSmartRef__":true,"id":12663},"gemTypes":{"__isSmartRef__":true,"id":12667},"becomeRandomGem":{"__isSmartRef__":true,"id":12671},"mark":{"__isSmartRef__":true,"id":12675},"unmark":{"__isSmartRef__":true,"id":12679},"hasNeighbour":{"__isSmartRef__":true,"id":12683},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12687},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12691},"disappear":{"__isSmartRef__":true,"id":12695},"findStreakStart":{"__isSmartRef__":true,"id":12699},"buildStreak":{"__isSmartRef__":true,"id":12703},"scoreStreak":{"__isSmartRef__":true,"id":12707},"tryToStreak":{"__isSmartRef__":true,"id":12711},"blueDiamond":{"__isSmartRef__":true,"id":12715},"prehnite":{"__isSmartRef__":true,"id":12719},"debugUnmark":{"__isSmartRef__":true,"id":12723},"debugMark":{"__isSmartRef__":true,"id":12727},"citrine":{"__isSmartRef__":true,"id":12731},"move":{"__isSmartRef__":true,"id":12735},"performMovement":{"__isSmartRef__":true,"id":12739},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12743},"zircon":{"__isSmartRef__":true,"id":12747},"emerald":{"__isSmartRef__":true,"id":12751},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12755}},"12631":{"varMapping":{"__isSmartRef__":true,"id":12632},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12633},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12632":{"this":{"__isSmartRef__":true,"id":3297}},"12633":{"timestamp":{"__isSmartRef__":true,"id":12634},"user":"josi","tags":[]},"12634":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12635":{"varMapping":{"__isSmartRef__":true,"id":12636},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12641},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12636":{"this":{"__isSmartRef__":true,"id":3297},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12637}},"12637":{"$super":{"__isSmartRef__":true,"id":12638}},"12638":{"varMapping":{"__isSmartRef__":true,"id":12639},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12640},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12639":{"obj":{"__isSmartRef__":true,"id":3297},"name":"onMouseDown"},"12640":{},"12641":{"timestamp":{"__isSmartRef__":true,"id":12642},"user":"soergel","tags":[]},"12642":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12643":{"varMapping":{"__isSmartRef__":true,"id":12644},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12645},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12644":{"this":{"__isSmartRef__":true,"id":3297}},"12645":{"timestamp":{"__isSmartRef__":true,"id":12646},"user":"soergel","tags":[]},"12646":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12647":{"varMapping":{"__isSmartRef__":true,"id":12648},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12649},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12648":{"this":{"__isSmartRef__":true,"id":3297}},"12649":{"timestamp":{"__isSmartRef__":true,"id":12650},"user":"josi","tags":["gemtypes"]},"12650":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12651":{"varMapping":{"__isSmartRef__":true,"id":12652},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12653},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12652":{"this":{"__isSmartRef__":true,"id":3297}},"12653":{"timestamp":{"__isSmartRef__":true,"id":12654},"user":"jan.sandbrink","tags":[]},"12654":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12655":{"varMapping":{"__isSmartRef__":true,"id":12656},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12657},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12656":{"this":{"__isSmartRef__":true,"id":3297}},"12657":{"timestamp":{"__isSmartRef__":true,"id":12658},"user":"jan.sandbrink","tags":[]},"12658":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12659":{"varMapping":{"__isSmartRef__":true,"id":12660},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12661},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12660":{"this":{"__isSmartRef__":true,"id":3297}},"12661":{"timestamp":{"__isSmartRef__":true,"id":12662},"user":"josi","tags":["gemtypes"]},"12662":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12663":{"varMapping":{"__isSmartRef__":true,"id":12664},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12665},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12664":{"this":{"__isSmartRef__":true,"id":3297}},"12665":{"timestamp":{"__isSmartRef__":true,"id":12666},"user":"josi","tags":["gemtypes"]},"12666":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12667":{"varMapping":{"__isSmartRef__":true,"id":12668},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12669},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12668":{"this":{"__isSmartRef__":true,"id":3297}},"12669":{"timestamp":{"__isSmartRef__":true,"id":12670},"user":"josi","tags":[]},"12670":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12671":{"varMapping":{"__isSmartRef__":true,"id":12672},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12673},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12672":{"this":{"__isSmartRef__":true,"id":3297}},"12673":{"timestamp":{"__isSmartRef__":true,"id":12674},"user":"josi","tags":[]},"12674":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12675":{"varMapping":{"__isSmartRef__":true,"id":12676},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12677},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12676":{"this":{"__isSmartRef__":true,"id":3297}},"12677":{"timestamp":{"__isSmartRef__":true,"id":12678},"user":"soergel","tags":[]},"12678":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12679":{"varMapping":{"__isSmartRef__":true,"id":12680},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12681},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12680":{"this":{"__isSmartRef__":true,"id":3297}},"12681":{"timestamp":{"__isSmartRef__":true,"id":12682},"user":"soergel","tags":[]},"12682":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12683":{"varMapping":{"__isSmartRef__":true,"id":12684},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12685},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12684":{"this":{"__isSmartRef__":true,"id":3297}},"12685":{"timestamp":{"__isSmartRef__":true,"id":12686},"user":"soergel","tags":[]},"12686":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12687":{"varMapping":{"__isSmartRef__":true,"id":12688},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12689},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12688":{"this":{"__isSmartRef__":true,"id":3297}},"12689":{"timestamp":{"__isSmartRef__":true,"id":12690},"user":"soergel","tags":["debug"]},"12690":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12691":{"varMapping":{"__isSmartRef__":true,"id":12692},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12693},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12692":{"this":{"__isSmartRef__":true,"id":3297}},"12693":{"timestamp":{"__isSmartRef__":true,"id":12694},"user":"soergel","tags":["debug"]},"12694":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12695":{"varMapping":{"__isSmartRef__":true,"id":12696},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12697},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12696":{"this":{"__isSmartRef__":true,"id":3297}},"12697":{"timestamp":{"__isSmartRef__":true,"id":12698},"user":"jan.sandbrink","tags":[]},"12698":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12699":{"varMapping":{"__isSmartRef__":true,"id":12700},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12701},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12700":{"this":{"__isSmartRef__":true,"id":3297}},"12701":{"timestamp":{"__isSmartRef__":true,"id":12702},"user":"jan.sandbrink","tags":[]},"12702":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12703":{"varMapping":{"__isSmartRef__":true,"id":12704},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12705},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12704":{"this":{"__isSmartRef__":true,"id":3297}},"12705":{"timestamp":{"__isSmartRef__":true,"id":12706},"user":"jan.sandbrink","tags":[]},"12706":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12707":{"varMapping":{"__isSmartRef__":true,"id":12708},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12709},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12708":{"this":{"__isSmartRef__":true,"id":3297}},"12709":{"timestamp":{"__isSmartRef__":true,"id":12710},"user":"jan.sandbrink","tags":[]},"12710":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12711":{"varMapping":{"__isSmartRef__":true,"id":12712},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12713},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12712":{"this":{"__isSmartRef__":true,"id":3297}},"12713":{"timestamp":{"__isSmartRef__":true,"id":12714},"user":"jan.sandbrink","tags":[]},"12714":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12715":{"varMapping":{"__isSmartRef__":true,"id":12716},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12717},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12716":{"this":{"__isSmartRef__":true,"id":3297}},"12717":{"timestamp":{"__isSmartRef__":true,"id":12718},"user":"josi","tags":["gemtypes"]},"12718":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12719":{"varMapping":{"__isSmartRef__":true,"id":12720},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12721},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12720":{"this":{"__isSmartRef__":true,"id":3297}},"12721":{"timestamp":{"__isSmartRef__":true,"id":12722},"user":"josi","tags":["gemtypes"]},"12722":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12723":{"varMapping":{"__isSmartRef__":true,"id":12724},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12725},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12724":{"this":{"__isSmartRef__":true,"id":3297}},"12725":{"timestamp":{"__isSmartRef__":true,"id":12726},"user":"soergel","tags":["debug"]},"12726":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12727":{"varMapping":{"__isSmartRef__":true,"id":12728},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12729},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12728":{"this":{"__isSmartRef__":true,"id":3297}},"12729":{"timestamp":{"__isSmartRef__":true,"id":12730},"user":"soergel","tags":["debug"]},"12730":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12731":{"varMapping":{"__isSmartRef__":true,"id":12732},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12733},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12732":{"this":{"__isSmartRef__":true,"id":3297}},"12733":{"timestamp":{"__isSmartRef__":true,"id":12734},"user":"josi","tags":["gemtypes"]},"12734":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12735":{"varMapping":{"__isSmartRef__":true,"id":12736},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12737},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12736":{"this":{"__isSmartRef__":true,"id":3297}},"12737":{"timestamp":{"__isSmartRef__":true,"id":12738},"user":"soergel","tags":[]},"12738":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12739":{"varMapping":{"__isSmartRef__":true,"id":12740},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12741},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12740":{"this":{"__isSmartRef__":true,"id":3297}},"12741":{"timestamp":{"__isSmartRef__":true,"id":12742},"user":"soergel","tags":[]},"12742":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12743":{"varMapping":{"__isSmartRef__":true,"id":12744},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12745},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12744":{"this":{"__isSmartRef__":true,"id":3297}},"12745":{"timestamp":{"__isSmartRef__":true,"id":12746},"user":"soergel","tags":[]},"12746":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12747":{"varMapping":{"__isSmartRef__":true,"id":12748},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12749},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12748":{"this":{"__isSmartRef__":true,"id":3297}},"12749":{"timestamp":{"__isSmartRef__":true,"id":12750},"user":"josi","tags":["gemtypes"]},"12750":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12751":{"varMapping":{"__isSmartRef__":true,"id":12752},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12753},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12752":{"this":{"__isSmartRef__":true,"id":3297}},"12753":{"timestamp":{"__isSmartRef__":true,"id":12754},"user":"josi","tags":["gemtypes"]},"12754":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12755":{"varMapping":{"__isSmartRef__":true,"id":12756},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12757},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12756":{"this":{"__isSmartRef__":true,"id":3297}},"12757":{"timestamp":{"__isSmartRef__":true,"id":12758},"user":"jan.sandbrink","tags":[]},"12758":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12759":{"become":{"__isSmartRef__":true,"id":12760},"onMouseDown":{"__isSmartRef__":true,"id":12764},"updatePicture":{"__isSmartRef__":true,"id":12772},"ruby":{"__isSmartRef__":true,"id":12776},"switchPositionWith":{"__isSmartRef__":true,"id":12780},"addNeighbour":{"__isSmartRef__":true,"id":12784},"amethyst":{"__isSmartRef__":true,"id":12788},"diopside":{"__isSmartRef__":true,"id":12792},"gemTypes":{"__isSmartRef__":true,"id":12796},"becomeRandomGem":{"__isSmartRef__":true,"id":12800},"mark":{"__isSmartRef__":true,"id":12804},"unmark":{"__isSmartRef__":true,"id":12808},"hasNeighbour":{"__isSmartRef__":true,"id":12812},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12816},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12820},"disappear":{"__isSmartRef__":true,"id":12824},"findStreakStart":{"__isSmartRef__":true,"id":12828},"buildStreak":{"__isSmartRef__":true,"id":12832},"scoreStreak":{"__isSmartRef__":true,"id":12836},"tryToStreak":{"__isSmartRef__":true,"id":12840},"blueDiamond":{"__isSmartRef__":true,"id":12844},"prehnite":{"__isSmartRef__":true,"id":12848},"debugUnmark":{"__isSmartRef__":true,"id":12852},"debugMark":{"__isSmartRef__":true,"id":12856},"citrine":{"__isSmartRef__":true,"id":12860},"move":{"__isSmartRef__":true,"id":12864},"performMovement":{"__isSmartRef__":true,"id":12868},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":12872},"zircon":{"__isSmartRef__":true,"id":12876},"emerald":{"__isSmartRef__":true,"id":12880},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":12884}},"12760":{"varMapping":{"__isSmartRef__":true,"id":12761},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12762},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12761":{"this":{"__isSmartRef__":true,"id":3179}},"12762":{"timestamp":{"__isSmartRef__":true,"id":12763},"user":"josi","tags":[]},"12763":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12764":{"varMapping":{"__isSmartRef__":true,"id":12765},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12770},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12765":{"this":{"__isSmartRef__":true,"id":3179},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12766}},"12766":{"$super":{"__isSmartRef__":true,"id":12767}},"12767":{"varMapping":{"__isSmartRef__":true,"id":12768},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12769},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12768":{"obj":{"__isSmartRef__":true,"id":3179},"name":"onMouseDown"},"12769":{},"12770":{"timestamp":{"__isSmartRef__":true,"id":12771},"user":"soergel","tags":[]},"12771":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12772":{"varMapping":{"__isSmartRef__":true,"id":12773},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12774},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12773":{"this":{"__isSmartRef__":true,"id":3179}},"12774":{"timestamp":{"__isSmartRef__":true,"id":12775},"user":"soergel","tags":[]},"12775":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12776":{"varMapping":{"__isSmartRef__":true,"id":12777},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12778},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12777":{"this":{"__isSmartRef__":true,"id":3179}},"12778":{"timestamp":{"__isSmartRef__":true,"id":12779},"user":"josi","tags":["gemtypes"]},"12779":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12780":{"varMapping":{"__isSmartRef__":true,"id":12781},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12782},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12781":{"this":{"__isSmartRef__":true,"id":3179}},"12782":{"timestamp":{"__isSmartRef__":true,"id":12783},"user":"jan.sandbrink","tags":[]},"12783":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12784":{"varMapping":{"__isSmartRef__":true,"id":12785},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12785":{"this":{"__isSmartRef__":true,"id":3179}},"12786":{"timestamp":{"__isSmartRef__":true,"id":12787},"user":"jan.sandbrink","tags":[]},"12787":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12788":{"varMapping":{"__isSmartRef__":true,"id":12789},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12790},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12789":{"this":{"__isSmartRef__":true,"id":3179}},"12790":{"timestamp":{"__isSmartRef__":true,"id":12791},"user":"josi","tags":["gemtypes"]},"12791":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12792":{"varMapping":{"__isSmartRef__":true,"id":12793},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12794},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12793":{"this":{"__isSmartRef__":true,"id":3179}},"12794":{"timestamp":{"__isSmartRef__":true,"id":12795},"user":"josi","tags":["gemtypes"]},"12795":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12796":{"varMapping":{"__isSmartRef__":true,"id":12797},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12798},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12797":{"this":{"__isSmartRef__":true,"id":3179}},"12798":{"timestamp":{"__isSmartRef__":true,"id":12799},"user":"josi","tags":[]},"12799":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12800":{"varMapping":{"__isSmartRef__":true,"id":12801},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12802},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12801":{"this":{"__isSmartRef__":true,"id":3179}},"12802":{"timestamp":{"__isSmartRef__":true,"id":12803},"user":"josi","tags":[]},"12803":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12804":{"varMapping":{"__isSmartRef__":true,"id":12805},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12806},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12805":{"this":{"__isSmartRef__":true,"id":3179}},"12806":{"timestamp":{"__isSmartRef__":true,"id":12807},"user":"soergel","tags":[]},"12807":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12808":{"varMapping":{"__isSmartRef__":true,"id":12809},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12810},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12809":{"this":{"__isSmartRef__":true,"id":3179}},"12810":{"timestamp":{"__isSmartRef__":true,"id":12811},"user":"soergel","tags":[]},"12811":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12812":{"varMapping":{"__isSmartRef__":true,"id":12813},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12814},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12813":{"this":{"__isSmartRef__":true,"id":3179}},"12814":{"timestamp":{"__isSmartRef__":true,"id":12815},"user":"soergel","tags":[]},"12815":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12816":{"varMapping":{"__isSmartRef__":true,"id":12817},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12818},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12817":{"this":{"__isSmartRef__":true,"id":3179}},"12818":{"timestamp":{"__isSmartRef__":true,"id":12819},"user":"soergel","tags":["debug"]},"12819":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12820":{"varMapping":{"__isSmartRef__":true,"id":12821},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12822},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12821":{"this":{"__isSmartRef__":true,"id":3179}},"12822":{"timestamp":{"__isSmartRef__":true,"id":12823},"user":"soergel","tags":["debug"]},"12823":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12824":{"varMapping":{"__isSmartRef__":true,"id":12825},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12826},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12825":{"this":{"__isSmartRef__":true,"id":3179}},"12826":{"timestamp":{"__isSmartRef__":true,"id":12827},"user":"jan.sandbrink","tags":[]},"12827":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12828":{"varMapping":{"__isSmartRef__":true,"id":12829},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12830},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12829":{"this":{"__isSmartRef__":true,"id":3179}},"12830":{"timestamp":{"__isSmartRef__":true,"id":12831},"user":"jan.sandbrink","tags":[]},"12831":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12832":{"varMapping":{"__isSmartRef__":true,"id":12833},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12834},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12833":{"this":{"__isSmartRef__":true,"id":3179}},"12834":{"timestamp":{"__isSmartRef__":true,"id":12835},"user":"jan.sandbrink","tags":[]},"12835":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12836":{"varMapping":{"__isSmartRef__":true,"id":12837},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12838},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12837":{"this":{"__isSmartRef__":true,"id":3179}},"12838":{"timestamp":{"__isSmartRef__":true,"id":12839},"user":"jan.sandbrink","tags":[]},"12839":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12840":{"varMapping":{"__isSmartRef__":true,"id":12841},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12842},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12841":{"this":{"__isSmartRef__":true,"id":3179}},"12842":{"timestamp":{"__isSmartRef__":true,"id":12843},"user":"jan.sandbrink","tags":[]},"12843":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12844":{"varMapping":{"__isSmartRef__":true,"id":12845},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12846},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12845":{"this":{"__isSmartRef__":true,"id":3179}},"12846":{"timestamp":{"__isSmartRef__":true,"id":12847},"user":"josi","tags":["gemtypes"]},"12847":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12848":{"varMapping":{"__isSmartRef__":true,"id":12849},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12850},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12849":{"this":{"__isSmartRef__":true,"id":3179}},"12850":{"timestamp":{"__isSmartRef__":true,"id":12851},"user":"josi","tags":["gemtypes"]},"12851":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12852":{"varMapping":{"__isSmartRef__":true,"id":12853},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12854},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12853":{"this":{"__isSmartRef__":true,"id":3179}},"12854":{"timestamp":{"__isSmartRef__":true,"id":12855},"user":"soergel","tags":["debug"]},"12855":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12856":{"varMapping":{"__isSmartRef__":true,"id":12857},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12858},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12857":{"this":{"__isSmartRef__":true,"id":3179}},"12858":{"timestamp":{"__isSmartRef__":true,"id":12859},"user":"soergel","tags":["debug"]},"12859":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12860":{"varMapping":{"__isSmartRef__":true,"id":12861},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12862},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12861":{"this":{"__isSmartRef__":true,"id":3179}},"12862":{"timestamp":{"__isSmartRef__":true,"id":12863},"user":"josi","tags":["gemtypes"]},"12863":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12864":{"varMapping":{"__isSmartRef__":true,"id":12865},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12866},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12865":{"this":{"__isSmartRef__":true,"id":3179}},"12866":{"timestamp":{"__isSmartRef__":true,"id":12867},"user":"soergel","tags":[]},"12867":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12868":{"varMapping":{"__isSmartRef__":true,"id":12869},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12870},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12869":{"this":{"__isSmartRef__":true,"id":3179}},"12870":{"timestamp":{"__isSmartRef__":true,"id":12871},"user":"soergel","tags":[]},"12871":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"12872":{"varMapping":{"__isSmartRef__":true,"id":12873},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":12874},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12873":{"this":{"__isSmartRef__":true,"id":3179}},"12874":{"timestamp":{"__isSmartRef__":true,"id":12875},"user":"soergel","tags":[]},"12875":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"12876":{"varMapping":{"__isSmartRef__":true,"id":12877},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":12878},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12877":{"this":{"__isSmartRef__":true,"id":3179}},"12878":{"timestamp":{"__isSmartRef__":true,"id":12879},"user":"josi","tags":["gemtypes"]},"12879":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"12880":{"varMapping":{"__isSmartRef__":true,"id":12881},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":12882},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12881":{"this":{"__isSmartRef__":true,"id":3179}},"12882":{"timestamp":{"__isSmartRef__":true,"id":12883},"user":"josi","tags":["gemtypes"]},"12883":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"12884":{"varMapping":{"__isSmartRef__":true,"id":12885},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":12886},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12885":{"this":{"__isSmartRef__":true,"id":3179}},"12886":{"timestamp":{"__isSmartRef__":true,"id":12887},"user":"jan.sandbrink","tags":[]},"12887":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"12888":{"become":{"__isSmartRef__":true,"id":12889},"onMouseDown":{"__isSmartRef__":true,"id":12893},"updatePicture":{"__isSmartRef__":true,"id":12901},"ruby":{"__isSmartRef__":true,"id":12905},"switchPositionWith":{"__isSmartRef__":true,"id":12909},"addNeighbour":{"__isSmartRef__":true,"id":12913},"amethyst":{"__isSmartRef__":true,"id":12917},"diopside":{"__isSmartRef__":true,"id":12921},"gemTypes":{"__isSmartRef__":true,"id":12925},"becomeRandomGem":{"__isSmartRef__":true,"id":12929},"mark":{"__isSmartRef__":true,"id":12933},"unmark":{"__isSmartRef__":true,"id":12937},"hasNeighbour":{"__isSmartRef__":true,"id":12941},"debugMarkNeighbours":{"__isSmartRef__":true,"id":12945},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":12949},"disappear":{"__isSmartRef__":true,"id":12953},"findStreakStart":{"__isSmartRef__":true,"id":12957},"buildStreak":{"__isSmartRef__":true,"id":12961},"scoreStreak":{"__isSmartRef__":true,"id":12965},"tryToStreak":{"__isSmartRef__":true,"id":12969},"blueDiamond":{"__isSmartRef__":true,"id":12973},"prehnite":{"__isSmartRef__":true,"id":12977},"debugUnmark":{"__isSmartRef__":true,"id":12981},"debugMark":{"__isSmartRef__":true,"id":12985},"citrine":{"__isSmartRef__":true,"id":12989},"move":{"__isSmartRef__":true,"id":12993},"performMovement":{"__isSmartRef__":true,"id":12997},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13001},"zircon":{"__isSmartRef__":true,"id":13005},"emerald":{"__isSmartRef__":true,"id":13009},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13013}},"12889":{"varMapping":{"__isSmartRef__":true,"id":12890},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12891},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12890":{"this":{"__isSmartRef__":true,"id":3061}},"12891":{"timestamp":{"__isSmartRef__":true,"id":12892},"user":"josi","tags":[]},"12892":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"12893":{"varMapping":{"__isSmartRef__":true,"id":12894},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":12899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12894":{"this":{"__isSmartRef__":true,"id":3061},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":12895}},"12895":{"$super":{"__isSmartRef__":true,"id":12896}},"12896":{"varMapping":{"__isSmartRef__":true,"id":12897},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":12898},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12897":{"obj":{"__isSmartRef__":true,"id":3061},"name":"onMouseDown"},"12898":{},"12899":{"timestamp":{"__isSmartRef__":true,"id":12900},"user":"soergel","tags":[]},"12900":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"12901":{"varMapping":{"__isSmartRef__":true,"id":12902},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":12903},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12902":{"this":{"__isSmartRef__":true,"id":3061}},"12903":{"timestamp":{"__isSmartRef__":true,"id":12904},"user":"soergel","tags":[]},"12904":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"12905":{"varMapping":{"__isSmartRef__":true,"id":12906},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":12907},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12906":{"this":{"__isSmartRef__":true,"id":3061}},"12907":{"timestamp":{"__isSmartRef__":true,"id":12908},"user":"josi","tags":["gemtypes"]},"12908":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"12909":{"varMapping":{"__isSmartRef__":true,"id":12910},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":12911},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12910":{"this":{"__isSmartRef__":true,"id":3061}},"12911":{"timestamp":{"__isSmartRef__":true,"id":12912},"user":"jan.sandbrink","tags":[]},"12912":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"12913":{"varMapping":{"__isSmartRef__":true,"id":12914},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12915},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12914":{"this":{"__isSmartRef__":true,"id":3061}},"12915":{"timestamp":{"__isSmartRef__":true,"id":12916},"user":"jan.sandbrink","tags":[]},"12916":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"12917":{"varMapping":{"__isSmartRef__":true,"id":12918},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":12919},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12918":{"this":{"__isSmartRef__":true,"id":3061}},"12919":{"timestamp":{"__isSmartRef__":true,"id":12920},"user":"josi","tags":["gemtypes"]},"12920":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"12921":{"varMapping":{"__isSmartRef__":true,"id":12922},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":12923},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12922":{"this":{"__isSmartRef__":true,"id":3061}},"12923":{"timestamp":{"__isSmartRef__":true,"id":12924},"user":"josi","tags":["gemtypes"]},"12924":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"12925":{"varMapping":{"__isSmartRef__":true,"id":12926},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":12927},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12926":{"this":{"__isSmartRef__":true,"id":3061}},"12927":{"timestamp":{"__isSmartRef__":true,"id":12928},"user":"josi","tags":[]},"12928":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"12929":{"varMapping":{"__isSmartRef__":true,"id":12930},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":12931},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12930":{"this":{"__isSmartRef__":true,"id":3061}},"12931":{"timestamp":{"__isSmartRef__":true,"id":12932},"user":"josi","tags":[]},"12932":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"12933":{"varMapping":{"__isSmartRef__":true,"id":12934},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":12935},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12934":{"this":{"__isSmartRef__":true,"id":3061}},"12935":{"timestamp":{"__isSmartRef__":true,"id":12936},"user":"soergel","tags":[]},"12936":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"12937":{"varMapping":{"__isSmartRef__":true,"id":12938},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":12939},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12938":{"this":{"__isSmartRef__":true,"id":3061}},"12939":{"timestamp":{"__isSmartRef__":true,"id":12940},"user":"soergel","tags":[]},"12940":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"12941":{"varMapping":{"__isSmartRef__":true,"id":12942},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":12943},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12942":{"this":{"__isSmartRef__":true,"id":3061}},"12943":{"timestamp":{"__isSmartRef__":true,"id":12944},"user":"soergel","tags":[]},"12944":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"12945":{"varMapping":{"__isSmartRef__":true,"id":12946},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12947},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12946":{"this":{"__isSmartRef__":true,"id":3061}},"12947":{"timestamp":{"__isSmartRef__":true,"id":12948},"user":"soergel","tags":["debug"]},"12948":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"12949":{"varMapping":{"__isSmartRef__":true,"id":12950},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":12951},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12950":{"this":{"__isSmartRef__":true,"id":3061}},"12951":{"timestamp":{"__isSmartRef__":true,"id":12952},"user":"soergel","tags":["debug"]},"12952":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"12953":{"varMapping":{"__isSmartRef__":true,"id":12954},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":12955},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12954":{"this":{"__isSmartRef__":true,"id":3061}},"12955":{"timestamp":{"__isSmartRef__":true,"id":12956},"user":"jan.sandbrink","tags":[]},"12956":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"12957":{"varMapping":{"__isSmartRef__":true,"id":12958},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12959},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12958":{"this":{"__isSmartRef__":true,"id":3061}},"12959":{"timestamp":{"__isSmartRef__":true,"id":12960},"user":"jan.sandbrink","tags":[]},"12960":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"12961":{"varMapping":{"__isSmartRef__":true,"id":12962},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":12963},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12962":{"this":{"__isSmartRef__":true,"id":3061}},"12963":{"timestamp":{"__isSmartRef__":true,"id":12964},"user":"jan.sandbrink","tags":[]},"12964":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"12965":{"varMapping":{"__isSmartRef__":true,"id":12966},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":12967},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12966":{"this":{"__isSmartRef__":true,"id":3061}},"12967":{"timestamp":{"__isSmartRef__":true,"id":12968},"user":"jan.sandbrink","tags":[]},"12968":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"12969":{"varMapping":{"__isSmartRef__":true,"id":12970},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":12971},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12970":{"this":{"__isSmartRef__":true,"id":3061}},"12971":{"timestamp":{"__isSmartRef__":true,"id":12972},"user":"jan.sandbrink","tags":[]},"12972":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"12973":{"varMapping":{"__isSmartRef__":true,"id":12974},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":12975},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12974":{"this":{"__isSmartRef__":true,"id":3061}},"12975":{"timestamp":{"__isSmartRef__":true,"id":12976},"user":"josi","tags":["gemtypes"]},"12976":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"12977":{"varMapping":{"__isSmartRef__":true,"id":12978},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":12979},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12978":{"this":{"__isSmartRef__":true,"id":3061}},"12979":{"timestamp":{"__isSmartRef__":true,"id":12980},"user":"josi","tags":["gemtypes"]},"12980":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"12981":{"varMapping":{"__isSmartRef__":true,"id":12982},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":12983},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12982":{"this":{"__isSmartRef__":true,"id":3061}},"12983":{"timestamp":{"__isSmartRef__":true,"id":12984},"user":"soergel","tags":["debug"]},"12984":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"12985":{"varMapping":{"__isSmartRef__":true,"id":12986},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":12987},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12986":{"this":{"__isSmartRef__":true,"id":3061}},"12987":{"timestamp":{"__isSmartRef__":true,"id":12988},"user":"soergel","tags":["debug"]},"12988":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"12989":{"varMapping":{"__isSmartRef__":true,"id":12990},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":12991},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12990":{"this":{"__isSmartRef__":true,"id":3061}},"12991":{"timestamp":{"__isSmartRef__":true,"id":12992},"user":"josi","tags":["gemtypes"]},"12992":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"12993":{"varMapping":{"__isSmartRef__":true,"id":12994},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":12995},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12994":{"this":{"__isSmartRef__":true,"id":3061}},"12995":{"timestamp":{"__isSmartRef__":true,"id":12996},"user":"soergel","tags":[]},"12996":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"12997":{"varMapping":{"__isSmartRef__":true,"id":12998},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":12999},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"12998":{"this":{"__isSmartRef__":true,"id":3061}},"12999":{"timestamp":{"__isSmartRef__":true,"id":13000},"user":"soergel","tags":[]},"13000":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13001":{"varMapping":{"__isSmartRef__":true,"id":13002},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13003},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13002":{"this":{"__isSmartRef__":true,"id":3061}},"13003":{"timestamp":{"__isSmartRef__":true,"id":13004},"user":"soergel","tags":[]},"13004":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13005":{"varMapping":{"__isSmartRef__":true,"id":13006},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13007},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13006":{"this":{"__isSmartRef__":true,"id":3061}},"13007":{"timestamp":{"__isSmartRef__":true,"id":13008},"user":"josi","tags":["gemtypes"]},"13008":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13009":{"varMapping":{"__isSmartRef__":true,"id":13010},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13011},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13010":{"this":{"__isSmartRef__":true,"id":3061}},"13011":{"timestamp":{"__isSmartRef__":true,"id":13012},"user":"josi","tags":["gemtypes"]},"13012":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13013":{"varMapping":{"__isSmartRef__":true,"id":13014},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13015},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13014":{"this":{"__isSmartRef__":true,"id":3061}},"13015":{"timestamp":{"__isSmartRef__":true,"id":13016},"user":"jan.sandbrink","tags":[]},"13016":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13017":{"become":{"__isSmartRef__":true,"id":13018},"onMouseDown":{"__isSmartRef__":true,"id":13022},"updatePicture":{"__isSmartRef__":true,"id":13030},"ruby":{"__isSmartRef__":true,"id":13034},"switchPositionWith":{"__isSmartRef__":true,"id":13038},"addNeighbour":{"__isSmartRef__":true,"id":13042},"amethyst":{"__isSmartRef__":true,"id":13046},"diopside":{"__isSmartRef__":true,"id":13050},"gemTypes":{"__isSmartRef__":true,"id":13054},"becomeRandomGem":{"__isSmartRef__":true,"id":13058},"mark":{"__isSmartRef__":true,"id":13062},"unmark":{"__isSmartRef__":true,"id":13066},"hasNeighbour":{"__isSmartRef__":true,"id":13070},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13074},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13078},"disappear":{"__isSmartRef__":true,"id":13082},"findStreakStart":{"__isSmartRef__":true,"id":13086},"buildStreak":{"__isSmartRef__":true,"id":13090},"scoreStreak":{"__isSmartRef__":true,"id":13094},"tryToStreak":{"__isSmartRef__":true,"id":13098},"blueDiamond":{"__isSmartRef__":true,"id":13102},"prehnite":{"__isSmartRef__":true,"id":13106},"debugUnmark":{"__isSmartRef__":true,"id":13110},"debugMark":{"__isSmartRef__":true,"id":13114},"citrine":{"__isSmartRef__":true,"id":13118},"move":{"__isSmartRef__":true,"id":13122},"performMovement":{"__isSmartRef__":true,"id":13126},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13130},"zircon":{"__isSmartRef__":true,"id":13134},"emerald":{"__isSmartRef__":true,"id":13138},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13142}},"13018":{"varMapping":{"__isSmartRef__":true,"id":13019},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13020},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13019":{"this":{"__isSmartRef__":true,"id":2943}},"13020":{"timestamp":{"__isSmartRef__":true,"id":13021},"user":"josi","tags":[]},"13021":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13022":{"varMapping":{"__isSmartRef__":true,"id":13023},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13028},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13023":{"this":{"__isSmartRef__":true,"id":2943},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13024}},"13024":{"$super":{"__isSmartRef__":true,"id":13025}},"13025":{"varMapping":{"__isSmartRef__":true,"id":13026},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13027},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13026":{"obj":{"__isSmartRef__":true,"id":2943},"name":"onMouseDown"},"13027":{},"13028":{"timestamp":{"__isSmartRef__":true,"id":13029},"user":"soergel","tags":[]},"13029":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13030":{"varMapping":{"__isSmartRef__":true,"id":13031},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13032},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13031":{"this":{"__isSmartRef__":true,"id":2943}},"13032":{"timestamp":{"__isSmartRef__":true,"id":13033},"user":"soergel","tags":[]},"13033":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13034":{"varMapping":{"__isSmartRef__":true,"id":13035},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13036},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13035":{"this":{"__isSmartRef__":true,"id":2943}},"13036":{"timestamp":{"__isSmartRef__":true,"id":13037},"user":"josi","tags":["gemtypes"]},"13037":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13038":{"varMapping":{"__isSmartRef__":true,"id":13039},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13040},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13039":{"this":{"__isSmartRef__":true,"id":2943}},"13040":{"timestamp":{"__isSmartRef__":true,"id":13041},"user":"jan.sandbrink","tags":[]},"13041":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13042":{"varMapping":{"__isSmartRef__":true,"id":13043},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13044},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13043":{"this":{"__isSmartRef__":true,"id":2943}},"13044":{"timestamp":{"__isSmartRef__":true,"id":13045},"user":"jan.sandbrink","tags":[]},"13045":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13046":{"varMapping":{"__isSmartRef__":true,"id":13047},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13048},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13047":{"this":{"__isSmartRef__":true,"id":2943}},"13048":{"timestamp":{"__isSmartRef__":true,"id":13049},"user":"josi","tags":["gemtypes"]},"13049":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13050":{"varMapping":{"__isSmartRef__":true,"id":13051},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13052},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13051":{"this":{"__isSmartRef__":true,"id":2943}},"13052":{"timestamp":{"__isSmartRef__":true,"id":13053},"user":"josi","tags":["gemtypes"]},"13053":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13054":{"varMapping":{"__isSmartRef__":true,"id":13055},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13056},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13055":{"this":{"__isSmartRef__":true,"id":2943}},"13056":{"timestamp":{"__isSmartRef__":true,"id":13057},"user":"josi","tags":[]},"13057":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13058":{"varMapping":{"__isSmartRef__":true,"id":13059},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13060},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13059":{"this":{"__isSmartRef__":true,"id":2943}},"13060":{"timestamp":{"__isSmartRef__":true,"id":13061},"user":"josi","tags":[]},"13061":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13062":{"varMapping":{"__isSmartRef__":true,"id":13063},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13064},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13063":{"this":{"__isSmartRef__":true,"id":2943}},"13064":{"timestamp":{"__isSmartRef__":true,"id":13065},"user":"soergel","tags":[]},"13065":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13066":{"varMapping":{"__isSmartRef__":true,"id":13067},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13068},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13067":{"this":{"__isSmartRef__":true,"id":2943}},"13068":{"timestamp":{"__isSmartRef__":true,"id":13069},"user":"soergel","tags":[]},"13069":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13070":{"varMapping":{"__isSmartRef__":true,"id":13071},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13072},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13071":{"this":{"__isSmartRef__":true,"id":2943}},"13072":{"timestamp":{"__isSmartRef__":true,"id":13073},"user":"soergel","tags":[]},"13073":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13074":{"varMapping":{"__isSmartRef__":true,"id":13075},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13076},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13075":{"this":{"__isSmartRef__":true,"id":2943}},"13076":{"timestamp":{"__isSmartRef__":true,"id":13077},"user":"soergel","tags":["debug"]},"13077":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13078":{"varMapping":{"__isSmartRef__":true,"id":13079},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13080},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13079":{"this":{"__isSmartRef__":true,"id":2943}},"13080":{"timestamp":{"__isSmartRef__":true,"id":13081},"user":"soergel","tags":["debug"]},"13081":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13082":{"varMapping":{"__isSmartRef__":true,"id":13083},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13084},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13083":{"this":{"__isSmartRef__":true,"id":2943}},"13084":{"timestamp":{"__isSmartRef__":true,"id":13085},"user":"jan.sandbrink","tags":[]},"13085":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13086":{"varMapping":{"__isSmartRef__":true,"id":13087},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13088},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13087":{"this":{"__isSmartRef__":true,"id":2943}},"13088":{"timestamp":{"__isSmartRef__":true,"id":13089},"user":"jan.sandbrink","tags":[]},"13089":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13090":{"varMapping":{"__isSmartRef__":true,"id":13091},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13092},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13091":{"this":{"__isSmartRef__":true,"id":2943}},"13092":{"timestamp":{"__isSmartRef__":true,"id":13093},"user":"jan.sandbrink","tags":[]},"13093":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13094":{"varMapping":{"__isSmartRef__":true,"id":13095},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13096},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13095":{"this":{"__isSmartRef__":true,"id":2943}},"13096":{"timestamp":{"__isSmartRef__":true,"id":13097},"user":"jan.sandbrink","tags":[]},"13097":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13098":{"varMapping":{"__isSmartRef__":true,"id":13099},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13100},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13099":{"this":{"__isSmartRef__":true,"id":2943}},"13100":{"timestamp":{"__isSmartRef__":true,"id":13101},"user":"jan.sandbrink","tags":[]},"13101":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13102":{"varMapping":{"__isSmartRef__":true,"id":13103},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13104},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13103":{"this":{"__isSmartRef__":true,"id":2943}},"13104":{"timestamp":{"__isSmartRef__":true,"id":13105},"user":"josi","tags":["gemtypes"]},"13105":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13106":{"varMapping":{"__isSmartRef__":true,"id":13107},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13108},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13107":{"this":{"__isSmartRef__":true,"id":2943}},"13108":{"timestamp":{"__isSmartRef__":true,"id":13109},"user":"josi","tags":["gemtypes"]},"13109":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13110":{"varMapping":{"__isSmartRef__":true,"id":13111},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13112},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13111":{"this":{"__isSmartRef__":true,"id":2943}},"13112":{"timestamp":{"__isSmartRef__":true,"id":13113},"user":"soergel","tags":["debug"]},"13113":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13114":{"varMapping":{"__isSmartRef__":true,"id":13115},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13116},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13115":{"this":{"__isSmartRef__":true,"id":2943}},"13116":{"timestamp":{"__isSmartRef__":true,"id":13117},"user":"soergel","tags":["debug"]},"13117":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13118":{"varMapping":{"__isSmartRef__":true,"id":13119},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13120},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13119":{"this":{"__isSmartRef__":true,"id":2943}},"13120":{"timestamp":{"__isSmartRef__":true,"id":13121},"user":"josi","tags":["gemtypes"]},"13121":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13122":{"varMapping":{"__isSmartRef__":true,"id":13123},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13124},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13123":{"this":{"__isSmartRef__":true,"id":2943}},"13124":{"timestamp":{"__isSmartRef__":true,"id":13125},"user":"soergel","tags":[]},"13125":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13126":{"varMapping":{"__isSmartRef__":true,"id":13127},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13128},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13127":{"this":{"__isSmartRef__":true,"id":2943}},"13128":{"timestamp":{"__isSmartRef__":true,"id":13129},"user":"soergel","tags":[]},"13129":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13130":{"varMapping":{"__isSmartRef__":true,"id":13131},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13132},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13131":{"this":{"__isSmartRef__":true,"id":2943}},"13132":{"timestamp":{"__isSmartRef__":true,"id":13133},"user":"soergel","tags":[]},"13133":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13134":{"varMapping":{"__isSmartRef__":true,"id":13135},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13136},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13135":{"this":{"__isSmartRef__":true,"id":2943}},"13136":{"timestamp":{"__isSmartRef__":true,"id":13137},"user":"josi","tags":["gemtypes"]},"13137":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13138":{"varMapping":{"__isSmartRef__":true,"id":13139},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13140},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13139":{"this":{"__isSmartRef__":true,"id":2943}},"13140":{"timestamp":{"__isSmartRef__":true,"id":13141},"user":"josi","tags":["gemtypes"]},"13141":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13142":{"varMapping":{"__isSmartRef__":true,"id":13143},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13144},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13143":{"this":{"__isSmartRef__":true,"id":2943}},"13144":{"timestamp":{"__isSmartRef__":true,"id":13145},"user":"jan.sandbrink","tags":[]},"13145":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13146":{"become":{"__isSmartRef__":true,"id":13147},"onMouseDown":{"__isSmartRef__":true,"id":13151},"updatePicture":{"__isSmartRef__":true,"id":13159},"ruby":{"__isSmartRef__":true,"id":13163},"switchPositionWith":{"__isSmartRef__":true,"id":13167},"addNeighbour":{"__isSmartRef__":true,"id":13171},"amethyst":{"__isSmartRef__":true,"id":13175},"diopside":{"__isSmartRef__":true,"id":13179},"gemTypes":{"__isSmartRef__":true,"id":13183},"becomeRandomGem":{"__isSmartRef__":true,"id":13187},"mark":{"__isSmartRef__":true,"id":13191},"unmark":{"__isSmartRef__":true,"id":13195},"hasNeighbour":{"__isSmartRef__":true,"id":13199},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13203},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13207},"disappear":{"__isSmartRef__":true,"id":13211},"findStreakStart":{"__isSmartRef__":true,"id":13215},"buildStreak":{"__isSmartRef__":true,"id":13219},"scoreStreak":{"__isSmartRef__":true,"id":13223},"tryToStreak":{"__isSmartRef__":true,"id":13227},"blueDiamond":{"__isSmartRef__":true,"id":13231},"prehnite":{"__isSmartRef__":true,"id":13235},"debugUnmark":{"__isSmartRef__":true,"id":13239},"debugMark":{"__isSmartRef__":true,"id":13243},"citrine":{"__isSmartRef__":true,"id":13247},"move":{"__isSmartRef__":true,"id":13251},"performMovement":{"__isSmartRef__":true,"id":13255},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13259},"zircon":{"__isSmartRef__":true,"id":13263},"emerald":{"__isSmartRef__":true,"id":13267},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13271}},"13147":{"varMapping":{"__isSmartRef__":true,"id":13148},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13149},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13148":{"this":{"__isSmartRef__":true,"id":2816}},"13149":{"timestamp":{"__isSmartRef__":true,"id":13150},"user":"josi","tags":[]},"13150":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13151":{"varMapping":{"__isSmartRef__":true,"id":13152},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13152":{"this":{"__isSmartRef__":true,"id":2816},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13153}},"13153":{"$super":{"__isSmartRef__":true,"id":13154}},"13154":{"varMapping":{"__isSmartRef__":true,"id":13155},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13156},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13155":{"obj":{"__isSmartRef__":true,"id":2816},"name":"onMouseDown"},"13156":{},"13157":{"timestamp":{"__isSmartRef__":true,"id":13158},"user":"soergel","tags":[]},"13158":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13159":{"varMapping":{"__isSmartRef__":true,"id":13160},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13161},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13160":{"this":{"__isSmartRef__":true,"id":2816}},"13161":{"timestamp":{"__isSmartRef__":true,"id":13162},"user":"soergel","tags":[]},"13162":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13163":{"varMapping":{"__isSmartRef__":true,"id":13164},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13165},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13164":{"this":{"__isSmartRef__":true,"id":2816}},"13165":{"timestamp":{"__isSmartRef__":true,"id":13166},"user":"josi","tags":["gemtypes"]},"13166":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13167":{"varMapping":{"__isSmartRef__":true,"id":13168},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13169},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13168":{"this":{"__isSmartRef__":true,"id":2816}},"13169":{"timestamp":{"__isSmartRef__":true,"id":13170},"user":"jan.sandbrink","tags":[]},"13170":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13171":{"varMapping":{"__isSmartRef__":true,"id":13172},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13172":{"this":{"__isSmartRef__":true,"id":2816}},"13173":{"timestamp":{"__isSmartRef__":true,"id":13174},"user":"jan.sandbrink","tags":[]},"13174":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13175":{"varMapping":{"__isSmartRef__":true,"id":13176},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13177},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13176":{"this":{"__isSmartRef__":true,"id":2816}},"13177":{"timestamp":{"__isSmartRef__":true,"id":13178},"user":"josi","tags":["gemtypes"]},"13178":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13179":{"varMapping":{"__isSmartRef__":true,"id":13180},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13181},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13180":{"this":{"__isSmartRef__":true,"id":2816}},"13181":{"timestamp":{"__isSmartRef__":true,"id":13182},"user":"josi","tags":["gemtypes"]},"13182":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13183":{"varMapping":{"__isSmartRef__":true,"id":13184},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13185},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13184":{"this":{"__isSmartRef__":true,"id":2816}},"13185":{"timestamp":{"__isSmartRef__":true,"id":13186},"user":"josi","tags":[]},"13186":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13187":{"varMapping":{"__isSmartRef__":true,"id":13188},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13189},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13188":{"this":{"__isSmartRef__":true,"id":2816}},"13189":{"timestamp":{"__isSmartRef__":true,"id":13190},"user":"josi","tags":[]},"13190":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13191":{"varMapping":{"__isSmartRef__":true,"id":13192},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13193},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13192":{"this":{"__isSmartRef__":true,"id":2816}},"13193":{"timestamp":{"__isSmartRef__":true,"id":13194},"user":"soergel","tags":[]},"13194":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13195":{"varMapping":{"__isSmartRef__":true,"id":13196},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13197},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13196":{"this":{"__isSmartRef__":true,"id":2816}},"13197":{"timestamp":{"__isSmartRef__":true,"id":13198},"user":"soergel","tags":[]},"13198":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13199":{"varMapping":{"__isSmartRef__":true,"id":13200},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13201},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13200":{"this":{"__isSmartRef__":true,"id":2816}},"13201":{"timestamp":{"__isSmartRef__":true,"id":13202},"user":"soergel","tags":[]},"13202":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13203":{"varMapping":{"__isSmartRef__":true,"id":13204},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13205},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13204":{"this":{"__isSmartRef__":true,"id":2816}},"13205":{"timestamp":{"__isSmartRef__":true,"id":13206},"user":"soergel","tags":["debug"]},"13206":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13207":{"varMapping":{"__isSmartRef__":true,"id":13208},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13209},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13208":{"this":{"__isSmartRef__":true,"id":2816}},"13209":{"timestamp":{"__isSmartRef__":true,"id":13210},"user":"soergel","tags":["debug"]},"13210":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13211":{"varMapping":{"__isSmartRef__":true,"id":13212},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13213},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13212":{"this":{"__isSmartRef__":true,"id":2816}},"13213":{"timestamp":{"__isSmartRef__":true,"id":13214},"user":"jan.sandbrink","tags":[]},"13214":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13215":{"varMapping":{"__isSmartRef__":true,"id":13216},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13217},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13216":{"this":{"__isSmartRef__":true,"id":2816}},"13217":{"timestamp":{"__isSmartRef__":true,"id":13218},"user":"jan.sandbrink","tags":[]},"13218":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13219":{"varMapping":{"__isSmartRef__":true,"id":13220},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13221},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13220":{"this":{"__isSmartRef__":true,"id":2816}},"13221":{"timestamp":{"__isSmartRef__":true,"id":13222},"user":"jan.sandbrink","tags":[]},"13222":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13223":{"varMapping":{"__isSmartRef__":true,"id":13224},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13225},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13224":{"this":{"__isSmartRef__":true,"id":2816}},"13225":{"timestamp":{"__isSmartRef__":true,"id":13226},"user":"jan.sandbrink","tags":[]},"13226":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13227":{"varMapping":{"__isSmartRef__":true,"id":13228},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13229},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13228":{"this":{"__isSmartRef__":true,"id":2816}},"13229":{"timestamp":{"__isSmartRef__":true,"id":13230},"user":"jan.sandbrink","tags":[]},"13230":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13231":{"varMapping":{"__isSmartRef__":true,"id":13232},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13233},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13232":{"this":{"__isSmartRef__":true,"id":2816}},"13233":{"timestamp":{"__isSmartRef__":true,"id":13234},"user":"josi","tags":["gemtypes"]},"13234":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13235":{"varMapping":{"__isSmartRef__":true,"id":13236},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13237},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13236":{"this":{"__isSmartRef__":true,"id":2816}},"13237":{"timestamp":{"__isSmartRef__":true,"id":13238},"user":"josi","tags":["gemtypes"]},"13238":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13239":{"varMapping":{"__isSmartRef__":true,"id":13240},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13241},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13240":{"this":{"__isSmartRef__":true,"id":2816}},"13241":{"timestamp":{"__isSmartRef__":true,"id":13242},"user":"soergel","tags":["debug"]},"13242":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13243":{"varMapping":{"__isSmartRef__":true,"id":13244},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13245},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13244":{"this":{"__isSmartRef__":true,"id":2816}},"13245":{"timestamp":{"__isSmartRef__":true,"id":13246},"user":"soergel","tags":["debug"]},"13246":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13247":{"varMapping":{"__isSmartRef__":true,"id":13248},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13249},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13248":{"this":{"__isSmartRef__":true,"id":2816}},"13249":{"timestamp":{"__isSmartRef__":true,"id":13250},"user":"josi","tags":["gemtypes"]},"13250":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13251":{"varMapping":{"__isSmartRef__":true,"id":13252},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13253},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13252":{"this":{"__isSmartRef__":true,"id":2816}},"13253":{"timestamp":{"__isSmartRef__":true,"id":13254},"user":"soergel","tags":[]},"13254":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13255":{"varMapping":{"__isSmartRef__":true,"id":13256},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13257},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13256":{"this":{"__isSmartRef__":true,"id":2816}},"13257":{"timestamp":{"__isSmartRef__":true,"id":13258},"user":"soergel","tags":[]},"13258":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13259":{"varMapping":{"__isSmartRef__":true,"id":13260},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13261},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13260":{"this":{"__isSmartRef__":true,"id":2816}},"13261":{"timestamp":{"__isSmartRef__":true,"id":13262},"user":"soergel","tags":[]},"13262":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13263":{"varMapping":{"__isSmartRef__":true,"id":13264},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13265},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13264":{"this":{"__isSmartRef__":true,"id":2816}},"13265":{"timestamp":{"__isSmartRef__":true,"id":13266},"user":"josi","tags":["gemtypes"]},"13266":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13267":{"varMapping":{"__isSmartRef__":true,"id":13268},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13269},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13268":{"this":{"__isSmartRef__":true,"id":2816}},"13269":{"timestamp":{"__isSmartRef__":true,"id":13270},"user":"josi","tags":["gemtypes"]},"13270":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13271":{"varMapping":{"__isSmartRef__":true,"id":13272},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13273},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13272":{"this":{"__isSmartRef__":true,"id":2816}},"13273":{"timestamp":{"__isSmartRef__":true,"id":13274},"user":"jan.sandbrink","tags":[]},"13274":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13275":{"become":{"__isSmartRef__":true,"id":13276},"onMouseDown":{"__isSmartRef__":true,"id":13280},"updatePicture":{"__isSmartRef__":true,"id":13288},"ruby":{"__isSmartRef__":true,"id":13292},"switchPositionWith":{"__isSmartRef__":true,"id":13296},"addNeighbour":{"__isSmartRef__":true,"id":13300},"amethyst":{"__isSmartRef__":true,"id":13304},"diopside":{"__isSmartRef__":true,"id":13308},"gemTypes":{"__isSmartRef__":true,"id":13312},"becomeRandomGem":{"__isSmartRef__":true,"id":13316},"mark":{"__isSmartRef__":true,"id":13320},"unmark":{"__isSmartRef__":true,"id":13324},"hasNeighbour":{"__isSmartRef__":true,"id":13328},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13332},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13336},"disappear":{"__isSmartRef__":true,"id":13340},"findStreakStart":{"__isSmartRef__":true,"id":13344},"buildStreak":{"__isSmartRef__":true,"id":13348},"scoreStreak":{"__isSmartRef__":true,"id":13352},"tryToStreak":{"__isSmartRef__":true,"id":13356},"blueDiamond":{"__isSmartRef__":true,"id":13360},"prehnite":{"__isSmartRef__":true,"id":13364},"debugUnmark":{"__isSmartRef__":true,"id":13368},"debugMark":{"__isSmartRef__":true,"id":13372},"citrine":{"__isSmartRef__":true,"id":13376},"move":{"__isSmartRef__":true,"id":13380},"performMovement":{"__isSmartRef__":true,"id":13384},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13388},"zircon":{"__isSmartRef__":true,"id":13392},"emerald":{"__isSmartRef__":true,"id":13396},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13400}},"13276":{"varMapping":{"__isSmartRef__":true,"id":13277},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13278},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13277":{"this":{"__isSmartRef__":true,"id":2681}},"13278":{"timestamp":{"__isSmartRef__":true,"id":13279},"user":"josi","tags":[]},"13279":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13280":{"varMapping":{"__isSmartRef__":true,"id":13281},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13286},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13281":{"this":{"__isSmartRef__":true,"id":2681},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13282}},"13282":{"$super":{"__isSmartRef__":true,"id":13283}},"13283":{"varMapping":{"__isSmartRef__":true,"id":13284},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13285},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13284":{"obj":{"__isSmartRef__":true,"id":2681},"name":"onMouseDown"},"13285":{},"13286":{"timestamp":{"__isSmartRef__":true,"id":13287},"user":"soergel","tags":[]},"13287":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13288":{"varMapping":{"__isSmartRef__":true,"id":13289},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13290},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13289":{"this":{"__isSmartRef__":true,"id":2681}},"13290":{"timestamp":{"__isSmartRef__":true,"id":13291},"user":"soergel","tags":[]},"13291":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13292":{"varMapping":{"__isSmartRef__":true,"id":13293},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13294},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13293":{"this":{"__isSmartRef__":true,"id":2681}},"13294":{"timestamp":{"__isSmartRef__":true,"id":13295},"user":"josi","tags":["gemtypes"]},"13295":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13296":{"varMapping":{"__isSmartRef__":true,"id":13297},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13298},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13297":{"this":{"__isSmartRef__":true,"id":2681}},"13298":{"timestamp":{"__isSmartRef__":true,"id":13299},"user":"jan.sandbrink","tags":[]},"13299":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13300":{"varMapping":{"__isSmartRef__":true,"id":13301},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13302},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13301":{"this":{"__isSmartRef__":true,"id":2681}},"13302":{"timestamp":{"__isSmartRef__":true,"id":13303},"user":"jan.sandbrink","tags":[]},"13303":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13304":{"varMapping":{"__isSmartRef__":true,"id":13305},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13306},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13305":{"this":{"__isSmartRef__":true,"id":2681}},"13306":{"timestamp":{"__isSmartRef__":true,"id":13307},"user":"josi","tags":["gemtypes"]},"13307":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13308":{"varMapping":{"__isSmartRef__":true,"id":13309},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13310},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13309":{"this":{"__isSmartRef__":true,"id":2681}},"13310":{"timestamp":{"__isSmartRef__":true,"id":13311},"user":"josi","tags":["gemtypes"]},"13311":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13312":{"varMapping":{"__isSmartRef__":true,"id":13313},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13314},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13313":{"this":{"__isSmartRef__":true,"id":2681}},"13314":{"timestamp":{"__isSmartRef__":true,"id":13315},"user":"josi","tags":[]},"13315":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13316":{"varMapping":{"__isSmartRef__":true,"id":13317},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13318},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13317":{"this":{"__isSmartRef__":true,"id":2681}},"13318":{"timestamp":{"__isSmartRef__":true,"id":13319},"user":"josi","tags":[]},"13319":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13320":{"varMapping":{"__isSmartRef__":true,"id":13321},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13322},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13321":{"this":{"__isSmartRef__":true,"id":2681}},"13322":{"timestamp":{"__isSmartRef__":true,"id":13323},"user":"soergel","tags":[]},"13323":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13324":{"varMapping":{"__isSmartRef__":true,"id":13325},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13326},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13325":{"this":{"__isSmartRef__":true,"id":2681}},"13326":{"timestamp":{"__isSmartRef__":true,"id":13327},"user":"soergel","tags":[]},"13327":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13328":{"varMapping":{"__isSmartRef__":true,"id":13329},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13330},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13329":{"this":{"__isSmartRef__":true,"id":2681}},"13330":{"timestamp":{"__isSmartRef__":true,"id":13331},"user":"soergel","tags":[]},"13331":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13332":{"varMapping":{"__isSmartRef__":true,"id":13333},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13334},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13333":{"this":{"__isSmartRef__":true,"id":2681}},"13334":{"timestamp":{"__isSmartRef__":true,"id":13335},"user":"soergel","tags":["debug"]},"13335":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13336":{"varMapping":{"__isSmartRef__":true,"id":13337},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13338},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13337":{"this":{"__isSmartRef__":true,"id":2681}},"13338":{"timestamp":{"__isSmartRef__":true,"id":13339},"user":"soergel","tags":["debug"]},"13339":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13340":{"varMapping":{"__isSmartRef__":true,"id":13341},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13342},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13341":{"this":{"__isSmartRef__":true,"id":2681}},"13342":{"timestamp":{"__isSmartRef__":true,"id":13343},"user":"jan.sandbrink","tags":[]},"13343":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13344":{"varMapping":{"__isSmartRef__":true,"id":13345},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13346},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13345":{"this":{"__isSmartRef__":true,"id":2681}},"13346":{"timestamp":{"__isSmartRef__":true,"id":13347},"user":"jan.sandbrink","tags":[]},"13347":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13348":{"varMapping":{"__isSmartRef__":true,"id":13349},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13350},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13349":{"this":{"__isSmartRef__":true,"id":2681}},"13350":{"timestamp":{"__isSmartRef__":true,"id":13351},"user":"jan.sandbrink","tags":[]},"13351":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13352":{"varMapping":{"__isSmartRef__":true,"id":13353},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13354},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13353":{"this":{"__isSmartRef__":true,"id":2681}},"13354":{"timestamp":{"__isSmartRef__":true,"id":13355},"user":"jan.sandbrink","tags":[]},"13355":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13356":{"varMapping":{"__isSmartRef__":true,"id":13357},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13358},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13357":{"this":{"__isSmartRef__":true,"id":2681}},"13358":{"timestamp":{"__isSmartRef__":true,"id":13359},"user":"jan.sandbrink","tags":[]},"13359":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13360":{"varMapping":{"__isSmartRef__":true,"id":13361},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13362},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13361":{"this":{"__isSmartRef__":true,"id":2681}},"13362":{"timestamp":{"__isSmartRef__":true,"id":13363},"user":"josi","tags":["gemtypes"]},"13363":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13364":{"varMapping":{"__isSmartRef__":true,"id":13365},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13366},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13365":{"this":{"__isSmartRef__":true,"id":2681}},"13366":{"timestamp":{"__isSmartRef__":true,"id":13367},"user":"josi","tags":["gemtypes"]},"13367":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13368":{"varMapping":{"__isSmartRef__":true,"id":13369},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13370},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13369":{"this":{"__isSmartRef__":true,"id":2681}},"13370":{"timestamp":{"__isSmartRef__":true,"id":13371},"user":"soergel","tags":["debug"]},"13371":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13372":{"varMapping":{"__isSmartRef__":true,"id":13373},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13374},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13373":{"this":{"__isSmartRef__":true,"id":2681}},"13374":{"timestamp":{"__isSmartRef__":true,"id":13375},"user":"soergel","tags":["debug"]},"13375":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13376":{"varMapping":{"__isSmartRef__":true,"id":13377},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13378},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13377":{"this":{"__isSmartRef__":true,"id":2681}},"13378":{"timestamp":{"__isSmartRef__":true,"id":13379},"user":"josi","tags":["gemtypes"]},"13379":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13380":{"varMapping":{"__isSmartRef__":true,"id":13381},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13382},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13381":{"this":{"__isSmartRef__":true,"id":2681}},"13382":{"timestamp":{"__isSmartRef__":true,"id":13383},"user":"soergel","tags":[]},"13383":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13384":{"varMapping":{"__isSmartRef__":true,"id":13385},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13386},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13385":{"this":{"__isSmartRef__":true,"id":2681}},"13386":{"timestamp":{"__isSmartRef__":true,"id":13387},"user":"soergel","tags":[]},"13387":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13388":{"varMapping":{"__isSmartRef__":true,"id":13389},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13390},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13389":{"this":{"__isSmartRef__":true,"id":2681}},"13390":{"timestamp":{"__isSmartRef__":true,"id":13391},"user":"soergel","tags":[]},"13391":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13392":{"varMapping":{"__isSmartRef__":true,"id":13393},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13394},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13393":{"this":{"__isSmartRef__":true,"id":2681}},"13394":{"timestamp":{"__isSmartRef__":true,"id":13395},"user":"josi","tags":["gemtypes"]},"13395":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13396":{"varMapping":{"__isSmartRef__":true,"id":13397},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13398},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13397":{"this":{"__isSmartRef__":true,"id":2681}},"13398":{"timestamp":{"__isSmartRef__":true,"id":13399},"user":"josi","tags":["gemtypes"]},"13399":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13400":{"varMapping":{"__isSmartRef__":true,"id":13401},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13402},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13401":{"this":{"__isSmartRef__":true,"id":2681}},"13402":{"timestamp":{"__isSmartRef__":true,"id":13403},"user":"jan.sandbrink","tags":[]},"13403":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13404":{"become":{"__isSmartRef__":true,"id":13405},"onMouseDown":{"__isSmartRef__":true,"id":13409},"updatePicture":{"__isSmartRef__":true,"id":13417},"ruby":{"__isSmartRef__":true,"id":13421},"switchPositionWith":{"__isSmartRef__":true,"id":13425},"addNeighbour":{"__isSmartRef__":true,"id":13429},"amethyst":{"__isSmartRef__":true,"id":13433},"diopside":{"__isSmartRef__":true,"id":13437},"gemTypes":{"__isSmartRef__":true,"id":13441},"becomeRandomGem":{"__isSmartRef__":true,"id":13445},"mark":{"__isSmartRef__":true,"id":13449},"unmark":{"__isSmartRef__":true,"id":13453},"hasNeighbour":{"__isSmartRef__":true,"id":13457},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13461},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13465},"disappear":{"__isSmartRef__":true,"id":13469},"findStreakStart":{"__isSmartRef__":true,"id":13473},"buildStreak":{"__isSmartRef__":true,"id":13477},"scoreStreak":{"__isSmartRef__":true,"id":13481},"tryToStreak":{"__isSmartRef__":true,"id":13485},"blueDiamond":{"__isSmartRef__":true,"id":13489},"prehnite":{"__isSmartRef__":true,"id":13493},"debugUnmark":{"__isSmartRef__":true,"id":13497},"debugMark":{"__isSmartRef__":true,"id":13501},"citrine":{"__isSmartRef__":true,"id":13505},"move":{"__isSmartRef__":true,"id":13509},"performMovement":{"__isSmartRef__":true,"id":13513},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13517},"zircon":{"__isSmartRef__":true,"id":13521},"emerald":{"__isSmartRef__":true,"id":13525},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13529}},"13405":{"varMapping":{"__isSmartRef__":true,"id":13406},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13407},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13406":{"this":{"__isSmartRef__":true,"id":2563}},"13407":{"timestamp":{"__isSmartRef__":true,"id":13408},"user":"josi","tags":[]},"13408":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13409":{"varMapping":{"__isSmartRef__":true,"id":13410},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13410":{"this":{"__isSmartRef__":true,"id":2563},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13411}},"13411":{"$super":{"__isSmartRef__":true,"id":13412}},"13412":{"varMapping":{"__isSmartRef__":true,"id":13413},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13414},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13413":{"obj":{"__isSmartRef__":true,"id":2563},"name":"onMouseDown"},"13414":{},"13415":{"timestamp":{"__isSmartRef__":true,"id":13416},"user":"soergel","tags":[]},"13416":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13417":{"varMapping":{"__isSmartRef__":true,"id":13418},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13419},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13418":{"this":{"__isSmartRef__":true,"id":2563}},"13419":{"timestamp":{"__isSmartRef__":true,"id":13420},"user":"soergel","tags":[]},"13420":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13421":{"varMapping":{"__isSmartRef__":true,"id":13422},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13423},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13422":{"this":{"__isSmartRef__":true,"id":2563}},"13423":{"timestamp":{"__isSmartRef__":true,"id":13424},"user":"josi","tags":["gemtypes"]},"13424":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13425":{"varMapping":{"__isSmartRef__":true,"id":13426},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13427},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13426":{"this":{"__isSmartRef__":true,"id":2563}},"13427":{"timestamp":{"__isSmartRef__":true,"id":13428},"user":"jan.sandbrink","tags":[]},"13428":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13429":{"varMapping":{"__isSmartRef__":true,"id":13430},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13431},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13430":{"this":{"__isSmartRef__":true,"id":2563}},"13431":{"timestamp":{"__isSmartRef__":true,"id":13432},"user":"jan.sandbrink","tags":[]},"13432":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13433":{"varMapping":{"__isSmartRef__":true,"id":13434},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13435},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13434":{"this":{"__isSmartRef__":true,"id":2563}},"13435":{"timestamp":{"__isSmartRef__":true,"id":13436},"user":"josi","tags":["gemtypes"]},"13436":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13437":{"varMapping":{"__isSmartRef__":true,"id":13438},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13439},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13438":{"this":{"__isSmartRef__":true,"id":2563}},"13439":{"timestamp":{"__isSmartRef__":true,"id":13440},"user":"josi","tags":["gemtypes"]},"13440":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13441":{"varMapping":{"__isSmartRef__":true,"id":13442},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13443},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13442":{"this":{"__isSmartRef__":true,"id":2563}},"13443":{"timestamp":{"__isSmartRef__":true,"id":13444},"user":"josi","tags":[]},"13444":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13445":{"varMapping":{"__isSmartRef__":true,"id":13446},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13446":{"this":{"__isSmartRef__":true,"id":2563}},"13447":{"timestamp":{"__isSmartRef__":true,"id":13448},"user":"josi","tags":[]},"13448":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13449":{"varMapping":{"__isSmartRef__":true,"id":13450},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13451},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13450":{"this":{"__isSmartRef__":true,"id":2563}},"13451":{"timestamp":{"__isSmartRef__":true,"id":13452},"user":"soergel","tags":[]},"13452":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13453":{"varMapping":{"__isSmartRef__":true,"id":13454},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13455},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13454":{"this":{"__isSmartRef__":true,"id":2563}},"13455":{"timestamp":{"__isSmartRef__":true,"id":13456},"user":"soergel","tags":[]},"13456":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13457":{"varMapping":{"__isSmartRef__":true,"id":13458},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13458":{"this":{"__isSmartRef__":true,"id":2563}},"13459":{"timestamp":{"__isSmartRef__":true,"id":13460},"user":"soergel","tags":[]},"13460":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13461":{"varMapping":{"__isSmartRef__":true,"id":13462},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13463},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13462":{"this":{"__isSmartRef__":true,"id":2563}},"13463":{"timestamp":{"__isSmartRef__":true,"id":13464},"user":"soergel","tags":["debug"]},"13464":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13465":{"varMapping":{"__isSmartRef__":true,"id":13466},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13467},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13466":{"this":{"__isSmartRef__":true,"id":2563}},"13467":{"timestamp":{"__isSmartRef__":true,"id":13468},"user":"soergel","tags":["debug"]},"13468":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13469":{"varMapping":{"__isSmartRef__":true,"id":13470},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13471},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13470":{"this":{"__isSmartRef__":true,"id":2563}},"13471":{"timestamp":{"__isSmartRef__":true,"id":13472},"user":"jan.sandbrink","tags":[]},"13472":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13473":{"varMapping":{"__isSmartRef__":true,"id":13474},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13475},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13474":{"this":{"__isSmartRef__":true,"id":2563}},"13475":{"timestamp":{"__isSmartRef__":true,"id":13476},"user":"jan.sandbrink","tags":[]},"13476":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13477":{"varMapping":{"__isSmartRef__":true,"id":13478},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13478":{"this":{"__isSmartRef__":true,"id":2563}},"13479":{"timestamp":{"__isSmartRef__":true,"id":13480},"user":"jan.sandbrink","tags":[]},"13480":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13481":{"varMapping":{"__isSmartRef__":true,"id":13482},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13483},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13482":{"this":{"__isSmartRef__":true,"id":2563}},"13483":{"timestamp":{"__isSmartRef__":true,"id":13484},"user":"jan.sandbrink","tags":[]},"13484":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13485":{"varMapping":{"__isSmartRef__":true,"id":13486},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13487},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13486":{"this":{"__isSmartRef__":true,"id":2563}},"13487":{"timestamp":{"__isSmartRef__":true,"id":13488},"user":"jan.sandbrink","tags":[]},"13488":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13489":{"varMapping":{"__isSmartRef__":true,"id":13490},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13491},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13490":{"this":{"__isSmartRef__":true,"id":2563}},"13491":{"timestamp":{"__isSmartRef__":true,"id":13492},"user":"josi","tags":["gemtypes"]},"13492":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13493":{"varMapping":{"__isSmartRef__":true,"id":13494},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13495},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13494":{"this":{"__isSmartRef__":true,"id":2563}},"13495":{"timestamp":{"__isSmartRef__":true,"id":13496},"user":"josi","tags":["gemtypes"]},"13496":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13497":{"varMapping":{"__isSmartRef__":true,"id":13498},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13498":{"this":{"__isSmartRef__":true,"id":2563}},"13499":{"timestamp":{"__isSmartRef__":true,"id":13500},"user":"soergel","tags":["debug"]},"13500":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13501":{"varMapping":{"__isSmartRef__":true,"id":13502},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13503},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13502":{"this":{"__isSmartRef__":true,"id":2563}},"13503":{"timestamp":{"__isSmartRef__":true,"id":13504},"user":"soergel","tags":["debug"]},"13504":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13505":{"varMapping":{"__isSmartRef__":true,"id":13506},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13507},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13506":{"this":{"__isSmartRef__":true,"id":2563}},"13507":{"timestamp":{"__isSmartRef__":true,"id":13508},"user":"josi","tags":["gemtypes"]},"13508":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13509":{"varMapping":{"__isSmartRef__":true,"id":13510},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13511},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13510":{"this":{"__isSmartRef__":true,"id":2563}},"13511":{"timestamp":{"__isSmartRef__":true,"id":13512},"user":"soergel","tags":[]},"13512":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13513":{"varMapping":{"__isSmartRef__":true,"id":13514},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13515},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13514":{"this":{"__isSmartRef__":true,"id":2563}},"13515":{"timestamp":{"__isSmartRef__":true,"id":13516},"user":"soergel","tags":[]},"13516":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13517":{"varMapping":{"__isSmartRef__":true,"id":13518},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13519},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13518":{"this":{"__isSmartRef__":true,"id":2563}},"13519":{"timestamp":{"__isSmartRef__":true,"id":13520},"user":"soergel","tags":[]},"13520":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13521":{"varMapping":{"__isSmartRef__":true,"id":13522},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13523},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13522":{"this":{"__isSmartRef__":true,"id":2563}},"13523":{"timestamp":{"__isSmartRef__":true,"id":13524},"user":"josi","tags":["gemtypes"]},"13524":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13525":{"varMapping":{"__isSmartRef__":true,"id":13526},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13527},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13526":{"this":{"__isSmartRef__":true,"id":2563}},"13527":{"timestamp":{"__isSmartRef__":true,"id":13528},"user":"josi","tags":["gemtypes"]},"13528":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13529":{"varMapping":{"__isSmartRef__":true,"id":13530},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13531},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13530":{"this":{"__isSmartRef__":true,"id":2563}},"13531":{"timestamp":{"__isSmartRef__":true,"id":13532},"user":"jan.sandbrink","tags":[]},"13532":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13533":{"become":{"__isSmartRef__":true,"id":13534},"onMouseDown":{"__isSmartRef__":true,"id":13538},"updatePicture":{"__isSmartRef__":true,"id":13546},"ruby":{"__isSmartRef__":true,"id":13550},"switchPositionWith":{"__isSmartRef__":true,"id":13554},"addNeighbour":{"__isSmartRef__":true,"id":13558},"amethyst":{"__isSmartRef__":true,"id":13562},"diopside":{"__isSmartRef__":true,"id":13566},"gemTypes":{"__isSmartRef__":true,"id":13570},"becomeRandomGem":{"__isSmartRef__":true,"id":13574},"mark":{"__isSmartRef__":true,"id":13578},"unmark":{"__isSmartRef__":true,"id":13582},"hasNeighbour":{"__isSmartRef__":true,"id":13586},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13590},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13594},"disappear":{"__isSmartRef__":true,"id":13598},"findStreakStart":{"__isSmartRef__":true,"id":13602},"buildStreak":{"__isSmartRef__":true,"id":13606},"scoreStreak":{"__isSmartRef__":true,"id":13610},"tryToStreak":{"__isSmartRef__":true,"id":13614},"blueDiamond":{"__isSmartRef__":true,"id":13618},"prehnite":{"__isSmartRef__":true,"id":13622},"debugUnmark":{"__isSmartRef__":true,"id":13626},"debugMark":{"__isSmartRef__":true,"id":13630},"citrine":{"__isSmartRef__":true,"id":13634},"move":{"__isSmartRef__":true,"id":13638},"performMovement":{"__isSmartRef__":true,"id":13642},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13646},"zircon":{"__isSmartRef__":true,"id":13650},"emerald":{"__isSmartRef__":true,"id":13654},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13658}},"13534":{"varMapping":{"__isSmartRef__":true,"id":13535},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13536},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13535":{"this":{"__isSmartRef__":true,"id":2445}},"13536":{"timestamp":{"__isSmartRef__":true,"id":13537},"user":"josi","tags":[]},"13537":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13538":{"varMapping":{"__isSmartRef__":true,"id":13539},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13544},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13539":{"this":{"__isSmartRef__":true,"id":2445},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13540}},"13540":{"$super":{"__isSmartRef__":true,"id":13541}},"13541":{"varMapping":{"__isSmartRef__":true,"id":13542},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13543},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13542":{"obj":{"__isSmartRef__":true,"id":2445},"name":"onMouseDown"},"13543":{},"13544":{"timestamp":{"__isSmartRef__":true,"id":13545},"user":"soergel","tags":[]},"13545":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13546":{"varMapping":{"__isSmartRef__":true,"id":13547},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13548},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13547":{"this":{"__isSmartRef__":true,"id":2445}},"13548":{"timestamp":{"__isSmartRef__":true,"id":13549},"user":"soergel","tags":[]},"13549":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13550":{"varMapping":{"__isSmartRef__":true,"id":13551},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13552},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13551":{"this":{"__isSmartRef__":true,"id":2445}},"13552":{"timestamp":{"__isSmartRef__":true,"id":13553},"user":"josi","tags":["gemtypes"]},"13553":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13554":{"varMapping":{"__isSmartRef__":true,"id":13555},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13556},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13555":{"this":{"__isSmartRef__":true,"id":2445}},"13556":{"timestamp":{"__isSmartRef__":true,"id":13557},"user":"jan.sandbrink","tags":[]},"13557":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13558":{"varMapping":{"__isSmartRef__":true,"id":13559},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13560},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13559":{"this":{"__isSmartRef__":true,"id":2445}},"13560":{"timestamp":{"__isSmartRef__":true,"id":13561},"user":"jan.sandbrink","tags":[]},"13561":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13562":{"varMapping":{"__isSmartRef__":true,"id":13563},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13564},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13563":{"this":{"__isSmartRef__":true,"id":2445}},"13564":{"timestamp":{"__isSmartRef__":true,"id":13565},"user":"josi","tags":["gemtypes"]},"13565":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13566":{"varMapping":{"__isSmartRef__":true,"id":13567},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13568},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13567":{"this":{"__isSmartRef__":true,"id":2445}},"13568":{"timestamp":{"__isSmartRef__":true,"id":13569},"user":"josi","tags":["gemtypes"]},"13569":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13570":{"varMapping":{"__isSmartRef__":true,"id":13571},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13572},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13571":{"this":{"__isSmartRef__":true,"id":2445}},"13572":{"timestamp":{"__isSmartRef__":true,"id":13573},"user":"josi","tags":[]},"13573":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13574":{"varMapping":{"__isSmartRef__":true,"id":13575},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13576},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13575":{"this":{"__isSmartRef__":true,"id":2445}},"13576":{"timestamp":{"__isSmartRef__":true,"id":13577},"user":"josi","tags":[]},"13577":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13578":{"varMapping":{"__isSmartRef__":true,"id":13579},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13580},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13579":{"this":{"__isSmartRef__":true,"id":2445}},"13580":{"timestamp":{"__isSmartRef__":true,"id":13581},"user":"soergel","tags":[]},"13581":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13582":{"varMapping":{"__isSmartRef__":true,"id":13583},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13584},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13583":{"this":{"__isSmartRef__":true,"id":2445}},"13584":{"timestamp":{"__isSmartRef__":true,"id":13585},"user":"soergel","tags":[]},"13585":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13586":{"varMapping":{"__isSmartRef__":true,"id":13587},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13588},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13587":{"this":{"__isSmartRef__":true,"id":2445}},"13588":{"timestamp":{"__isSmartRef__":true,"id":13589},"user":"soergel","tags":[]},"13589":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13590":{"varMapping":{"__isSmartRef__":true,"id":13591},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13592},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13591":{"this":{"__isSmartRef__":true,"id":2445}},"13592":{"timestamp":{"__isSmartRef__":true,"id":13593},"user":"soergel","tags":["debug"]},"13593":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13594":{"varMapping":{"__isSmartRef__":true,"id":13595},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13596},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13595":{"this":{"__isSmartRef__":true,"id":2445}},"13596":{"timestamp":{"__isSmartRef__":true,"id":13597},"user":"soergel","tags":["debug"]},"13597":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13598":{"varMapping":{"__isSmartRef__":true,"id":13599},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13600},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13599":{"this":{"__isSmartRef__":true,"id":2445}},"13600":{"timestamp":{"__isSmartRef__":true,"id":13601},"user":"jan.sandbrink","tags":[]},"13601":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13602":{"varMapping":{"__isSmartRef__":true,"id":13603},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13604},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13603":{"this":{"__isSmartRef__":true,"id":2445}},"13604":{"timestamp":{"__isSmartRef__":true,"id":13605},"user":"jan.sandbrink","tags":[]},"13605":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13606":{"varMapping":{"__isSmartRef__":true,"id":13607},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13608},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13607":{"this":{"__isSmartRef__":true,"id":2445}},"13608":{"timestamp":{"__isSmartRef__":true,"id":13609},"user":"jan.sandbrink","tags":[]},"13609":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13610":{"varMapping":{"__isSmartRef__":true,"id":13611},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13612},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13611":{"this":{"__isSmartRef__":true,"id":2445}},"13612":{"timestamp":{"__isSmartRef__":true,"id":13613},"user":"jan.sandbrink","tags":[]},"13613":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13614":{"varMapping":{"__isSmartRef__":true,"id":13615},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13616},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13615":{"this":{"__isSmartRef__":true,"id":2445}},"13616":{"timestamp":{"__isSmartRef__":true,"id":13617},"user":"jan.sandbrink","tags":[]},"13617":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13618":{"varMapping":{"__isSmartRef__":true,"id":13619},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13620},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13619":{"this":{"__isSmartRef__":true,"id":2445}},"13620":{"timestamp":{"__isSmartRef__":true,"id":13621},"user":"josi","tags":["gemtypes"]},"13621":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13622":{"varMapping":{"__isSmartRef__":true,"id":13623},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13624},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13623":{"this":{"__isSmartRef__":true,"id":2445}},"13624":{"timestamp":{"__isSmartRef__":true,"id":13625},"user":"josi","tags":["gemtypes"]},"13625":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13626":{"varMapping":{"__isSmartRef__":true,"id":13627},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13628},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13627":{"this":{"__isSmartRef__":true,"id":2445}},"13628":{"timestamp":{"__isSmartRef__":true,"id":13629},"user":"soergel","tags":["debug"]},"13629":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13630":{"varMapping":{"__isSmartRef__":true,"id":13631},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13632},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13631":{"this":{"__isSmartRef__":true,"id":2445}},"13632":{"timestamp":{"__isSmartRef__":true,"id":13633},"user":"soergel","tags":["debug"]},"13633":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13634":{"varMapping":{"__isSmartRef__":true,"id":13635},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13636},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13635":{"this":{"__isSmartRef__":true,"id":2445}},"13636":{"timestamp":{"__isSmartRef__":true,"id":13637},"user":"josi","tags":["gemtypes"]},"13637":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13638":{"varMapping":{"__isSmartRef__":true,"id":13639},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13640},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13639":{"this":{"__isSmartRef__":true,"id":2445}},"13640":{"timestamp":{"__isSmartRef__":true,"id":13641},"user":"soergel","tags":[]},"13641":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13642":{"varMapping":{"__isSmartRef__":true,"id":13643},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13644},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13643":{"this":{"__isSmartRef__":true,"id":2445}},"13644":{"timestamp":{"__isSmartRef__":true,"id":13645},"user":"soergel","tags":[]},"13645":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13646":{"varMapping":{"__isSmartRef__":true,"id":13647},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13648},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13647":{"this":{"__isSmartRef__":true,"id":2445}},"13648":{"timestamp":{"__isSmartRef__":true,"id":13649},"user":"soergel","tags":[]},"13649":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13650":{"varMapping":{"__isSmartRef__":true,"id":13651},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13652},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13651":{"this":{"__isSmartRef__":true,"id":2445}},"13652":{"timestamp":{"__isSmartRef__":true,"id":13653},"user":"josi","tags":["gemtypes"]},"13653":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13654":{"varMapping":{"__isSmartRef__":true,"id":13655},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13656},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13655":{"this":{"__isSmartRef__":true,"id":2445}},"13656":{"timestamp":{"__isSmartRef__":true,"id":13657},"user":"josi","tags":["gemtypes"]},"13657":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13658":{"varMapping":{"__isSmartRef__":true,"id":13659},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13660},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13659":{"this":{"__isSmartRef__":true,"id":2445}},"13660":{"timestamp":{"__isSmartRef__":true,"id":13661},"user":"jan.sandbrink","tags":[]},"13661":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13662":{"become":{"__isSmartRef__":true,"id":13663},"onMouseDown":{"__isSmartRef__":true,"id":13667},"updatePicture":{"__isSmartRef__":true,"id":13675},"ruby":{"__isSmartRef__":true,"id":13679},"switchPositionWith":{"__isSmartRef__":true,"id":13683},"addNeighbour":{"__isSmartRef__":true,"id":13687},"amethyst":{"__isSmartRef__":true,"id":13691},"diopside":{"__isSmartRef__":true,"id":13695},"gemTypes":{"__isSmartRef__":true,"id":13699},"becomeRandomGem":{"__isSmartRef__":true,"id":13703},"mark":{"__isSmartRef__":true,"id":13707},"unmark":{"__isSmartRef__":true,"id":13711},"hasNeighbour":{"__isSmartRef__":true,"id":13715},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13719},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13723},"disappear":{"__isSmartRef__":true,"id":13727},"findStreakStart":{"__isSmartRef__":true,"id":13731},"buildStreak":{"__isSmartRef__":true,"id":13735},"scoreStreak":{"__isSmartRef__":true,"id":13739},"tryToStreak":{"__isSmartRef__":true,"id":13743},"blueDiamond":{"__isSmartRef__":true,"id":13747},"prehnite":{"__isSmartRef__":true,"id":13751},"debugUnmark":{"__isSmartRef__":true,"id":13755},"debugMark":{"__isSmartRef__":true,"id":13759},"citrine":{"__isSmartRef__":true,"id":13763},"move":{"__isSmartRef__":true,"id":13767},"performMovement":{"__isSmartRef__":true,"id":13771},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13775},"zircon":{"__isSmartRef__":true,"id":13779},"emerald":{"__isSmartRef__":true,"id":13783},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13787}},"13663":{"varMapping":{"__isSmartRef__":true,"id":13664},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13665},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13664":{"this":{"__isSmartRef__":true,"id":2344}},"13665":{"timestamp":{"__isSmartRef__":true,"id":13666},"user":"josi","tags":[]},"13666":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13667":{"varMapping":{"__isSmartRef__":true,"id":13668},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13673},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13668":{"this":{"__isSmartRef__":true,"id":2344},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13669}},"13669":{"$super":{"__isSmartRef__":true,"id":13670}},"13670":{"varMapping":{"__isSmartRef__":true,"id":13671},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13672},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13671":{"obj":{"__isSmartRef__":true,"id":2344},"name":"onMouseDown"},"13672":{},"13673":{"timestamp":{"__isSmartRef__":true,"id":13674},"user":"soergel","tags":[]},"13674":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13675":{"varMapping":{"__isSmartRef__":true,"id":13676},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13677},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13676":{"this":{"__isSmartRef__":true,"id":2344}},"13677":{"timestamp":{"__isSmartRef__":true,"id":13678},"user":"soergel","tags":[]},"13678":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13679":{"varMapping":{"__isSmartRef__":true,"id":13680},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13681},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13680":{"this":{"__isSmartRef__":true,"id":2344}},"13681":{"timestamp":{"__isSmartRef__":true,"id":13682},"user":"josi","tags":["gemtypes"]},"13682":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13683":{"varMapping":{"__isSmartRef__":true,"id":13684},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13685},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13684":{"this":{"__isSmartRef__":true,"id":2344}},"13685":{"timestamp":{"__isSmartRef__":true,"id":13686},"user":"jan.sandbrink","tags":[]},"13686":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13687":{"varMapping":{"__isSmartRef__":true,"id":13688},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13689},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13688":{"this":{"__isSmartRef__":true,"id":2344}},"13689":{"timestamp":{"__isSmartRef__":true,"id":13690},"user":"jan.sandbrink","tags":[]},"13690":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13691":{"varMapping":{"__isSmartRef__":true,"id":13692},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13693},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13692":{"this":{"__isSmartRef__":true,"id":2344}},"13693":{"timestamp":{"__isSmartRef__":true,"id":13694},"user":"josi","tags":["gemtypes"]},"13694":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13695":{"varMapping":{"__isSmartRef__":true,"id":13696},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13697},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13696":{"this":{"__isSmartRef__":true,"id":2344}},"13697":{"timestamp":{"__isSmartRef__":true,"id":13698},"user":"josi","tags":["gemtypes"]},"13698":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13699":{"varMapping":{"__isSmartRef__":true,"id":13700},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13701},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13700":{"this":{"__isSmartRef__":true,"id":2344}},"13701":{"timestamp":{"__isSmartRef__":true,"id":13702},"user":"josi","tags":[]},"13702":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13703":{"varMapping":{"__isSmartRef__":true,"id":13704},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13705},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13704":{"this":{"__isSmartRef__":true,"id":2344}},"13705":{"timestamp":{"__isSmartRef__":true,"id":13706},"user":"josi","tags":[]},"13706":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13707":{"varMapping":{"__isSmartRef__":true,"id":13708},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13709},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13708":{"this":{"__isSmartRef__":true,"id":2344}},"13709":{"timestamp":{"__isSmartRef__":true,"id":13710},"user":"soergel","tags":[]},"13710":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13711":{"varMapping":{"__isSmartRef__":true,"id":13712},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13713},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13712":{"this":{"__isSmartRef__":true,"id":2344}},"13713":{"timestamp":{"__isSmartRef__":true,"id":13714},"user":"soergel","tags":[]},"13714":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13715":{"varMapping":{"__isSmartRef__":true,"id":13716},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13717},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13716":{"this":{"__isSmartRef__":true,"id":2344}},"13717":{"timestamp":{"__isSmartRef__":true,"id":13718},"user":"soergel","tags":[]},"13718":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13719":{"varMapping":{"__isSmartRef__":true,"id":13720},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13721},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13720":{"this":{"__isSmartRef__":true,"id":2344}},"13721":{"timestamp":{"__isSmartRef__":true,"id":13722},"user":"soergel","tags":["debug"]},"13722":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13723":{"varMapping":{"__isSmartRef__":true,"id":13724},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13725},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13724":{"this":{"__isSmartRef__":true,"id":2344}},"13725":{"timestamp":{"__isSmartRef__":true,"id":13726},"user":"soergel","tags":["debug"]},"13726":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13727":{"varMapping":{"__isSmartRef__":true,"id":13728},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13729},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13728":{"this":{"__isSmartRef__":true,"id":2344}},"13729":{"timestamp":{"__isSmartRef__":true,"id":13730},"user":"jan.sandbrink","tags":[]},"13730":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13731":{"varMapping":{"__isSmartRef__":true,"id":13732},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13733},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13732":{"this":{"__isSmartRef__":true,"id":2344}},"13733":{"timestamp":{"__isSmartRef__":true,"id":13734},"user":"jan.sandbrink","tags":[]},"13734":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13735":{"varMapping":{"__isSmartRef__":true,"id":13736},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13737},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13736":{"this":{"__isSmartRef__":true,"id":2344}},"13737":{"timestamp":{"__isSmartRef__":true,"id":13738},"user":"jan.sandbrink","tags":[]},"13738":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13739":{"varMapping":{"__isSmartRef__":true,"id":13740},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13741},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13740":{"this":{"__isSmartRef__":true,"id":2344}},"13741":{"timestamp":{"__isSmartRef__":true,"id":13742},"user":"jan.sandbrink","tags":[]},"13742":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13743":{"varMapping":{"__isSmartRef__":true,"id":13744},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13745},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13744":{"this":{"__isSmartRef__":true,"id":2344}},"13745":{"timestamp":{"__isSmartRef__":true,"id":13746},"user":"jan.sandbrink","tags":[]},"13746":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13747":{"varMapping":{"__isSmartRef__":true,"id":13748},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13749},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13748":{"this":{"__isSmartRef__":true,"id":2344}},"13749":{"timestamp":{"__isSmartRef__":true,"id":13750},"user":"josi","tags":["gemtypes"]},"13750":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13751":{"varMapping":{"__isSmartRef__":true,"id":13752},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13753},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13752":{"this":{"__isSmartRef__":true,"id":2344}},"13753":{"timestamp":{"__isSmartRef__":true,"id":13754},"user":"josi","tags":["gemtypes"]},"13754":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13755":{"varMapping":{"__isSmartRef__":true,"id":13756},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13757},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13756":{"this":{"__isSmartRef__":true,"id":2344}},"13757":{"timestamp":{"__isSmartRef__":true,"id":13758},"user":"soergel","tags":["debug"]},"13758":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13759":{"varMapping":{"__isSmartRef__":true,"id":13760},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13761},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13760":{"this":{"__isSmartRef__":true,"id":2344}},"13761":{"timestamp":{"__isSmartRef__":true,"id":13762},"user":"soergel","tags":["debug"]},"13762":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13763":{"varMapping":{"__isSmartRef__":true,"id":13764},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13765},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13764":{"this":{"__isSmartRef__":true,"id":2344}},"13765":{"timestamp":{"__isSmartRef__":true,"id":13766},"user":"josi","tags":["gemtypes"]},"13766":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13767":{"varMapping":{"__isSmartRef__":true,"id":13768},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13769},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13768":{"this":{"__isSmartRef__":true,"id":2344}},"13769":{"timestamp":{"__isSmartRef__":true,"id":13770},"user":"soergel","tags":[]},"13770":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13771":{"varMapping":{"__isSmartRef__":true,"id":13772},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13773},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13772":{"this":{"__isSmartRef__":true,"id":2344}},"13773":{"timestamp":{"__isSmartRef__":true,"id":13774},"user":"soergel","tags":[]},"13774":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13775":{"varMapping":{"__isSmartRef__":true,"id":13776},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13777},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13776":{"this":{"__isSmartRef__":true,"id":2344}},"13777":{"timestamp":{"__isSmartRef__":true,"id":13778},"user":"soergel","tags":[]},"13778":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13779":{"varMapping":{"__isSmartRef__":true,"id":13780},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13781},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13780":{"this":{"__isSmartRef__":true,"id":2344}},"13781":{"timestamp":{"__isSmartRef__":true,"id":13782},"user":"josi","tags":["gemtypes"]},"13782":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13783":{"varMapping":{"__isSmartRef__":true,"id":13784},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13785},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13784":{"this":{"__isSmartRef__":true,"id":2344}},"13785":{"timestamp":{"__isSmartRef__":true,"id":13786},"user":"josi","tags":["gemtypes"]},"13786":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13787":{"varMapping":{"__isSmartRef__":true,"id":13788},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13789},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13788":{"this":{"__isSmartRef__":true,"id":2344}},"13789":{"timestamp":{"__isSmartRef__":true,"id":13790},"user":"jan.sandbrink","tags":[]},"13790":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13791":{"become":{"__isSmartRef__":true,"id":13792},"onMouseDown":{"__isSmartRef__":true,"id":13796},"updatePicture":{"__isSmartRef__":true,"id":13804},"ruby":{"__isSmartRef__":true,"id":13808},"switchPositionWith":{"__isSmartRef__":true,"id":13812},"addNeighbour":{"__isSmartRef__":true,"id":13816},"amethyst":{"__isSmartRef__":true,"id":13820},"diopside":{"__isSmartRef__":true,"id":13824},"gemTypes":{"__isSmartRef__":true,"id":13828},"becomeRandomGem":{"__isSmartRef__":true,"id":13832},"mark":{"__isSmartRef__":true,"id":13836},"unmark":{"__isSmartRef__":true,"id":13840},"hasNeighbour":{"__isSmartRef__":true,"id":13844},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13848},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13852},"disappear":{"__isSmartRef__":true,"id":13856},"findStreakStart":{"__isSmartRef__":true,"id":13860},"buildStreak":{"__isSmartRef__":true,"id":13864},"scoreStreak":{"__isSmartRef__":true,"id":13868},"tryToStreak":{"__isSmartRef__":true,"id":13872},"blueDiamond":{"__isSmartRef__":true,"id":13876},"prehnite":{"__isSmartRef__":true,"id":13880},"debugUnmark":{"__isSmartRef__":true,"id":13884},"debugMark":{"__isSmartRef__":true,"id":13888},"citrine":{"__isSmartRef__":true,"id":13892},"move":{"__isSmartRef__":true,"id":13896},"performMovement":{"__isSmartRef__":true,"id":13900},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":13904},"zircon":{"__isSmartRef__":true,"id":13908},"emerald":{"__isSmartRef__":true,"id":13912},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":13916}},"13792":{"varMapping":{"__isSmartRef__":true,"id":13793},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13794},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13793":{"this":{"__isSmartRef__":true,"id":2252}},"13794":{"timestamp":{"__isSmartRef__":true,"id":13795},"user":"josi","tags":[]},"13795":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13796":{"varMapping":{"__isSmartRef__":true,"id":13797},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13802},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13797":{"this":{"__isSmartRef__":true,"id":2252},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13798}},"13798":{"$super":{"__isSmartRef__":true,"id":13799}},"13799":{"varMapping":{"__isSmartRef__":true,"id":13800},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13801},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13800":{"obj":{"__isSmartRef__":true,"id":2252},"name":"onMouseDown"},"13801":{},"13802":{"timestamp":{"__isSmartRef__":true,"id":13803},"user":"soergel","tags":[]},"13803":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13804":{"varMapping":{"__isSmartRef__":true,"id":13805},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13806},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13805":{"this":{"__isSmartRef__":true,"id":2252}},"13806":{"timestamp":{"__isSmartRef__":true,"id":13807},"user":"soergel","tags":[]},"13807":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13808":{"varMapping":{"__isSmartRef__":true,"id":13809},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13810},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13809":{"this":{"__isSmartRef__":true,"id":2252}},"13810":{"timestamp":{"__isSmartRef__":true,"id":13811},"user":"josi","tags":["gemtypes"]},"13811":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13812":{"varMapping":{"__isSmartRef__":true,"id":13813},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13814},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13813":{"this":{"__isSmartRef__":true,"id":2252}},"13814":{"timestamp":{"__isSmartRef__":true,"id":13815},"user":"jan.sandbrink","tags":[]},"13815":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13816":{"varMapping":{"__isSmartRef__":true,"id":13817},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13818},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13817":{"this":{"__isSmartRef__":true,"id":2252}},"13818":{"timestamp":{"__isSmartRef__":true,"id":13819},"user":"jan.sandbrink","tags":[]},"13819":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13820":{"varMapping":{"__isSmartRef__":true,"id":13821},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13822},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13821":{"this":{"__isSmartRef__":true,"id":2252}},"13822":{"timestamp":{"__isSmartRef__":true,"id":13823},"user":"josi","tags":["gemtypes"]},"13823":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13824":{"varMapping":{"__isSmartRef__":true,"id":13825},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13826},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13825":{"this":{"__isSmartRef__":true,"id":2252}},"13826":{"timestamp":{"__isSmartRef__":true,"id":13827},"user":"josi","tags":["gemtypes"]},"13827":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13828":{"varMapping":{"__isSmartRef__":true,"id":13829},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13830},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13829":{"this":{"__isSmartRef__":true,"id":2252}},"13830":{"timestamp":{"__isSmartRef__":true,"id":13831},"user":"josi","tags":[]},"13831":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13832":{"varMapping":{"__isSmartRef__":true,"id":13833},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13834},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13833":{"this":{"__isSmartRef__":true,"id":2252}},"13834":{"timestamp":{"__isSmartRef__":true,"id":13835},"user":"josi","tags":[]},"13835":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13836":{"varMapping":{"__isSmartRef__":true,"id":13837},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13838},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13837":{"this":{"__isSmartRef__":true,"id":2252}},"13838":{"timestamp":{"__isSmartRef__":true,"id":13839},"user":"soergel","tags":[]},"13839":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13840":{"varMapping":{"__isSmartRef__":true,"id":13841},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13842},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13841":{"this":{"__isSmartRef__":true,"id":2252}},"13842":{"timestamp":{"__isSmartRef__":true,"id":13843},"user":"soergel","tags":[]},"13843":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13844":{"varMapping":{"__isSmartRef__":true,"id":13845},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13846},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13845":{"this":{"__isSmartRef__":true,"id":2252}},"13846":{"timestamp":{"__isSmartRef__":true,"id":13847},"user":"soergel","tags":[]},"13847":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13848":{"varMapping":{"__isSmartRef__":true,"id":13849},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13850},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13849":{"this":{"__isSmartRef__":true,"id":2252}},"13850":{"timestamp":{"__isSmartRef__":true,"id":13851},"user":"soergel","tags":["debug"]},"13851":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13852":{"varMapping":{"__isSmartRef__":true,"id":13853},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13854},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13853":{"this":{"__isSmartRef__":true,"id":2252}},"13854":{"timestamp":{"__isSmartRef__":true,"id":13855},"user":"soergel","tags":["debug"]},"13855":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13856":{"varMapping":{"__isSmartRef__":true,"id":13857},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13858},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13857":{"this":{"__isSmartRef__":true,"id":2252}},"13858":{"timestamp":{"__isSmartRef__":true,"id":13859},"user":"jan.sandbrink","tags":[]},"13859":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13860":{"varMapping":{"__isSmartRef__":true,"id":13861},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13862},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13861":{"this":{"__isSmartRef__":true,"id":2252}},"13862":{"timestamp":{"__isSmartRef__":true,"id":13863},"user":"jan.sandbrink","tags":[]},"13863":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13864":{"varMapping":{"__isSmartRef__":true,"id":13865},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13866},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13865":{"this":{"__isSmartRef__":true,"id":2252}},"13866":{"timestamp":{"__isSmartRef__":true,"id":13867},"user":"jan.sandbrink","tags":[]},"13867":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13868":{"varMapping":{"__isSmartRef__":true,"id":13869},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13870},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13869":{"this":{"__isSmartRef__":true,"id":2252}},"13870":{"timestamp":{"__isSmartRef__":true,"id":13871},"user":"jan.sandbrink","tags":[]},"13871":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"13872":{"varMapping":{"__isSmartRef__":true,"id":13873},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":13874},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13873":{"this":{"__isSmartRef__":true,"id":2252}},"13874":{"timestamp":{"__isSmartRef__":true,"id":13875},"user":"jan.sandbrink","tags":[]},"13875":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"13876":{"varMapping":{"__isSmartRef__":true,"id":13877},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":13878},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13877":{"this":{"__isSmartRef__":true,"id":2252}},"13878":{"timestamp":{"__isSmartRef__":true,"id":13879},"user":"josi","tags":["gemtypes"]},"13879":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"13880":{"varMapping":{"__isSmartRef__":true,"id":13881},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":13882},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13881":{"this":{"__isSmartRef__":true,"id":2252}},"13882":{"timestamp":{"__isSmartRef__":true,"id":13883},"user":"josi","tags":["gemtypes"]},"13883":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"13884":{"varMapping":{"__isSmartRef__":true,"id":13885},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":13886},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13885":{"this":{"__isSmartRef__":true,"id":2252}},"13886":{"timestamp":{"__isSmartRef__":true,"id":13887},"user":"soergel","tags":["debug"]},"13887":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"13888":{"varMapping":{"__isSmartRef__":true,"id":13889},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":13890},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13889":{"this":{"__isSmartRef__":true,"id":2252}},"13890":{"timestamp":{"__isSmartRef__":true,"id":13891},"user":"soergel","tags":["debug"]},"13891":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"13892":{"varMapping":{"__isSmartRef__":true,"id":13893},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":13894},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13893":{"this":{"__isSmartRef__":true,"id":2252}},"13894":{"timestamp":{"__isSmartRef__":true,"id":13895},"user":"josi","tags":["gemtypes"]},"13895":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"13896":{"varMapping":{"__isSmartRef__":true,"id":13897},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":13898},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13897":{"this":{"__isSmartRef__":true,"id":2252}},"13898":{"timestamp":{"__isSmartRef__":true,"id":13899},"user":"soergel","tags":[]},"13899":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"13900":{"varMapping":{"__isSmartRef__":true,"id":13901},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":13902},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13901":{"this":{"__isSmartRef__":true,"id":2252}},"13902":{"timestamp":{"__isSmartRef__":true,"id":13903},"user":"soergel","tags":[]},"13903":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"13904":{"varMapping":{"__isSmartRef__":true,"id":13905},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":13906},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13905":{"this":{"__isSmartRef__":true,"id":2252}},"13906":{"timestamp":{"__isSmartRef__":true,"id":13907},"user":"soergel","tags":[]},"13907":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"13908":{"varMapping":{"__isSmartRef__":true,"id":13909},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":13910},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13909":{"this":{"__isSmartRef__":true,"id":2252}},"13910":{"timestamp":{"__isSmartRef__":true,"id":13911},"user":"josi","tags":["gemtypes"]},"13911":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"13912":{"varMapping":{"__isSmartRef__":true,"id":13913},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":13914},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13913":{"this":{"__isSmartRef__":true,"id":2252}},"13914":{"timestamp":{"__isSmartRef__":true,"id":13915},"user":"josi","tags":["gemtypes"]},"13915":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"13916":{"varMapping":{"__isSmartRef__":true,"id":13917},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":13918},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13917":{"this":{"__isSmartRef__":true,"id":2252}},"13918":{"timestamp":{"__isSmartRef__":true,"id":13919},"user":"jan.sandbrink","tags":[]},"13919":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"13920":{"become":{"__isSmartRef__":true,"id":13921},"onMouseDown":{"__isSmartRef__":true,"id":13925},"updatePicture":{"__isSmartRef__":true,"id":13933},"ruby":{"__isSmartRef__":true,"id":13937},"switchPositionWith":{"__isSmartRef__":true,"id":13941},"addNeighbour":{"__isSmartRef__":true,"id":13945},"amethyst":{"__isSmartRef__":true,"id":13949},"diopside":{"__isSmartRef__":true,"id":13953},"gemTypes":{"__isSmartRef__":true,"id":13957},"becomeRandomGem":{"__isSmartRef__":true,"id":13961},"mark":{"__isSmartRef__":true,"id":13965},"unmark":{"__isSmartRef__":true,"id":13969},"hasNeighbour":{"__isSmartRef__":true,"id":13973},"debugMarkNeighbours":{"__isSmartRef__":true,"id":13977},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":13981},"disappear":{"__isSmartRef__":true,"id":13985},"findStreakStart":{"__isSmartRef__":true,"id":13989},"buildStreak":{"__isSmartRef__":true,"id":13993},"scoreStreak":{"__isSmartRef__":true,"id":13997},"tryToStreak":{"__isSmartRef__":true,"id":14001},"blueDiamond":{"__isSmartRef__":true,"id":14005},"prehnite":{"__isSmartRef__":true,"id":14009},"debugUnmark":{"__isSmartRef__":true,"id":14013},"debugMark":{"__isSmartRef__":true,"id":14017},"citrine":{"__isSmartRef__":true,"id":14021},"move":{"__isSmartRef__":true,"id":14025},"performMovement":{"__isSmartRef__":true,"id":14029},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14033},"zircon":{"__isSmartRef__":true,"id":14037},"emerald":{"__isSmartRef__":true,"id":14041},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14045}},"13921":{"varMapping":{"__isSmartRef__":true,"id":13922},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13923},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13922":{"this":{"__isSmartRef__":true,"id":2120}},"13923":{"timestamp":{"__isSmartRef__":true,"id":13924},"user":"josi","tags":[]},"13924":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"13925":{"varMapping":{"__isSmartRef__":true,"id":13926},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":13931},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13926":{"this":{"__isSmartRef__":true,"id":2120},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":13927}},"13927":{"$super":{"__isSmartRef__":true,"id":13928}},"13928":{"varMapping":{"__isSmartRef__":true,"id":13929},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":13930},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13929":{"obj":{"__isSmartRef__":true,"id":2120},"name":"onMouseDown"},"13930":{},"13931":{"timestamp":{"__isSmartRef__":true,"id":13932},"user":"soergel","tags":[]},"13932":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"13933":{"varMapping":{"__isSmartRef__":true,"id":13934},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":13935},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13934":{"this":{"__isSmartRef__":true,"id":2120}},"13935":{"timestamp":{"__isSmartRef__":true,"id":13936},"user":"soergel","tags":[]},"13936":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"13937":{"varMapping":{"__isSmartRef__":true,"id":13938},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":13939},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13938":{"this":{"__isSmartRef__":true,"id":2120}},"13939":{"timestamp":{"__isSmartRef__":true,"id":13940},"user":"josi","tags":["gemtypes"]},"13940":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"13941":{"varMapping":{"__isSmartRef__":true,"id":13942},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":13943},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13942":{"this":{"__isSmartRef__":true,"id":2120}},"13943":{"timestamp":{"__isSmartRef__":true,"id":13944},"user":"jan.sandbrink","tags":[]},"13944":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"13945":{"varMapping":{"__isSmartRef__":true,"id":13946},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13947},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13946":{"this":{"__isSmartRef__":true,"id":2120}},"13947":{"timestamp":{"__isSmartRef__":true,"id":13948},"user":"jan.sandbrink","tags":[]},"13948":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"13949":{"varMapping":{"__isSmartRef__":true,"id":13950},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":13951},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13950":{"this":{"__isSmartRef__":true,"id":2120}},"13951":{"timestamp":{"__isSmartRef__":true,"id":13952},"user":"josi","tags":["gemtypes"]},"13952":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"13953":{"varMapping":{"__isSmartRef__":true,"id":13954},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":13955},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13954":{"this":{"__isSmartRef__":true,"id":2120}},"13955":{"timestamp":{"__isSmartRef__":true,"id":13956},"user":"josi","tags":["gemtypes"]},"13956":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"13957":{"varMapping":{"__isSmartRef__":true,"id":13958},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":13959},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13958":{"this":{"__isSmartRef__":true,"id":2120}},"13959":{"timestamp":{"__isSmartRef__":true,"id":13960},"user":"josi","tags":[]},"13960":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"13961":{"varMapping":{"__isSmartRef__":true,"id":13962},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":13963},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13962":{"this":{"__isSmartRef__":true,"id":2120}},"13963":{"timestamp":{"__isSmartRef__":true,"id":13964},"user":"josi","tags":[]},"13964":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"13965":{"varMapping":{"__isSmartRef__":true,"id":13966},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":13967},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13966":{"this":{"__isSmartRef__":true,"id":2120}},"13967":{"timestamp":{"__isSmartRef__":true,"id":13968},"user":"soergel","tags":[]},"13968":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"13969":{"varMapping":{"__isSmartRef__":true,"id":13970},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":13971},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13970":{"this":{"__isSmartRef__":true,"id":2120}},"13971":{"timestamp":{"__isSmartRef__":true,"id":13972},"user":"soergel","tags":[]},"13972":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"13973":{"varMapping":{"__isSmartRef__":true,"id":13974},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":13975},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13974":{"this":{"__isSmartRef__":true,"id":2120}},"13975":{"timestamp":{"__isSmartRef__":true,"id":13976},"user":"soergel","tags":[]},"13976":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"13977":{"varMapping":{"__isSmartRef__":true,"id":13978},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13979},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13978":{"this":{"__isSmartRef__":true,"id":2120}},"13979":{"timestamp":{"__isSmartRef__":true,"id":13980},"user":"soergel","tags":["debug"]},"13980":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"13981":{"varMapping":{"__isSmartRef__":true,"id":13982},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":13983},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13982":{"this":{"__isSmartRef__":true,"id":2120}},"13983":{"timestamp":{"__isSmartRef__":true,"id":13984},"user":"soergel","tags":["debug"]},"13984":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"13985":{"varMapping":{"__isSmartRef__":true,"id":13986},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":13987},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13986":{"this":{"__isSmartRef__":true,"id":2120}},"13987":{"timestamp":{"__isSmartRef__":true,"id":13988},"user":"jan.sandbrink","tags":[]},"13988":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"13989":{"varMapping":{"__isSmartRef__":true,"id":13990},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13991},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13990":{"this":{"__isSmartRef__":true,"id":2120}},"13991":{"timestamp":{"__isSmartRef__":true,"id":13992},"user":"jan.sandbrink","tags":[]},"13992":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"13993":{"varMapping":{"__isSmartRef__":true,"id":13994},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":13995},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13994":{"this":{"__isSmartRef__":true,"id":2120}},"13995":{"timestamp":{"__isSmartRef__":true,"id":13996},"user":"jan.sandbrink","tags":[]},"13996":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"13997":{"varMapping":{"__isSmartRef__":true,"id":13998},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":13999},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"13998":{"this":{"__isSmartRef__":true,"id":2120}},"13999":{"timestamp":{"__isSmartRef__":true,"id":14000},"user":"jan.sandbrink","tags":[]},"14000":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14001":{"varMapping":{"__isSmartRef__":true,"id":14002},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14003},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14002":{"this":{"__isSmartRef__":true,"id":2120}},"14003":{"timestamp":{"__isSmartRef__":true,"id":14004},"user":"jan.sandbrink","tags":[]},"14004":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14005":{"varMapping":{"__isSmartRef__":true,"id":14006},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14007},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14006":{"this":{"__isSmartRef__":true,"id":2120}},"14007":{"timestamp":{"__isSmartRef__":true,"id":14008},"user":"josi","tags":["gemtypes"]},"14008":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14009":{"varMapping":{"__isSmartRef__":true,"id":14010},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14011},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14010":{"this":{"__isSmartRef__":true,"id":2120}},"14011":{"timestamp":{"__isSmartRef__":true,"id":14012},"user":"josi","tags":["gemtypes"]},"14012":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14013":{"varMapping":{"__isSmartRef__":true,"id":14014},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14015},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14014":{"this":{"__isSmartRef__":true,"id":2120}},"14015":{"timestamp":{"__isSmartRef__":true,"id":14016},"user":"soergel","tags":["debug"]},"14016":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14017":{"varMapping":{"__isSmartRef__":true,"id":14018},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14019},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14018":{"this":{"__isSmartRef__":true,"id":2120}},"14019":{"timestamp":{"__isSmartRef__":true,"id":14020},"user":"soergel","tags":["debug"]},"14020":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14021":{"varMapping":{"__isSmartRef__":true,"id":14022},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14023},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14022":{"this":{"__isSmartRef__":true,"id":2120}},"14023":{"timestamp":{"__isSmartRef__":true,"id":14024},"user":"josi","tags":["gemtypes"]},"14024":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14025":{"varMapping":{"__isSmartRef__":true,"id":14026},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14027},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14026":{"this":{"__isSmartRef__":true,"id":2120}},"14027":{"timestamp":{"__isSmartRef__":true,"id":14028},"user":"soergel","tags":[]},"14028":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14029":{"varMapping":{"__isSmartRef__":true,"id":14030},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14031},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14030":{"this":{"__isSmartRef__":true,"id":2120}},"14031":{"timestamp":{"__isSmartRef__":true,"id":14032},"user":"soergel","tags":[]},"14032":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14033":{"varMapping":{"__isSmartRef__":true,"id":14034},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14035},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14034":{"this":{"__isSmartRef__":true,"id":2120}},"14035":{"timestamp":{"__isSmartRef__":true,"id":14036},"user":"soergel","tags":[]},"14036":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14037":{"varMapping":{"__isSmartRef__":true,"id":14038},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14039},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14038":{"this":{"__isSmartRef__":true,"id":2120}},"14039":{"timestamp":{"__isSmartRef__":true,"id":14040},"user":"josi","tags":["gemtypes"]},"14040":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14041":{"varMapping":{"__isSmartRef__":true,"id":14042},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14043},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14042":{"this":{"__isSmartRef__":true,"id":2120}},"14043":{"timestamp":{"__isSmartRef__":true,"id":14044},"user":"josi","tags":["gemtypes"]},"14044":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14045":{"varMapping":{"__isSmartRef__":true,"id":14046},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14047},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14046":{"this":{"__isSmartRef__":true,"id":2120}},"14047":{"timestamp":{"__isSmartRef__":true,"id":14048},"user":"jan.sandbrink","tags":[]},"14048":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14049":{"become":{"__isSmartRef__":true,"id":14050},"onMouseDown":{"__isSmartRef__":true,"id":14054},"updatePicture":{"__isSmartRef__":true,"id":14062},"ruby":{"__isSmartRef__":true,"id":14066},"switchPositionWith":{"__isSmartRef__":true,"id":14070},"addNeighbour":{"__isSmartRef__":true,"id":14074},"amethyst":{"__isSmartRef__":true,"id":14078},"diopside":{"__isSmartRef__":true,"id":14082},"gemTypes":{"__isSmartRef__":true,"id":14086},"becomeRandomGem":{"__isSmartRef__":true,"id":14090},"mark":{"__isSmartRef__":true,"id":14094},"unmark":{"__isSmartRef__":true,"id":14098},"hasNeighbour":{"__isSmartRef__":true,"id":14102},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14106},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14110},"disappear":{"__isSmartRef__":true,"id":14114},"findStreakStart":{"__isSmartRef__":true,"id":14118},"buildStreak":{"__isSmartRef__":true,"id":14122},"scoreStreak":{"__isSmartRef__":true,"id":14126},"tryToStreak":{"__isSmartRef__":true,"id":14130},"blueDiamond":{"__isSmartRef__":true,"id":14134},"prehnite":{"__isSmartRef__":true,"id":14138},"debugUnmark":{"__isSmartRef__":true,"id":14142},"debugMark":{"__isSmartRef__":true,"id":14146},"citrine":{"__isSmartRef__":true,"id":14150},"move":{"__isSmartRef__":true,"id":14154},"performMovement":{"__isSmartRef__":true,"id":14158},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14162},"zircon":{"__isSmartRef__":true,"id":14166},"emerald":{"__isSmartRef__":true,"id":14170},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14174}},"14050":{"varMapping":{"__isSmartRef__":true,"id":14051},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14052},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14051":{"this":{"__isSmartRef__":true,"id":1993}},"14052":{"timestamp":{"__isSmartRef__":true,"id":14053},"user":"josi","tags":[]},"14053":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14054":{"varMapping":{"__isSmartRef__":true,"id":14055},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14060},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14055":{"this":{"__isSmartRef__":true,"id":1993},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14056}},"14056":{"$super":{"__isSmartRef__":true,"id":14057}},"14057":{"varMapping":{"__isSmartRef__":true,"id":14058},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14059},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14058":{"obj":{"__isSmartRef__":true,"id":1993},"name":"onMouseDown"},"14059":{},"14060":{"timestamp":{"__isSmartRef__":true,"id":14061},"user":"soergel","tags":[]},"14061":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14062":{"varMapping":{"__isSmartRef__":true,"id":14063},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14064},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14063":{"this":{"__isSmartRef__":true,"id":1993}},"14064":{"timestamp":{"__isSmartRef__":true,"id":14065},"user":"soergel","tags":[]},"14065":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14066":{"varMapping":{"__isSmartRef__":true,"id":14067},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14068},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14067":{"this":{"__isSmartRef__":true,"id":1993}},"14068":{"timestamp":{"__isSmartRef__":true,"id":14069},"user":"josi","tags":["gemtypes"]},"14069":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14070":{"varMapping":{"__isSmartRef__":true,"id":14071},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14072},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14071":{"this":{"__isSmartRef__":true,"id":1993}},"14072":{"timestamp":{"__isSmartRef__":true,"id":14073},"user":"jan.sandbrink","tags":[]},"14073":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14074":{"varMapping":{"__isSmartRef__":true,"id":14075},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14076},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14075":{"this":{"__isSmartRef__":true,"id":1993}},"14076":{"timestamp":{"__isSmartRef__":true,"id":14077},"user":"jan.sandbrink","tags":[]},"14077":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14078":{"varMapping":{"__isSmartRef__":true,"id":14079},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14080},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14079":{"this":{"__isSmartRef__":true,"id":1993}},"14080":{"timestamp":{"__isSmartRef__":true,"id":14081},"user":"josi","tags":["gemtypes"]},"14081":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14082":{"varMapping":{"__isSmartRef__":true,"id":14083},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14084},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14083":{"this":{"__isSmartRef__":true,"id":1993}},"14084":{"timestamp":{"__isSmartRef__":true,"id":14085},"user":"josi","tags":["gemtypes"]},"14085":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14086":{"varMapping":{"__isSmartRef__":true,"id":14087},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14088},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14087":{"this":{"__isSmartRef__":true,"id":1993}},"14088":{"timestamp":{"__isSmartRef__":true,"id":14089},"user":"josi","tags":[]},"14089":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14090":{"varMapping":{"__isSmartRef__":true,"id":14091},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14092},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14091":{"this":{"__isSmartRef__":true,"id":1993}},"14092":{"timestamp":{"__isSmartRef__":true,"id":14093},"user":"josi","tags":[]},"14093":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14094":{"varMapping":{"__isSmartRef__":true,"id":14095},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14096},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14095":{"this":{"__isSmartRef__":true,"id":1993}},"14096":{"timestamp":{"__isSmartRef__":true,"id":14097},"user":"soergel","tags":[]},"14097":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14098":{"varMapping":{"__isSmartRef__":true,"id":14099},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14100},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14099":{"this":{"__isSmartRef__":true,"id":1993}},"14100":{"timestamp":{"__isSmartRef__":true,"id":14101},"user":"soergel","tags":[]},"14101":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14102":{"varMapping":{"__isSmartRef__":true,"id":14103},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14104},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14103":{"this":{"__isSmartRef__":true,"id":1993}},"14104":{"timestamp":{"__isSmartRef__":true,"id":14105},"user":"soergel","tags":[]},"14105":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14106":{"varMapping":{"__isSmartRef__":true,"id":14107},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14108},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14107":{"this":{"__isSmartRef__":true,"id":1993}},"14108":{"timestamp":{"__isSmartRef__":true,"id":14109},"user":"soergel","tags":["debug"]},"14109":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14110":{"varMapping":{"__isSmartRef__":true,"id":14111},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14112},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14111":{"this":{"__isSmartRef__":true,"id":1993}},"14112":{"timestamp":{"__isSmartRef__":true,"id":14113},"user":"soergel","tags":["debug"]},"14113":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14114":{"varMapping":{"__isSmartRef__":true,"id":14115},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14116},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14115":{"this":{"__isSmartRef__":true,"id":1993}},"14116":{"timestamp":{"__isSmartRef__":true,"id":14117},"user":"jan.sandbrink","tags":[]},"14117":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14118":{"varMapping":{"__isSmartRef__":true,"id":14119},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14120},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14119":{"this":{"__isSmartRef__":true,"id":1993}},"14120":{"timestamp":{"__isSmartRef__":true,"id":14121},"user":"jan.sandbrink","tags":[]},"14121":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14122":{"varMapping":{"__isSmartRef__":true,"id":14123},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14124},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14123":{"this":{"__isSmartRef__":true,"id":1993}},"14124":{"timestamp":{"__isSmartRef__":true,"id":14125},"user":"jan.sandbrink","tags":[]},"14125":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14126":{"varMapping":{"__isSmartRef__":true,"id":14127},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14128},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14127":{"this":{"__isSmartRef__":true,"id":1993}},"14128":{"timestamp":{"__isSmartRef__":true,"id":14129},"user":"jan.sandbrink","tags":[]},"14129":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14130":{"varMapping":{"__isSmartRef__":true,"id":14131},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14132},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14131":{"this":{"__isSmartRef__":true,"id":1993}},"14132":{"timestamp":{"__isSmartRef__":true,"id":14133},"user":"jan.sandbrink","tags":[]},"14133":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14134":{"varMapping":{"__isSmartRef__":true,"id":14135},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14136},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14135":{"this":{"__isSmartRef__":true,"id":1993}},"14136":{"timestamp":{"__isSmartRef__":true,"id":14137},"user":"josi","tags":["gemtypes"]},"14137":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14138":{"varMapping":{"__isSmartRef__":true,"id":14139},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14140},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14139":{"this":{"__isSmartRef__":true,"id":1993}},"14140":{"timestamp":{"__isSmartRef__":true,"id":14141},"user":"josi","tags":["gemtypes"]},"14141":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14142":{"varMapping":{"__isSmartRef__":true,"id":14143},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14144},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14143":{"this":{"__isSmartRef__":true,"id":1993}},"14144":{"timestamp":{"__isSmartRef__":true,"id":14145},"user":"soergel","tags":["debug"]},"14145":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14146":{"varMapping":{"__isSmartRef__":true,"id":14147},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14148},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14147":{"this":{"__isSmartRef__":true,"id":1993}},"14148":{"timestamp":{"__isSmartRef__":true,"id":14149},"user":"soergel","tags":["debug"]},"14149":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14150":{"varMapping":{"__isSmartRef__":true,"id":14151},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14152},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14151":{"this":{"__isSmartRef__":true,"id":1993}},"14152":{"timestamp":{"__isSmartRef__":true,"id":14153},"user":"josi","tags":["gemtypes"]},"14153":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14154":{"varMapping":{"__isSmartRef__":true,"id":14155},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14156},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14155":{"this":{"__isSmartRef__":true,"id":1993}},"14156":{"timestamp":{"__isSmartRef__":true,"id":14157},"user":"soergel","tags":[]},"14157":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14158":{"varMapping":{"__isSmartRef__":true,"id":14159},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14160},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14159":{"this":{"__isSmartRef__":true,"id":1993}},"14160":{"timestamp":{"__isSmartRef__":true,"id":14161},"user":"soergel","tags":[]},"14161":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14162":{"varMapping":{"__isSmartRef__":true,"id":14163},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14164},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14163":{"this":{"__isSmartRef__":true,"id":1993}},"14164":{"timestamp":{"__isSmartRef__":true,"id":14165},"user":"soergel","tags":[]},"14165":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14166":{"varMapping":{"__isSmartRef__":true,"id":14167},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14168},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14167":{"this":{"__isSmartRef__":true,"id":1993}},"14168":{"timestamp":{"__isSmartRef__":true,"id":14169},"user":"josi","tags":["gemtypes"]},"14169":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14170":{"varMapping":{"__isSmartRef__":true,"id":14171},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14172},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14171":{"this":{"__isSmartRef__":true,"id":1993}},"14172":{"timestamp":{"__isSmartRef__":true,"id":14173},"user":"josi","tags":["gemtypes"]},"14173":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14174":{"varMapping":{"__isSmartRef__":true,"id":14175},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14176},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14175":{"this":{"__isSmartRef__":true,"id":1993}},"14176":{"timestamp":{"__isSmartRef__":true,"id":14177},"user":"jan.sandbrink","tags":[]},"14177":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14178":{"become":{"__isSmartRef__":true,"id":14179},"onMouseDown":{"__isSmartRef__":true,"id":14183},"updatePicture":{"__isSmartRef__":true,"id":14191},"ruby":{"__isSmartRef__":true,"id":14195},"switchPositionWith":{"__isSmartRef__":true,"id":14199},"addNeighbour":{"__isSmartRef__":true,"id":14203},"amethyst":{"__isSmartRef__":true,"id":14207},"diopside":{"__isSmartRef__":true,"id":14211},"gemTypes":{"__isSmartRef__":true,"id":14215},"becomeRandomGem":{"__isSmartRef__":true,"id":14219},"mark":{"__isSmartRef__":true,"id":14223},"unmark":{"__isSmartRef__":true,"id":14227},"hasNeighbour":{"__isSmartRef__":true,"id":14231},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14235},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14239},"disappear":{"__isSmartRef__":true,"id":14243},"findStreakStart":{"__isSmartRef__":true,"id":14247},"buildStreak":{"__isSmartRef__":true,"id":14251},"scoreStreak":{"__isSmartRef__":true,"id":14255},"tryToStreak":{"__isSmartRef__":true,"id":14259},"blueDiamond":{"__isSmartRef__":true,"id":14263},"prehnite":{"__isSmartRef__":true,"id":14267},"debugUnmark":{"__isSmartRef__":true,"id":14271},"debugMark":{"__isSmartRef__":true,"id":14275},"citrine":{"__isSmartRef__":true,"id":14279},"move":{"__isSmartRef__":true,"id":14283},"performMovement":{"__isSmartRef__":true,"id":14287},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14291},"zircon":{"__isSmartRef__":true,"id":14295},"emerald":{"__isSmartRef__":true,"id":14299},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14303}},"14179":{"varMapping":{"__isSmartRef__":true,"id":14180},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14181},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14180":{"this":{"__isSmartRef__":true,"id":1875}},"14181":{"timestamp":{"__isSmartRef__":true,"id":14182},"user":"josi","tags":[]},"14182":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14183":{"varMapping":{"__isSmartRef__":true,"id":14184},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14189},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14184":{"this":{"__isSmartRef__":true,"id":1875},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14185}},"14185":{"$super":{"__isSmartRef__":true,"id":14186}},"14186":{"varMapping":{"__isSmartRef__":true,"id":14187},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14188},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14187":{"obj":{"__isSmartRef__":true,"id":1875},"name":"onMouseDown"},"14188":{},"14189":{"timestamp":{"__isSmartRef__":true,"id":14190},"user":"soergel","tags":[]},"14190":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14191":{"varMapping":{"__isSmartRef__":true,"id":14192},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14193},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14192":{"this":{"__isSmartRef__":true,"id":1875}},"14193":{"timestamp":{"__isSmartRef__":true,"id":14194},"user":"soergel","tags":[]},"14194":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14195":{"varMapping":{"__isSmartRef__":true,"id":14196},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14197},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14196":{"this":{"__isSmartRef__":true,"id":1875}},"14197":{"timestamp":{"__isSmartRef__":true,"id":14198},"user":"josi","tags":["gemtypes"]},"14198":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14199":{"varMapping":{"__isSmartRef__":true,"id":14200},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14201},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14200":{"this":{"__isSmartRef__":true,"id":1875}},"14201":{"timestamp":{"__isSmartRef__":true,"id":14202},"user":"jan.sandbrink","tags":[]},"14202":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14203":{"varMapping":{"__isSmartRef__":true,"id":14204},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14205},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14204":{"this":{"__isSmartRef__":true,"id":1875}},"14205":{"timestamp":{"__isSmartRef__":true,"id":14206},"user":"jan.sandbrink","tags":[]},"14206":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14207":{"varMapping":{"__isSmartRef__":true,"id":14208},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14209},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14208":{"this":{"__isSmartRef__":true,"id":1875}},"14209":{"timestamp":{"__isSmartRef__":true,"id":14210},"user":"josi","tags":["gemtypes"]},"14210":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14211":{"varMapping":{"__isSmartRef__":true,"id":14212},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14213},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14212":{"this":{"__isSmartRef__":true,"id":1875}},"14213":{"timestamp":{"__isSmartRef__":true,"id":14214},"user":"josi","tags":["gemtypes"]},"14214":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14215":{"varMapping":{"__isSmartRef__":true,"id":14216},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14217},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14216":{"this":{"__isSmartRef__":true,"id":1875}},"14217":{"timestamp":{"__isSmartRef__":true,"id":14218},"user":"josi","tags":[]},"14218":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14219":{"varMapping":{"__isSmartRef__":true,"id":14220},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14221},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14220":{"this":{"__isSmartRef__":true,"id":1875}},"14221":{"timestamp":{"__isSmartRef__":true,"id":14222},"user":"josi","tags":[]},"14222":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14223":{"varMapping":{"__isSmartRef__":true,"id":14224},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14225},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14224":{"this":{"__isSmartRef__":true,"id":1875}},"14225":{"timestamp":{"__isSmartRef__":true,"id":14226},"user":"soergel","tags":[]},"14226":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14227":{"varMapping":{"__isSmartRef__":true,"id":14228},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14229},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14228":{"this":{"__isSmartRef__":true,"id":1875}},"14229":{"timestamp":{"__isSmartRef__":true,"id":14230},"user":"soergel","tags":[]},"14230":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14231":{"varMapping":{"__isSmartRef__":true,"id":14232},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14233},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14232":{"this":{"__isSmartRef__":true,"id":1875}},"14233":{"timestamp":{"__isSmartRef__":true,"id":14234},"user":"soergel","tags":[]},"14234":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14235":{"varMapping":{"__isSmartRef__":true,"id":14236},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14237},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14236":{"this":{"__isSmartRef__":true,"id":1875}},"14237":{"timestamp":{"__isSmartRef__":true,"id":14238},"user":"soergel","tags":["debug"]},"14238":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14239":{"varMapping":{"__isSmartRef__":true,"id":14240},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14241},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14240":{"this":{"__isSmartRef__":true,"id":1875}},"14241":{"timestamp":{"__isSmartRef__":true,"id":14242},"user":"soergel","tags":["debug"]},"14242":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14243":{"varMapping":{"__isSmartRef__":true,"id":14244},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14245},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14244":{"this":{"__isSmartRef__":true,"id":1875}},"14245":{"timestamp":{"__isSmartRef__":true,"id":14246},"user":"jan.sandbrink","tags":[]},"14246":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14247":{"varMapping":{"__isSmartRef__":true,"id":14248},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14249},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14248":{"this":{"__isSmartRef__":true,"id":1875}},"14249":{"timestamp":{"__isSmartRef__":true,"id":14250},"user":"jan.sandbrink","tags":[]},"14250":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14251":{"varMapping":{"__isSmartRef__":true,"id":14252},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14253},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14252":{"this":{"__isSmartRef__":true,"id":1875}},"14253":{"timestamp":{"__isSmartRef__":true,"id":14254},"user":"jan.sandbrink","tags":[]},"14254":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14255":{"varMapping":{"__isSmartRef__":true,"id":14256},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14257},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14256":{"this":{"__isSmartRef__":true,"id":1875}},"14257":{"timestamp":{"__isSmartRef__":true,"id":14258},"user":"jan.sandbrink","tags":[]},"14258":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14259":{"varMapping":{"__isSmartRef__":true,"id":14260},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14261},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14260":{"this":{"__isSmartRef__":true,"id":1875}},"14261":{"timestamp":{"__isSmartRef__":true,"id":14262},"user":"jan.sandbrink","tags":[]},"14262":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14263":{"varMapping":{"__isSmartRef__":true,"id":14264},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14265},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14264":{"this":{"__isSmartRef__":true,"id":1875}},"14265":{"timestamp":{"__isSmartRef__":true,"id":14266},"user":"josi","tags":["gemtypes"]},"14266":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14267":{"varMapping":{"__isSmartRef__":true,"id":14268},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14269},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14268":{"this":{"__isSmartRef__":true,"id":1875}},"14269":{"timestamp":{"__isSmartRef__":true,"id":14270},"user":"josi","tags":["gemtypes"]},"14270":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14271":{"varMapping":{"__isSmartRef__":true,"id":14272},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14273},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14272":{"this":{"__isSmartRef__":true,"id":1875}},"14273":{"timestamp":{"__isSmartRef__":true,"id":14274},"user":"soergel","tags":["debug"]},"14274":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14275":{"varMapping":{"__isSmartRef__":true,"id":14276},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14277},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14276":{"this":{"__isSmartRef__":true,"id":1875}},"14277":{"timestamp":{"__isSmartRef__":true,"id":14278},"user":"soergel","tags":["debug"]},"14278":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14279":{"varMapping":{"__isSmartRef__":true,"id":14280},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14281},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14280":{"this":{"__isSmartRef__":true,"id":1875}},"14281":{"timestamp":{"__isSmartRef__":true,"id":14282},"user":"josi","tags":["gemtypes"]},"14282":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14283":{"varMapping":{"__isSmartRef__":true,"id":14284},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14285},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14284":{"this":{"__isSmartRef__":true,"id":1875}},"14285":{"timestamp":{"__isSmartRef__":true,"id":14286},"user":"soergel","tags":[]},"14286":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14287":{"varMapping":{"__isSmartRef__":true,"id":14288},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14289},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14288":{"this":{"__isSmartRef__":true,"id":1875}},"14289":{"timestamp":{"__isSmartRef__":true,"id":14290},"user":"soergel","tags":[]},"14290":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14291":{"varMapping":{"__isSmartRef__":true,"id":14292},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14293},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14292":{"this":{"__isSmartRef__":true,"id":1875}},"14293":{"timestamp":{"__isSmartRef__":true,"id":14294},"user":"soergel","tags":[]},"14294":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14295":{"varMapping":{"__isSmartRef__":true,"id":14296},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14297},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14296":{"this":{"__isSmartRef__":true,"id":1875}},"14297":{"timestamp":{"__isSmartRef__":true,"id":14298},"user":"josi","tags":["gemtypes"]},"14298":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14299":{"varMapping":{"__isSmartRef__":true,"id":14300},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14301},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14300":{"this":{"__isSmartRef__":true,"id":1875}},"14301":{"timestamp":{"__isSmartRef__":true,"id":14302},"user":"josi","tags":["gemtypes"]},"14302":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14303":{"varMapping":{"__isSmartRef__":true,"id":14304},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14305},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14304":{"this":{"__isSmartRef__":true,"id":1875}},"14305":{"timestamp":{"__isSmartRef__":true,"id":14306},"user":"jan.sandbrink","tags":[]},"14306":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14307":{"become":{"__isSmartRef__":true,"id":14308},"onMouseDown":{"__isSmartRef__":true,"id":14312},"updatePicture":{"__isSmartRef__":true,"id":14320},"ruby":{"__isSmartRef__":true,"id":14324},"switchPositionWith":{"__isSmartRef__":true,"id":14328},"addNeighbour":{"__isSmartRef__":true,"id":14332},"amethyst":{"__isSmartRef__":true,"id":14336},"diopside":{"__isSmartRef__":true,"id":14340},"gemTypes":{"__isSmartRef__":true,"id":14344},"becomeRandomGem":{"__isSmartRef__":true,"id":14348},"mark":{"__isSmartRef__":true,"id":14352},"unmark":{"__isSmartRef__":true,"id":14356},"hasNeighbour":{"__isSmartRef__":true,"id":14360},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14364},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14368},"disappear":{"__isSmartRef__":true,"id":14372},"findStreakStart":{"__isSmartRef__":true,"id":14376},"buildStreak":{"__isSmartRef__":true,"id":14380},"scoreStreak":{"__isSmartRef__":true,"id":14384},"tryToStreak":{"__isSmartRef__":true,"id":14388},"blueDiamond":{"__isSmartRef__":true,"id":14392},"prehnite":{"__isSmartRef__":true,"id":14396},"debugUnmark":{"__isSmartRef__":true,"id":14400},"debugMark":{"__isSmartRef__":true,"id":14404},"citrine":{"__isSmartRef__":true,"id":14408},"move":{"__isSmartRef__":true,"id":14412},"performMovement":{"__isSmartRef__":true,"id":14416},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14420},"zircon":{"__isSmartRef__":true,"id":14424},"emerald":{"__isSmartRef__":true,"id":14428},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14432}},"14308":{"varMapping":{"__isSmartRef__":true,"id":14309},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14310},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14309":{"this":{"__isSmartRef__":true,"id":1743}},"14310":{"timestamp":{"__isSmartRef__":true,"id":14311},"user":"josi","tags":[]},"14311":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14312":{"varMapping":{"__isSmartRef__":true,"id":14313},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14318},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14313":{"this":{"__isSmartRef__":true,"id":1743},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14314}},"14314":{"$super":{"__isSmartRef__":true,"id":14315}},"14315":{"varMapping":{"__isSmartRef__":true,"id":14316},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14317},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14316":{"obj":{"__isSmartRef__":true,"id":1743},"name":"onMouseDown"},"14317":{},"14318":{"timestamp":{"__isSmartRef__":true,"id":14319},"user":"soergel","tags":[]},"14319":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14320":{"varMapping":{"__isSmartRef__":true,"id":14321},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14322},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14321":{"this":{"__isSmartRef__":true,"id":1743}},"14322":{"timestamp":{"__isSmartRef__":true,"id":14323},"user":"soergel","tags":[]},"14323":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14324":{"varMapping":{"__isSmartRef__":true,"id":14325},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14326},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14325":{"this":{"__isSmartRef__":true,"id":1743}},"14326":{"timestamp":{"__isSmartRef__":true,"id":14327},"user":"josi","tags":["gemtypes"]},"14327":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14328":{"varMapping":{"__isSmartRef__":true,"id":14329},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14330},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14329":{"this":{"__isSmartRef__":true,"id":1743}},"14330":{"timestamp":{"__isSmartRef__":true,"id":14331},"user":"jan.sandbrink","tags":[]},"14331":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14332":{"varMapping":{"__isSmartRef__":true,"id":14333},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14334},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14333":{"this":{"__isSmartRef__":true,"id":1743}},"14334":{"timestamp":{"__isSmartRef__":true,"id":14335},"user":"jan.sandbrink","tags":[]},"14335":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14336":{"varMapping":{"__isSmartRef__":true,"id":14337},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14338},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14337":{"this":{"__isSmartRef__":true,"id":1743}},"14338":{"timestamp":{"__isSmartRef__":true,"id":14339},"user":"josi","tags":["gemtypes"]},"14339":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14340":{"varMapping":{"__isSmartRef__":true,"id":14341},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14342},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14341":{"this":{"__isSmartRef__":true,"id":1743}},"14342":{"timestamp":{"__isSmartRef__":true,"id":14343},"user":"josi","tags":["gemtypes"]},"14343":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14344":{"varMapping":{"__isSmartRef__":true,"id":14345},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14346},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14345":{"this":{"__isSmartRef__":true,"id":1743}},"14346":{"timestamp":{"__isSmartRef__":true,"id":14347},"user":"josi","tags":[]},"14347":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14348":{"varMapping":{"__isSmartRef__":true,"id":14349},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14350},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14349":{"this":{"__isSmartRef__":true,"id":1743}},"14350":{"timestamp":{"__isSmartRef__":true,"id":14351},"user":"josi","tags":[]},"14351":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14352":{"varMapping":{"__isSmartRef__":true,"id":14353},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14354},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14353":{"this":{"__isSmartRef__":true,"id":1743}},"14354":{"timestamp":{"__isSmartRef__":true,"id":14355},"user":"soergel","tags":[]},"14355":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14356":{"varMapping":{"__isSmartRef__":true,"id":14357},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14358},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14357":{"this":{"__isSmartRef__":true,"id":1743}},"14358":{"timestamp":{"__isSmartRef__":true,"id":14359},"user":"soergel","tags":[]},"14359":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14360":{"varMapping":{"__isSmartRef__":true,"id":14361},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14362},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14361":{"this":{"__isSmartRef__":true,"id":1743}},"14362":{"timestamp":{"__isSmartRef__":true,"id":14363},"user":"soergel","tags":[]},"14363":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14364":{"varMapping":{"__isSmartRef__":true,"id":14365},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14366},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14365":{"this":{"__isSmartRef__":true,"id":1743}},"14366":{"timestamp":{"__isSmartRef__":true,"id":14367},"user":"soergel","tags":["debug"]},"14367":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14368":{"varMapping":{"__isSmartRef__":true,"id":14369},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14370},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14369":{"this":{"__isSmartRef__":true,"id":1743}},"14370":{"timestamp":{"__isSmartRef__":true,"id":14371},"user":"soergel","tags":["debug"]},"14371":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14372":{"varMapping":{"__isSmartRef__":true,"id":14373},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14374},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14373":{"this":{"__isSmartRef__":true,"id":1743}},"14374":{"timestamp":{"__isSmartRef__":true,"id":14375},"user":"jan.sandbrink","tags":[]},"14375":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14376":{"varMapping":{"__isSmartRef__":true,"id":14377},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14378},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14377":{"this":{"__isSmartRef__":true,"id":1743}},"14378":{"timestamp":{"__isSmartRef__":true,"id":14379},"user":"jan.sandbrink","tags":[]},"14379":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14380":{"varMapping":{"__isSmartRef__":true,"id":14381},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14382},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14381":{"this":{"__isSmartRef__":true,"id":1743}},"14382":{"timestamp":{"__isSmartRef__":true,"id":14383},"user":"jan.sandbrink","tags":[]},"14383":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14384":{"varMapping":{"__isSmartRef__":true,"id":14385},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14386},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14385":{"this":{"__isSmartRef__":true,"id":1743}},"14386":{"timestamp":{"__isSmartRef__":true,"id":14387},"user":"jan.sandbrink","tags":[]},"14387":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14388":{"varMapping":{"__isSmartRef__":true,"id":14389},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14390},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14389":{"this":{"__isSmartRef__":true,"id":1743}},"14390":{"timestamp":{"__isSmartRef__":true,"id":14391},"user":"jan.sandbrink","tags":[]},"14391":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14392":{"varMapping":{"__isSmartRef__":true,"id":14393},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14394},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14393":{"this":{"__isSmartRef__":true,"id":1743}},"14394":{"timestamp":{"__isSmartRef__":true,"id":14395},"user":"josi","tags":["gemtypes"]},"14395":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14396":{"varMapping":{"__isSmartRef__":true,"id":14397},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14398},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14397":{"this":{"__isSmartRef__":true,"id":1743}},"14398":{"timestamp":{"__isSmartRef__":true,"id":14399},"user":"josi","tags":["gemtypes"]},"14399":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14400":{"varMapping":{"__isSmartRef__":true,"id":14401},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14402},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14401":{"this":{"__isSmartRef__":true,"id":1743}},"14402":{"timestamp":{"__isSmartRef__":true,"id":14403},"user":"soergel","tags":["debug"]},"14403":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14404":{"varMapping":{"__isSmartRef__":true,"id":14405},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14406},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14405":{"this":{"__isSmartRef__":true,"id":1743}},"14406":{"timestamp":{"__isSmartRef__":true,"id":14407},"user":"soergel","tags":["debug"]},"14407":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14408":{"varMapping":{"__isSmartRef__":true,"id":14409},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14410},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14409":{"this":{"__isSmartRef__":true,"id":1743}},"14410":{"timestamp":{"__isSmartRef__":true,"id":14411},"user":"josi","tags":["gemtypes"]},"14411":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14412":{"varMapping":{"__isSmartRef__":true,"id":14413},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14414},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14413":{"this":{"__isSmartRef__":true,"id":1743}},"14414":{"timestamp":{"__isSmartRef__":true,"id":14415},"user":"soergel","tags":[]},"14415":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14416":{"varMapping":{"__isSmartRef__":true,"id":14417},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14418},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14417":{"this":{"__isSmartRef__":true,"id":1743}},"14418":{"timestamp":{"__isSmartRef__":true,"id":14419},"user":"soergel","tags":[]},"14419":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14420":{"varMapping":{"__isSmartRef__":true,"id":14421},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14422},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14421":{"this":{"__isSmartRef__":true,"id":1743}},"14422":{"timestamp":{"__isSmartRef__":true,"id":14423},"user":"soergel","tags":[]},"14423":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14424":{"varMapping":{"__isSmartRef__":true,"id":14425},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14426},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14425":{"this":{"__isSmartRef__":true,"id":1743}},"14426":{"timestamp":{"__isSmartRef__":true,"id":14427},"user":"josi","tags":["gemtypes"]},"14427":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14428":{"varMapping":{"__isSmartRef__":true,"id":14429},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14430},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14429":{"this":{"__isSmartRef__":true,"id":1743}},"14430":{"timestamp":{"__isSmartRef__":true,"id":14431},"user":"josi","tags":["gemtypes"]},"14431":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14432":{"varMapping":{"__isSmartRef__":true,"id":14433},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14434},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14433":{"this":{"__isSmartRef__":true,"id":1743}},"14434":{"timestamp":{"__isSmartRef__":true,"id":14435},"user":"jan.sandbrink","tags":[]},"14435":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14436":{"become":{"__isSmartRef__":true,"id":14437},"onMouseDown":{"__isSmartRef__":true,"id":14441},"updatePicture":{"__isSmartRef__":true,"id":14449},"ruby":{"__isSmartRef__":true,"id":14453},"switchPositionWith":{"__isSmartRef__":true,"id":14457},"addNeighbour":{"__isSmartRef__":true,"id":14461},"amethyst":{"__isSmartRef__":true,"id":14465},"diopside":{"__isSmartRef__":true,"id":14469},"gemTypes":{"__isSmartRef__":true,"id":14473},"becomeRandomGem":{"__isSmartRef__":true,"id":14477},"mark":{"__isSmartRef__":true,"id":14481},"unmark":{"__isSmartRef__":true,"id":14485},"hasNeighbour":{"__isSmartRef__":true,"id":14489},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14493},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14497},"disappear":{"__isSmartRef__":true,"id":14501},"findStreakStart":{"__isSmartRef__":true,"id":14505},"buildStreak":{"__isSmartRef__":true,"id":14509},"scoreStreak":{"__isSmartRef__":true,"id":14513},"tryToStreak":{"__isSmartRef__":true,"id":14517},"blueDiamond":{"__isSmartRef__":true,"id":14521},"prehnite":{"__isSmartRef__":true,"id":14525},"debugUnmark":{"__isSmartRef__":true,"id":14529},"debugMark":{"__isSmartRef__":true,"id":14533},"citrine":{"__isSmartRef__":true,"id":14537},"move":{"__isSmartRef__":true,"id":14541},"performMovement":{"__isSmartRef__":true,"id":14545},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14549},"zircon":{"__isSmartRef__":true,"id":14553},"emerald":{"__isSmartRef__":true,"id":14557},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14561}},"14437":{"varMapping":{"__isSmartRef__":true,"id":14438},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14439},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14438":{"this":{"__isSmartRef__":true,"id":1651}},"14439":{"timestamp":{"__isSmartRef__":true,"id":14440},"user":"josi","tags":[]},"14440":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14441":{"varMapping":{"__isSmartRef__":true,"id":14442},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14442":{"this":{"__isSmartRef__":true,"id":1651},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14443}},"14443":{"$super":{"__isSmartRef__":true,"id":14444}},"14444":{"varMapping":{"__isSmartRef__":true,"id":14445},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14446},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14445":{"obj":{"__isSmartRef__":true,"id":1651},"name":"onMouseDown"},"14446":{},"14447":{"timestamp":{"__isSmartRef__":true,"id":14448},"user":"soergel","tags":[]},"14448":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14449":{"varMapping":{"__isSmartRef__":true,"id":14450},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14451},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14450":{"this":{"__isSmartRef__":true,"id":1651}},"14451":{"timestamp":{"__isSmartRef__":true,"id":14452},"user":"soergel","tags":[]},"14452":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14453":{"varMapping":{"__isSmartRef__":true,"id":14454},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14455},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14454":{"this":{"__isSmartRef__":true,"id":1651}},"14455":{"timestamp":{"__isSmartRef__":true,"id":14456},"user":"josi","tags":["gemtypes"]},"14456":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14457":{"varMapping":{"__isSmartRef__":true,"id":14458},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14458":{"this":{"__isSmartRef__":true,"id":1651}},"14459":{"timestamp":{"__isSmartRef__":true,"id":14460},"user":"jan.sandbrink","tags":[]},"14460":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14461":{"varMapping":{"__isSmartRef__":true,"id":14462},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14463},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14462":{"this":{"__isSmartRef__":true,"id":1651}},"14463":{"timestamp":{"__isSmartRef__":true,"id":14464},"user":"jan.sandbrink","tags":[]},"14464":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14465":{"varMapping":{"__isSmartRef__":true,"id":14466},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14467},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14466":{"this":{"__isSmartRef__":true,"id":1651}},"14467":{"timestamp":{"__isSmartRef__":true,"id":14468},"user":"josi","tags":["gemtypes"]},"14468":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14469":{"varMapping":{"__isSmartRef__":true,"id":14470},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14471},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14470":{"this":{"__isSmartRef__":true,"id":1651}},"14471":{"timestamp":{"__isSmartRef__":true,"id":14472},"user":"josi","tags":["gemtypes"]},"14472":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14473":{"varMapping":{"__isSmartRef__":true,"id":14474},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14475},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14474":{"this":{"__isSmartRef__":true,"id":1651}},"14475":{"timestamp":{"__isSmartRef__":true,"id":14476},"user":"josi","tags":[]},"14476":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14477":{"varMapping":{"__isSmartRef__":true,"id":14478},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14478":{"this":{"__isSmartRef__":true,"id":1651}},"14479":{"timestamp":{"__isSmartRef__":true,"id":14480},"user":"josi","tags":[]},"14480":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14481":{"varMapping":{"__isSmartRef__":true,"id":14482},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14483},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14482":{"this":{"__isSmartRef__":true,"id":1651}},"14483":{"timestamp":{"__isSmartRef__":true,"id":14484},"user":"soergel","tags":[]},"14484":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14485":{"varMapping":{"__isSmartRef__":true,"id":14486},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14487},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14486":{"this":{"__isSmartRef__":true,"id":1651}},"14487":{"timestamp":{"__isSmartRef__":true,"id":14488},"user":"soergel","tags":[]},"14488":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14489":{"varMapping":{"__isSmartRef__":true,"id":14490},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14491},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14490":{"this":{"__isSmartRef__":true,"id":1651}},"14491":{"timestamp":{"__isSmartRef__":true,"id":14492},"user":"soergel","tags":[]},"14492":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14493":{"varMapping":{"__isSmartRef__":true,"id":14494},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14495},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14494":{"this":{"__isSmartRef__":true,"id":1651}},"14495":{"timestamp":{"__isSmartRef__":true,"id":14496},"user":"soergel","tags":["debug"]},"14496":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14497":{"varMapping":{"__isSmartRef__":true,"id":14498},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14498":{"this":{"__isSmartRef__":true,"id":1651}},"14499":{"timestamp":{"__isSmartRef__":true,"id":14500},"user":"soergel","tags":["debug"]},"14500":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14501":{"varMapping":{"__isSmartRef__":true,"id":14502},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14503},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14502":{"this":{"__isSmartRef__":true,"id":1651}},"14503":{"timestamp":{"__isSmartRef__":true,"id":14504},"user":"jan.sandbrink","tags":[]},"14504":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14505":{"varMapping":{"__isSmartRef__":true,"id":14506},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14507},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14506":{"this":{"__isSmartRef__":true,"id":1651}},"14507":{"timestamp":{"__isSmartRef__":true,"id":14508},"user":"jan.sandbrink","tags":[]},"14508":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14509":{"varMapping":{"__isSmartRef__":true,"id":14510},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14511},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14510":{"this":{"__isSmartRef__":true,"id":1651}},"14511":{"timestamp":{"__isSmartRef__":true,"id":14512},"user":"jan.sandbrink","tags":[]},"14512":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14513":{"varMapping":{"__isSmartRef__":true,"id":14514},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14515},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14514":{"this":{"__isSmartRef__":true,"id":1651}},"14515":{"timestamp":{"__isSmartRef__":true,"id":14516},"user":"jan.sandbrink","tags":[]},"14516":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14517":{"varMapping":{"__isSmartRef__":true,"id":14518},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14519},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14518":{"this":{"__isSmartRef__":true,"id":1651}},"14519":{"timestamp":{"__isSmartRef__":true,"id":14520},"user":"jan.sandbrink","tags":[]},"14520":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14521":{"varMapping":{"__isSmartRef__":true,"id":14522},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14523},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14522":{"this":{"__isSmartRef__":true,"id":1651}},"14523":{"timestamp":{"__isSmartRef__":true,"id":14524},"user":"josi","tags":["gemtypes"]},"14524":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14525":{"varMapping":{"__isSmartRef__":true,"id":14526},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14527},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14526":{"this":{"__isSmartRef__":true,"id":1651}},"14527":{"timestamp":{"__isSmartRef__":true,"id":14528},"user":"josi","tags":["gemtypes"]},"14528":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14529":{"varMapping":{"__isSmartRef__":true,"id":14530},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14531},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14530":{"this":{"__isSmartRef__":true,"id":1651}},"14531":{"timestamp":{"__isSmartRef__":true,"id":14532},"user":"soergel","tags":["debug"]},"14532":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14533":{"varMapping":{"__isSmartRef__":true,"id":14534},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14535},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14534":{"this":{"__isSmartRef__":true,"id":1651}},"14535":{"timestamp":{"__isSmartRef__":true,"id":14536},"user":"soergel","tags":["debug"]},"14536":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14537":{"varMapping":{"__isSmartRef__":true,"id":14538},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14539},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14538":{"this":{"__isSmartRef__":true,"id":1651}},"14539":{"timestamp":{"__isSmartRef__":true,"id":14540},"user":"josi","tags":["gemtypes"]},"14540":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14541":{"varMapping":{"__isSmartRef__":true,"id":14542},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14543},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14542":{"this":{"__isSmartRef__":true,"id":1651}},"14543":{"timestamp":{"__isSmartRef__":true,"id":14544},"user":"soergel","tags":[]},"14544":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14545":{"varMapping":{"__isSmartRef__":true,"id":14546},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14547},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14546":{"this":{"__isSmartRef__":true,"id":1651}},"14547":{"timestamp":{"__isSmartRef__":true,"id":14548},"user":"soergel","tags":[]},"14548":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14549":{"varMapping":{"__isSmartRef__":true,"id":14550},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14551},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14550":{"this":{"__isSmartRef__":true,"id":1651}},"14551":{"timestamp":{"__isSmartRef__":true,"id":14552},"user":"soergel","tags":[]},"14552":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14553":{"varMapping":{"__isSmartRef__":true,"id":14554},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14555},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14554":{"this":{"__isSmartRef__":true,"id":1651}},"14555":{"timestamp":{"__isSmartRef__":true,"id":14556},"user":"josi","tags":["gemtypes"]},"14556":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14557":{"varMapping":{"__isSmartRef__":true,"id":14558},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14559},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14558":{"this":{"__isSmartRef__":true,"id":1651}},"14559":{"timestamp":{"__isSmartRef__":true,"id":14560},"user":"josi","tags":["gemtypes"]},"14560":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14561":{"varMapping":{"__isSmartRef__":true,"id":14562},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14563},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14562":{"this":{"__isSmartRef__":true,"id":1651}},"14563":{"timestamp":{"__isSmartRef__":true,"id":14564},"user":"jan.sandbrink","tags":[]},"14564":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14565":{"become":{"__isSmartRef__":true,"id":14566},"onMouseDown":{"__isSmartRef__":true,"id":14570},"updatePicture":{"__isSmartRef__":true,"id":14578},"ruby":{"__isSmartRef__":true,"id":14582},"switchPositionWith":{"__isSmartRef__":true,"id":14586},"addNeighbour":{"__isSmartRef__":true,"id":14590},"amethyst":{"__isSmartRef__":true,"id":14594},"diopside":{"__isSmartRef__":true,"id":14598},"gemTypes":{"__isSmartRef__":true,"id":14602},"becomeRandomGem":{"__isSmartRef__":true,"id":14606},"mark":{"__isSmartRef__":true,"id":14610},"unmark":{"__isSmartRef__":true,"id":14614},"hasNeighbour":{"__isSmartRef__":true,"id":14618},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14622},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14626},"disappear":{"__isSmartRef__":true,"id":14630},"findStreakStart":{"__isSmartRef__":true,"id":14634},"buildStreak":{"__isSmartRef__":true,"id":14638},"scoreStreak":{"__isSmartRef__":true,"id":14642},"tryToStreak":{"__isSmartRef__":true,"id":14646},"blueDiamond":{"__isSmartRef__":true,"id":14650},"prehnite":{"__isSmartRef__":true,"id":14654},"debugUnmark":{"__isSmartRef__":true,"id":14658},"debugMark":{"__isSmartRef__":true,"id":14662},"citrine":{"__isSmartRef__":true,"id":14666},"move":{"__isSmartRef__":true,"id":14670},"performMovement":{"__isSmartRef__":true,"id":14674},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14678},"zircon":{"__isSmartRef__":true,"id":14682},"emerald":{"__isSmartRef__":true,"id":14686},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14690}},"14566":{"varMapping":{"__isSmartRef__":true,"id":14567},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14568},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14567":{"this":{"__isSmartRef__":true,"id":1519}},"14568":{"timestamp":{"__isSmartRef__":true,"id":14569},"user":"josi","tags":[]},"14569":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14570":{"varMapping":{"__isSmartRef__":true,"id":14571},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14576},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14571":{"this":{"__isSmartRef__":true,"id":1519},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14572}},"14572":{"$super":{"__isSmartRef__":true,"id":14573}},"14573":{"varMapping":{"__isSmartRef__":true,"id":14574},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14575},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14574":{"obj":{"__isSmartRef__":true,"id":1519},"name":"onMouseDown"},"14575":{},"14576":{"timestamp":{"__isSmartRef__":true,"id":14577},"user":"soergel","tags":[]},"14577":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14578":{"varMapping":{"__isSmartRef__":true,"id":14579},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14580},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14579":{"this":{"__isSmartRef__":true,"id":1519}},"14580":{"timestamp":{"__isSmartRef__":true,"id":14581},"user":"soergel","tags":[]},"14581":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14582":{"varMapping":{"__isSmartRef__":true,"id":14583},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14584},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14583":{"this":{"__isSmartRef__":true,"id":1519}},"14584":{"timestamp":{"__isSmartRef__":true,"id":14585},"user":"josi","tags":["gemtypes"]},"14585":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14586":{"varMapping":{"__isSmartRef__":true,"id":14587},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14588},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14587":{"this":{"__isSmartRef__":true,"id":1519}},"14588":{"timestamp":{"__isSmartRef__":true,"id":14589},"user":"jan.sandbrink","tags":[]},"14589":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14590":{"varMapping":{"__isSmartRef__":true,"id":14591},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14592},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14591":{"this":{"__isSmartRef__":true,"id":1519}},"14592":{"timestamp":{"__isSmartRef__":true,"id":14593},"user":"jan.sandbrink","tags":[]},"14593":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14594":{"varMapping":{"__isSmartRef__":true,"id":14595},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14596},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14595":{"this":{"__isSmartRef__":true,"id":1519}},"14596":{"timestamp":{"__isSmartRef__":true,"id":14597},"user":"josi","tags":["gemtypes"]},"14597":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14598":{"varMapping":{"__isSmartRef__":true,"id":14599},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14600},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14599":{"this":{"__isSmartRef__":true,"id":1519}},"14600":{"timestamp":{"__isSmartRef__":true,"id":14601},"user":"josi","tags":["gemtypes"]},"14601":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14602":{"varMapping":{"__isSmartRef__":true,"id":14603},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14604},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14603":{"this":{"__isSmartRef__":true,"id":1519}},"14604":{"timestamp":{"__isSmartRef__":true,"id":14605},"user":"josi","tags":[]},"14605":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14606":{"varMapping":{"__isSmartRef__":true,"id":14607},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14608},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14607":{"this":{"__isSmartRef__":true,"id":1519}},"14608":{"timestamp":{"__isSmartRef__":true,"id":14609},"user":"josi","tags":[]},"14609":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14610":{"varMapping":{"__isSmartRef__":true,"id":14611},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14612},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14611":{"this":{"__isSmartRef__":true,"id":1519}},"14612":{"timestamp":{"__isSmartRef__":true,"id":14613},"user":"soergel","tags":[]},"14613":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14614":{"varMapping":{"__isSmartRef__":true,"id":14615},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14616},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14615":{"this":{"__isSmartRef__":true,"id":1519}},"14616":{"timestamp":{"__isSmartRef__":true,"id":14617},"user":"soergel","tags":[]},"14617":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14618":{"varMapping":{"__isSmartRef__":true,"id":14619},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14620},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14619":{"this":{"__isSmartRef__":true,"id":1519}},"14620":{"timestamp":{"__isSmartRef__":true,"id":14621},"user":"soergel","tags":[]},"14621":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14622":{"varMapping":{"__isSmartRef__":true,"id":14623},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14624},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14623":{"this":{"__isSmartRef__":true,"id":1519}},"14624":{"timestamp":{"__isSmartRef__":true,"id":14625},"user":"soergel","tags":["debug"]},"14625":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14626":{"varMapping":{"__isSmartRef__":true,"id":14627},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14628},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14627":{"this":{"__isSmartRef__":true,"id":1519}},"14628":{"timestamp":{"__isSmartRef__":true,"id":14629},"user":"soergel","tags":["debug"]},"14629":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14630":{"varMapping":{"__isSmartRef__":true,"id":14631},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14632},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14631":{"this":{"__isSmartRef__":true,"id":1519}},"14632":{"timestamp":{"__isSmartRef__":true,"id":14633},"user":"jan.sandbrink","tags":[]},"14633":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14634":{"varMapping":{"__isSmartRef__":true,"id":14635},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14636},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14635":{"this":{"__isSmartRef__":true,"id":1519}},"14636":{"timestamp":{"__isSmartRef__":true,"id":14637},"user":"jan.sandbrink","tags":[]},"14637":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14638":{"varMapping":{"__isSmartRef__":true,"id":14639},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14640},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14639":{"this":{"__isSmartRef__":true,"id":1519}},"14640":{"timestamp":{"__isSmartRef__":true,"id":14641},"user":"jan.sandbrink","tags":[]},"14641":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14642":{"varMapping":{"__isSmartRef__":true,"id":14643},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14644},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14643":{"this":{"__isSmartRef__":true,"id":1519}},"14644":{"timestamp":{"__isSmartRef__":true,"id":14645},"user":"jan.sandbrink","tags":[]},"14645":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14646":{"varMapping":{"__isSmartRef__":true,"id":14647},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14648},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14647":{"this":{"__isSmartRef__":true,"id":1519}},"14648":{"timestamp":{"__isSmartRef__":true,"id":14649},"user":"jan.sandbrink","tags":[]},"14649":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14650":{"varMapping":{"__isSmartRef__":true,"id":14651},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14652},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14651":{"this":{"__isSmartRef__":true,"id":1519}},"14652":{"timestamp":{"__isSmartRef__":true,"id":14653},"user":"josi","tags":["gemtypes"]},"14653":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14654":{"varMapping":{"__isSmartRef__":true,"id":14655},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14656},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14655":{"this":{"__isSmartRef__":true,"id":1519}},"14656":{"timestamp":{"__isSmartRef__":true,"id":14657},"user":"josi","tags":["gemtypes"]},"14657":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14658":{"varMapping":{"__isSmartRef__":true,"id":14659},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14660},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14659":{"this":{"__isSmartRef__":true,"id":1519}},"14660":{"timestamp":{"__isSmartRef__":true,"id":14661},"user":"soergel","tags":["debug"]},"14661":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14662":{"varMapping":{"__isSmartRef__":true,"id":14663},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14664},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14663":{"this":{"__isSmartRef__":true,"id":1519}},"14664":{"timestamp":{"__isSmartRef__":true,"id":14665},"user":"soergel","tags":["debug"]},"14665":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14666":{"varMapping":{"__isSmartRef__":true,"id":14667},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14668},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14667":{"this":{"__isSmartRef__":true,"id":1519}},"14668":{"timestamp":{"__isSmartRef__":true,"id":14669},"user":"josi","tags":["gemtypes"]},"14669":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14670":{"varMapping":{"__isSmartRef__":true,"id":14671},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14672},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14671":{"this":{"__isSmartRef__":true,"id":1519}},"14672":{"timestamp":{"__isSmartRef__":true,"id":14673},"user":"soergel","tags":[]},"14673":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14674":{"varMapping":{"__isSmartRef__":true,"id":14675},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14676},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14675":{"this":{"__isSmartRef__":true,"id":1519}},"14676":{"timestamp":{"__isSmartRef__":true,"id":14677},"user":"soergel","tags":[]},"14677":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14678":{"varMapping":{"__isSmartRef__":true,"id":14679},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14680},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14679":{"this":{"__isSmartRef__":true,"id":1519}},"14680":{"timestamp":{"__isSmartRef__":true,"id":14681},"user":"soergel","tags":[]},"14681":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14682":{"varMapping":{"__isSmartRef__":true,"id":14683},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14684},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14683":{"this":{"__isSmartRef__":true,"id":1519}},"14684":{"timestamp":{"__isSmartRef__":true,"id":14685},"user":"josi","tags":["gemtypes"]},"14685":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14686":{"varMapping":{"__isSmartRef__":true,"id":14687},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14688},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14687":{"this":{"__isSmartRef__":true,"id":1519}},"14688":{"timestamp":{"__isSmartRef__":true,"id":14689},"user":"josi","tags":["gemtypes"]},"14689":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14690":{"varMapping":{"__isSmartRef__":true,"id":14691},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14692},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14691":{"this":{"__isSmartRef__":true,"id":1519}},"14692":{"timestamp":{"__isSmartRef__":true,"id":14693},"user":"jan.sandbrink","tags":[]},"14693":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14694":{"become":{"__isSmartRef__":true,"id":14695},"onMouseDown":{"__isSmartRef__":true,"id":14699},"updatePicture":{"__isSmartRef__":true,"id":14707},"ruby":{"__isSmartRef__":true,"id":14711},"switchPositionWith":{"__isSmartRef__":true,"id":14715},"addNeighbour":{"__isSmartRef__":true,"id":14719},"amethyst":{"__isSmartRef__":true,"id":14723},"diopside":{"__isSmartRef__":true,"id":14727},"gemTypes":{"__isSmartRef__":true,"id":14731},"becomeRandomGem":{"__isSmartRef__":true,"id":14735},"mark":{"__isSmartRef__":true,"id":14739},"unmark":{"__isSmartRef__":true,"id":14743},"hasNeighbour":{"__isSmartRef__":true,"id":14747},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14751},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14755},"disappear":{"__isSmartRef__":true,"id":14759},"findStreakStart":{"__isSmartRef__":true,"id":14763},"buildStreak":{"__isSmartRef__":true,"id":14767},"scoreStreak":{"__isSmartRef__":true,"id":14771},"tryToStreak":{"__isSmartRef__":true,"id":14775},"blueDiamond":{"__isSmartRef__":true,"id":14779},"prehnite":{"__isSmartRef__":true,"id":14783},"debugUnmark":{"__isSmartRef__":true,"id":14787},"debugMark":{"__isSmartRef__":true,"id":14791},"citrine":{"__isSmartRef__":true,"id":14795},"move":{"__isSmartRef__":true,"id":14799},"performMovement":{"__isSmartRef__":true,"id":14803},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14807},"zircon":{"__isSmartRef__":true,"id":14811},"emerald":{"__isSmartRef__":true,"id":14815},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14819}},"14695":{"varMapping":{"__isSmartRef__":true,"id":14696},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14697},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14696":{"this":{"__isSmartRef__":true,"id":1384}},"14697":{"timestamp":{"__isSmartRef__":true,"id":14698},"user":"josi","tags":[]},"14698":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14699":{"varMapping":{"__isSmartRef__":true,"id":14700},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14705},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14700":{"this":{"__isSmartRef__":true,"id":1384},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14701}},"14701":{"$super":{"__isSmartRef__":true,"id":14702}},"14702":{"varMapping":{"__isSmartRef__":true,"id":14703},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14704},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14703":{"obj":{"__isSmartRef__":true,"id":1384},"name":"onMouseDown"},"14704":{},"14705":{"timestamp":{"__isSmartRef__":true,"id":14706},"user":"soergel","tags":[]},"14706":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14707":{"varMapping":{"__isSmartRef__":true,"id":14708},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14709},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14708":{"this":{"__isSmartRef__":true,"id":1384}},"14709":{"timestamp":{"__isSmartRef__":true,"id":14710},"user":"soergel","tags":[]},"14710":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14711":{"varMapping":{"__isSmartRef__":true,"id":14712},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14713},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14712":{"this":{"__isSmartRef__":true,"id":1384}},"14713":{"timestamp":{"__isSmartRef__":true,"id":14714},"user":"josi","tags":["gemtypes"]},"14714":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14715":{"varMapping":{"__isSmartRef__":true,"id":14716},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14717},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14716":{"this":{"__isSmartRef__":true,"id":1384}},"14717":{"timestamp":{"__isSmartRef__":true,"id":14718},"user":"jan.sandbrink","tags":[]},"14718":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14719":{"varMapping":{"__isSmartRef__":true,"id":14720},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14721},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14720":{"this":{"__isSmartRef__":true,"id":1384}},"14721":{"timestamp":{"__isSmartRef__":true,"id":14722},"user":"jan.sandbrink","tags":[]},"14722":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14723":{"varMapping":{"__isSmartRef__":true,"id":14724},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14725},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14724":{"this":{"__isSmartRef__":true,"id":1384}},"14725":{"timestamp":{"__isSmartRef__":true,"id":14726},"user":"josi","tags":["gemtypes"]},"14726":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14727":{"varMapping":{"__isSmartRef__":true,"id":14728},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14729},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14728":{"this":{"__isSmartRef__":true,"id":1384}},"14729":{"timestamp":{"__isSmartRef__":true,"id":14730},"user":"josi","tags":["gemtypes"]},"14730":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14731":{"varMapping":{"__isSmartRef__":true,"id":14732},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14733},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14732":{"this":{"__isSmartRef__":true,"id":1384}},"14733":{"timestamp":{"__isSmartRef__":true,"id":14734},"user":"josi","tags":[]},"14734":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14735":{"varMapping":{"__isSmartRef__":true,"id":14736},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14737},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14736":{"this":{"__isSmartRef__":true,"id":1384}},"14737":{"timestamp":{"__isSmartRef__":true,"id":14738},"user":"josi","tags":[]},"14738":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14739":{"varMapping":{"__isSmartRef__":true,"id":14740},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14741},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14740":{"this":{"__isSmartRef__":true,"id":1384}},"14741":{"timestamp":{"__isSmartRef__":true,"id":14742},"user":"soergel","tags":[]},"14742":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14743":{"varMapping":{"__isSmartRef__":true,"id":14744},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14745},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14744":{"this":{"__isSmartRef__":true,"id":1384}},"14745":{"timestamp":{"__isSmartRef__":true,"id":14746},"user":"soergel","tags":[]},"14746":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14747":{"varMapping":{"__isSmartRef__":true,"id":14748},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14749},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14748":{"this":{"__isSmartRef__":true,"id":1384}},"14749":{"timestamp":{"__isSmartRef__":true,"id":14750},"user":"soergel","tags":[]},"14750":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14751":{"varMapping":{"__isSmartRef__":true,"id":14752},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14753},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14752":{"this":{"__isSmartRef__":true,"id":1384}},"14753":{"timestamp":{"__isSmartRef__":true,"id":14754},"user":"soergel","tags":["debug"]},"14754":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14755":{"varMapping":{"__isSmartRef__":true,"id":14756},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14757},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14756":{"this":{"__isSmartRef__":true,"id":1384}},"14757":{"timestamp":{"__isSmartRef__":true,"id":14758},"user":"soergel","tags":["debug"]},"14758":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14759":{"varMapping":{"__isSmartRef__":true,"id":14760},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14761},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14760":{"this":{"__isSmartRef__":true,"id":1384}},"14761":{"timestamp":{"__isSmartRef__":true,"id":14762},"user":"jan.sandbrink","tags":[]},"14762":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14763":{"varMapping":{"__isSmartRef__":true,"id":14764},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14765},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14764":{"this":{"__isSmartRef__":true,"id":1384}},"14765":{"timestamp":{"__isSmartRef__":true,"id":14766},"user":"jan.sandbrink","tags":[]},"14766":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14767":{"varMapping":{"__isSmartRef__":true,"id":14768},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14769},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14768":{"this":{"__isSmartRef__":true,"id":1384}},"14769":{"timestamp":{"__isSmartRef__":true,"id":14770},"user":"jan.sandbrink","tags":[]},"14770":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14771":{"varMapping":{"__isSmartRef__":true,"id":14772},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14773},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14772":{"this":{"__isSmartRef__":true,"id":1384}},"14773":{"timestamp":{"__isSmartRef__":true,"id":14774},"user":"jan.sandbrink","tags":[]},"14774":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14775":{"varMapping":{"__isSmartRef__":true,"id":14776},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14777},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14776":{"this":{"__isSmartRef__":true,"id":1384}},"14777":{"timestamp":{"__isSmartRef__":true,"id":14778},"user":"jan.sandbrink","tags":[]},"14778":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14779":{"varMapping":{"__isSmartRef__":true,"id":14780},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14781},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14780":{"this":{"__isSmartRef__":true,"id":1384}},"14781":{"timestamp":{"__isSmartRef__":true,"id":14782},"user":"josi","tags":["gemtypes"]},"14782":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14783":{"varMapping":{"__isSmartRef__":true,"id":14784},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14785},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14784":{"this":{"__isSmartRef__":true,"id":1384}},"14785":{"timestamp":{"__isSmartRef__":true,"id":14786},"user":"josi","tags":["gemtypes"]},"14786":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14787":{"varMapping":{"__isSmartRef__":true,"id":14788},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14789},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14788":{"this":{"__isSmartRef__":true,"id":1384}},"14789":{"timestamp":{"__isSmartRef__":true,"id":14790},"user":"soergel","tags":["debug"]},"14790":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14791":{"varMapping":{"__isSmartRef__":true,"id":14792},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14793},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14792":{"this":{"__isSmartRef__":true,"id":1384}},"14793":{"timestamp":{"__isSmartRef__":true,"id":14794},"user":"soergel","tags":["debug"]},"14794":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14795":{"varMapping":{"__isSmartRef__":true,"id":14796},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14797},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14796":{"this":{"__isSmartRef__":true,"id":1384}},"14797":{"timestamp":{"__isSmartRef__":true,"id":14798},"user":"josi","tags":["gemtypes"]},"14798":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14799":{"varMapping":{"__isSmartRef__":true,"id":14800},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14801},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14800":{"this":{"__isSmartRef__":true,"id":1384}},"14801":{"timestamp":{"__isSmartRef__":true,"id":14802},"user":"soergel","tags":[]},"14802":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14803":{"varMapping":{"__isSmartRef__":true,"id":14804},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14805},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14804":{"this":{"__isSmartRef__":true,"id":1384}},"14805":{"timestamp":{"__isSmartRef__":true,"id":14806},"user":"soergel","tags":[]},"14806":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14807":{"varMapping":{"__isSmartRef__":true,"id":14808},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14809},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14808":{"this":{"__isSmartRef__":true,"id":1384}},"14809":{"timestamp":{"__isSmartRef__":true,"id":14810},"user":"soergel","tags":[]},"14810":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14811":{"varMapping":{"__isSmartRef__":true,"id":14812},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14813},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14812":{"this":{"__isSmartRef__":true,"id":1384}},"14813":{"timestamp":{"__isSmartRef__":true,"id":14814},"user":"josi","tags":["gemtypes"]},"14814":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14815":{"varMapping":{"__isSmartRef__":true,"id":14816},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14817},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14816":{"this":{"__isSmartRef__":true,"id":1384}},"14817":{"timestamp":{"__isSmartRef__":true,"id":14818},"user":"josi","tags":["gemtypes"]},"14818":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14819":{"varMapping":{"__isSmartRef__":true,"id":14820},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14821},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14820":{"this":{"__isSmartRef__":true,"id":1384}},"14821":{"timestamp":{"__isSmartRef__":true,"id":14822},"user":"jan.sandbrink","tags":[]},"14822":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14823":{"become":{"__isSmartRef__":true,"id":14824},"onMouseDown":{"__isSmartRef__":true,"id":14828},"updatePicture":{"__isSmartRef__":true,"id":14836},"ruby":{"__isSmartRef__":true,"id":14840},"switchPositionWith":{"__isSmartRef__":true,"id":14844},"addNeighbour":{"__isSmartRef__":true,"id":14848},"amethyst":{"__isSmartRef__":true,"id":14852},"diopside":{"__isSmartRef__":true,"id":14856},"gemTypes":{"__isSmartRef__":true,"id":14860},"becomeRandomGem":{"__isSmartRef__":true,"id":14864},"mark":{"__isSmartRef__":true,"id":14868},"unmark":{"__isSmartRef__":true,"id":14872},"hasNeighbour":{"__isSmartRef__":true,"id":14876},"debugMarkNeighbours":{"__isSmartRef__":true,"id":14880},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":14884},"disappear":{"__isSmartRef__":true,"id":14888},"findStreakStart":{"__isSmartRef__":true,"id":14892},"buildStreak":{"__isSmartRef__":true,"id":14896},"scoreStreak":{"__isSmartRef__":true,"id":14900},"tryToStreak":{"__isSmartRef__":true,"id":14904},"blueDiamond":{"__isSmartRef__":true,"id":14908},"prehnite":{"__isSmartRef__":true,"id":14912},"debugUnmark":{"__isSmartRef__":true,"id":14916},"debugMark":{"__isSmartRef__":true,"id":14920},"citrine":{"__isSmartRef__":true,"id":14924},"move":{"__isSmartRef__":true,"id":14928},"performMovement":{"__isSmartRef__":true,"id":14932},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":14936},"zircon":{"__isSmartRef__":true,"id":14940},"emerald":{"__isSmartRef__":true,"id":14944},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":14948}},"14824":{"varMapping":{"__isSmartRef__":true,"id":14825},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14826},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14825":{"this":{"__isSmartRef__":true,"id":1252}},"14826":{"timestamp":{"__isSmartRef__":true,"id":14827},"user":"josi","tags":[]},"14827":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14828":{"varMapping":{"__isSmartRef__":true,"id":14829},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14834},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14829":{"this":{"__isSmartRef__":true,"id":1252},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14830}},"14830":{"$super":{"__isSmartRef__":true,"id":14831}},"14831":{"varMapping":{"__isSmartRef__":true,"id":14832},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14833},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14832":{"obj":{"__isSmartRef__":true,"id":1252},"name":"onMouseDown"},"14833":{},"14834":{"timestamp":{"__isSmartRef__":true,"id":14835},"user":"soergel","tags":[]},"14835":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14836":{"varMapping":{"__isSmartRef__":true,"id":14837},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14838},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14837":{"this":{"__isSmartRef__":true,"id":1252}},"14838":{"timestamp":{"__isSmartRef__":true,"id":14839},"user":"soergel","tags":[]},"14839":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14840":{"varMapping":{"__isSmartRef__":true,"id":14841},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14842},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14841":{"this":{"__isSmartRef__":true,"id":1252}},"14842":{"timestamp":{"__isSmartRef__":true,"id":14843},"user":"josi","tags":["gemtypes"]},"14843":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14844":{"varMapping":{"__isSmartRef__":true,"id":14845},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14846},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14845":{"this":{"__isSmartRef__":true,"id":1252}},"14846":{"timestamp":{"__isSmartRef__":true,"id":14847},"user":"jan.sandbrink","tags":[]},"14847":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14848":{"varMapping":{"__isSmartRef__":true,"id":14849},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14850},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14849":{"this":{"__isSmartRef__":true,"id":1252}},"14850":{"timestamp":{"__isSmartRef__":true,"id":14851},"user":"jan.sandbrink","tags":[]},"14851":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14852":{"varMapping":{"__isSmartRef__":true,"id":14853},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14854},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14853":{"this":{"__isSmartRef__":true,"id":1252}},"14854":{"timestamp":{"__isSmartRef__":true,"id":14855},"user":"josi","tags":["gemtypes"]},"14855":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14856":{"varMapping":{"__isSmartRef__":true,"id":14857},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14858},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14857":{"this":{"__isSmartRef__":true,"id":1252}},"14858":{"timestamp":{"__isSmartRef__":true,"id":14859},"user":"josi","tags":["gemtypes"]},"14859":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14860":{"varMapping":{"__isSmartRef__":true,"id":14861},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14862},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14861":{"this":{"__isSmartRef__":true,"id":1252}},"14862":{"timestamp":{"__isSmartRef__":true,"id":14863},"user":"josi","tags":[]},"14863":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14864":{"varMapping":{"__isSmartRef__":true,"id":14865},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14866},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14865":{"this":{"__isSmartRef__":true,"id":1252}},"14866":{"timestamp":{"__isSmartRef__":true,"id":14867},"user":"josi","tags":[]},"14867":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14868":{"varMapping":{"__isSmartRef__":true,"id":14869},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14870},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14869":{"this":{"__isSmartRef__":true,"id":1252}},"14870":{"timestamp":{"__isSmartRef__":true,"id":14871},"user":"soergel","tags":[]},"14871":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"14872":{"varMapping":{"__isSmartRef__":true,"id":14873},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":14874},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14873":{"this":{"__isSmartRef__":true,"id":1252}},"14874":{"timestamp":{"__isSmartRef__":true,"id":14875},"user":"soergel","tags":[]},"14875":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"14876":{"varMapping":{"__isSmartRef__":true,"id":14877},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":14878},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14877":{"this":{"__isSmartRef__":true,"id":1252}},"14878":{"timestamp":{"__isSmartRef__":true,"id":14879},"user":"soergel","tags":[]},"14879":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"14880":{"varMapping":{"__isSmartRef__":true,"id":14881},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14882},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14881":{"this":{"__isSmartRef__":true,"id":1252}},"14882":{"timestamp":{"__isSmartRef__":true,"id":14883},"user":"soergel","tags":["debug"]},"14883":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"14884":{"varMapping":{"__isSmartRef__":true,"id":14885},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":14886},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14885":{"this":{"__isSmartRef__":true,"id":1252}},"14886":{"timestamp":{"__isSmartRef__":true,"id":14887},"user":"soergel","tags":["debug"]},"14887":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"14888":{"varMapping":{"__isSmartRef__":true,"id":14889},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":14890},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14889":{"this":{"__isSmartRef__":true,"id":1252}},"14890":{"timestamp":{"__isSmartRef__":true,"id":14891},"user":"jan.sandbrink","tags":[]},"14891":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"14892":{"varMapping":{"__isSmartRef__":true,"id":14893},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14894},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14893":{"this":{"__isSmartRef__":true,"id":1252}},"14894":{"timestamp":{"__isSmartRef__":true,"id":14895},"user":"jan.sandbrink","tags":[]},"14895":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"14896":{"varMapping":{"__isSmartRef__":true,"id":14897},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":14898},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14897":{"this":{"__isSmartRef__":true,"id":1252}},"14898":{"timestamp":{"__isSmartRef__":true,"id":14899},"user":"jan.sandbrink","tags":[]},"14899":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"14900":{"varMapping":{"__isSmartRef__":true,"id":14901},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":14902},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14901":{"this":{"__isSmartRef__":true,"id":1252}},"14902":{"timestamp":{"__isSmartRef__":true,"id":14903},"user":"jan.sandbrink","tags":[]},"14903":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"14904":{"varMapping":{"__isSmartRef__":true,"id":14905},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":14906},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14905":{"this":{"__isSmartRef__":true,"id":1252}},"14906":{"timestamp":{"__isSmartRef__":true,"id":14907},"user":"jan.sandbrink","tags":[]},"14907":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"14908":{"varMapping":{"__isSmartRef__":true,"id":14909},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":14910},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14909":{"this":{"__isSmartRef__":true,"id":1252}},"14910":{"timestamp":{"__isSmartRef__":true,"id":14911},"user":"josi","tags":["gemtypes"]},"14911":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"14912":{"varMapping":{"__isSmartRef__":true,"id":14913},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":14914},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14913":{"this":{"__isSmartRef__":true,"id":1252}},"14914":{"timestamp":{"__isSmartRef__":true,"id":14915},"user":"josi","tags":["gemtypes"]},"14915":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"14916":{"varMapping":{"__isSmartRef__":true,"id":14917},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":14918},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14917":{"this":{"__isSmartRef__":true,"id":1252}},"14918":{"timestamp":{"__isSmartRef__":true,"id":14919},"user":"soergel","tags":["debug"]},"14919":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"14920":{"varMapping":{"__isSmartRef__":true,"id":14921},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":14922},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14921":{"this":{"__isSmartRef__":true,"id":1252}},"14922":{"timestamp":{"__isSmartRef__":true,"id":14923},"user":"soergel","tags":["debug"]},"14923":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"14924":{"varMapping":{"__isSmartRef__":true,"id":14925},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":14926},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14925":{"this":{"__isSmartRef__":true,"id":1252}},"14926":{"timestamp":{"__isSmartRef__":true,"id":14927},"user":"josi","tags":["gemtypes"]},"14927":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"14928":{"varMapping":{"__isSmartRef__":true,"id":14929},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":14930},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14929":{"this":{"__isSmartRef__":true,"id":1252}},"14930":{"timestamp":{"__isSmartRef__":true,"id":14931},"user":"soergel","tags":[]},"14931":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"14932":{"varMapping":{"__isSmartRef__":true,"id":14933},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":14934},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14933":{"this":{"__isSmartRef__":true,"id":1252}},"14934":{"timestamp":{"__isSmartRef__":true,"id":14935},"user":"soergel","tags":[]},"14935":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"14936":{"varMapping":{"__isSmartRef__":true,"id":14937},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":14938},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14937":{"this":{"__isSmartRef__":true,"id":1252}},"14938":{"timestamp":{"__isSmartRef__":true,"id":14939},"user":"soergel","tags":[]},"14939":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"14940":{"varMapping":{"__isSmartRef__":true,"id":14941},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":14942},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14941":{"this":{"__isSmartRef__":true,"id":1252}},"14942":{"timestamp":{"__isSmartRef__":true,"id":14943},"user":"josi","tags":["gemtypes"]},"14943":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"14944":{"varMapping":{"__isSmartRef__":true,"id":14945},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":14946},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14945":{"this":{"__isSmartRef__":true,"id":1252}},"14946":{"timestamp":{"__isSmartRef__":true,"id":14947},"user":"josi","tags":["gemtypes"]},"14947":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"14948":{"varMapping":{"__isSmartRef__":true,"id":14949},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":14950},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14949":{"this":{"__isSmartRef__":true,"id":1252}},"14950":{"timestamp":{"__isSmartRef__":true,"id":14951},"user":"jan.sandbrink","tags":[]},"14951":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"14952":{"become":{"__isSmartRef__":true,"id":14953},"onMouseDown":{"__isSmartRef__":true,"id":14957},"updatePicture":{"__isSmartRef__":true,"id":14965},"ruby":{"__isSmartRef__":true,"id":14969},"switchPositionWith":{"__isSmartRef__":true,"id":14973},"addNeighbour":{"__isSmartRef__":true,"id":14977},"amethyst":{"__isSmartRef__":true,"id":14981},"diopside":{"__isSmartRef__":true,"id":14985},"gemTypes":{"__isSmartRef__":true,"id":14989},"becomeRandomGem":{"__isSmartRef__":true,"id":14993},"mark":{"__isSmartRef__":true,"id":14997},"unmark":{"__isSmartRef__":true,"id":15001},"hasNeighbour":{"__isSmartRef__":true,"id":15005},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15009},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15013},"disappear":{"__isSmartRef__":true,"id":15017},"findStreakStart":{"__isSmartRef__":true,"id":15021},"buildStreak":{"__isSmartRef__":true,"id":15025},"scoreStreak":{"__isSmartRef__":true,"id":15029},"tryToStreak":{"__isSmartRef__":true,"id":15033},"blueDiamond":{"__isSmartRef__":true,"id":15037},"prehnite":{"__isSmartRef__":true,"id":15041},"debugUnmark":{"__isSmartRef__":true,"id":15045},"debugMark":{"__isSmartRef__":true,"id":15049},"citrine":{"__isSmartRef__":true,"id":15053},"move":{"__isSmartRef__":true,"id":15057},"performMovement":{"__isSmartRef__":true,"id":15061},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15065},"zircon":{"__isSmartRef__":true,"id":15069},"emerald":{"__isSmartRef__":true,"id":15073},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15077}},"14953":{"varMapping":{"__isSmartRef__":true,"id":14954},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14955},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14954":{"this":{"__isSmartRef__":true,"id":1120}},"14955":{"timestamp":{"__isSmartRef__":true,"id":14956},"user":"josi","tags":[]},"14956":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"14957":{"varMapping":{"__isSmartRef__":true,"id":14958},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":14963},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14958":{"this":{"__isSmartRef__":true,"id":1120},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":14959}},"14959":{"$super":{"__isSmartRef__":true,"id":14960}},"14960":{"varMapping":{"__isSmartRef__":true,"id":14961},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":14962},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14961":{"obj":{"__isSmartRef__":true,"id":1120},"name":"onMouseDown"},"14962":{},"14963":{"timestamp":{"__isSmartRef__":true,"id":14964},"user":"soergel","tags":[]},"14964":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"14965":{"varMapping":{"__isSmartRef__":true,"id":14966},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":14967},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14966":{"this":{"__isSmartRef__":true,"id":1120}},"14967":{"timestamp":{"__isSmartRef__":true,"id":14968},"user":"soergel","tags":[]},"14968":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"14969":{"varMapping":{"__isSmartRef__":true,"id":14970},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":14971},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14970":{"this":{"__isSmartRef__":true,"id":1120}},"14971":{"timestamp":{"__isSmartRef__":true,"id":14972},"user":"josi","tags":["gemtypes"]},"14972":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"14973":{"varMapping":{"__isSmartRef__":true,"id":14974},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":14975},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14974":{"this":{"__isSmartRef__":true,"id":1120}},"14975":{"timestamp":{"__isSmartRef__":true,"id":14976},"user":"jan.sandbrink","tags":[]},"14976":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"14977":{"varMapping":{"__isSmartRef__":true,"id":14978},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14979},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14978":{"this":{"__isSmartRef__":true,"id":1120}},"14979":{"timestamp":{"__isSmartRef__":true,"id":14980},"user":"jan.sandbrink","tags":[]},"14980":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"14981":{"varMapping":{"__isSmartRef__":true,"id":14982},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":14983},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14982":{"this":{"__isSmartRef__":true,"id":1120}},"14983":{"timestamp":{"__isSmartRef__":true,"id":14984},"user":"josi","tags":["gemtypes"]},"14984":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"14985":{"varMapping":{"__isSmartRef__":true,"id":14986},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":14987},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14986":{"this":{"__isSmartRef__":true,"id":1120}},"14987":{"timestamp":{"__isSmartRef__":true,"id":14988},"user":"josi","tags":["gemtypes"]},"14988":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"14989":{"varMapping":{"__isSmartRef__":true,"id":14990},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":14991},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14990":{"this":{"__isSmartRef__":true,"id":1120}},"14991":{"timestamp":{"__isSmartRef__":true,"id":14992},"user":"josi","tags":[]},"14992":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"14993":{"varMapping":{"__isSmartRef__":true,"id":14994},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":14995},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14994":{"this":{"__isSmartRef__":true,"id":1120}},"14995":{"timestamp":{"__isSmartRef__":true,"id":14996},"user":"josi","tags":[]},"14996":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"14997":{"varMapping":{"__isSmartRef__":true,"id":14998},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":14999},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"14998":{"this":{"__isSmartRef__":true,"id":1120}},"14999":{"timestamp":{"__isSmartRef__":true,"id":15000},"user":"soergel","tags":[]},"15000":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15001":{"varMapping":{"__isSmartRef__":true,"id":15002},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15003},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15002":{"this":{"__isSmartRef__":true,"id":1120}},"15003":{"timestamp":{"__isSmartRef__":true,"id":15004},"user":"soergel","tags":[]},"15004":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15005":{"varMapping":{"__isSmartRef__":true,"id":15006},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15007},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15006":{"this":{"__isSmartRef__":true,"id":1120}},"15007":{"timestamp":{"__isSmartRef__":true,"id":15008},"user":"soergel","tags":[]},"15008":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15009":{"varMapping":{"__isSmartRef__":true,"id":15010},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15011},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15010":{"this":{"__isSmartRef__":true,"id":1120}},"15011":{"timestamp":{"__isSmartRef__":true,"id":15012},"user":"soergel","tags":["debug"]},"15012":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15013":{"varMapping":{"__isSmartRef__":true,"id":15014},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15015},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15014":{"this":{"__isSmartRef__":true,"id":1120}},"15015":{"timestamp":{"__isSmartRef__":true,"id":15016},"user":"soergel","tags":["debug"]},"15016":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15017":{"varMapping":{"__isSmartRef__":true,"id":15018},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15019},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15018":{"this":{"__isSmartRef__":true,"id":1120}},"15019":{"timestamp":{"__isSmartRef__":true,"id":15020},"user":"jan.sandbrink","tags":[]},"15020":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15021":{"varMapping":{"__isSmartRef__":true,"id":15022},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15023},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15022":{"this":{"__isSmartRef__":true,"id":1120}},"15023":{"timestamp":{"__isSmartRef__":true,"id":15024},"user":"jan.sandbrink","tags":[]},"15024":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15025":{"varMapping":{"__isSmartRef__":true,"id":15026},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15027},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15026":{"this":{"__isSmartRef__":true,"id":1120}},"15027":{"timestamp":{"__isSmartRef__":true,"id":15028},"user":"jan.sandbrink","tags":[]},"15028":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15029":{"varMapping":{"__isSmartRef__":true,"id":15030},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15031},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15030":{"this":{"__isSmartRef__":true,"id":1120}},"15031":{"timestamp":{"__isSmartRef__":true,"id":15032},"user":"jan.sandbrink","tags":[]},"15032":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15033":{"varMapping":{"__isSmartRef__":true,"id":15034},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15035},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15034":{"this":{"__isSmartRef__":true,"id":1120}},"15035":{"timestamp":{"__isSmartRef__":true,"id":15036},"user":"jan.sandbrink","tags":[]},"15036":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15037":{"varMapping":{"__isSmartRef__":true,"id":15038},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15039},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15038":{"this":{"__isSmartRef__":true,"id":1120}},"15039":{"timestamp":{"__isSmartRef__":true,"id":15040},"user":"josi","tags":["gemtypes"]},"15040":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15041":{"varMapping":{"__isSmartRef__":true,"id":15042},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15043},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15042":{"this":{"__isSmartRef__":true,"id":1120}},"15043":{"timestamp":{"__isSmartRef__":true,"id":15044},"user":"josi","tags":["gemtypes"]},"15044":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15045":{"varMapping":{"__isSmartRef__":true,"id":15046},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15047},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15046":{"this":{"__isSmartRef__":true,"id":1120}},"15047":{"timestamp":{"__isSmartRef__":true,"id":15048},"user":"soergel","tags":["debug"]},"15048":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15049":{"varMapping":{"__isSmartRef__":true,"id":15050},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15051},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15050":{"this":{"__isSmartRef__":true,"id":1120}},"15051":{"timestamp":{"__isSmartRef__":true,"id":15052},"user":"soergel","tags":["debug"]},"15052":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15053":{"varMapping":{"__isSmartRef__":true,"id":15054},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15055},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15054":{"this":{"__isSmartRef__":true,"id":1120}},"15055":{"timestamp":{"__isSmartRef__":true,"id":15056},"user":"josi","tags":["gemtypes"]},"15056":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15057":{"varMapping":{"__isSmartRef__":true,"id":15058},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15059},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15058":{"this":{"__isSmartRef__":true,"id":1120}},"15059":{"timestamp":{"__isSmartRef__":true,"id":15060},"user":"soergel","tags":[]},"15060":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15061":{"varMapping":{"__isSmartRef__":true,"id":15062},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15063},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15062":{"this":{"__isSmartRef__":true,"id":1120}},"15063":{"timestamp":{"__isSmartRef__":true,"id":15064},"user":"soergel","tags":[]},"15064":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15065":{"varMapping":{"__isSmartRef__":true,"id":15066},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15067},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15066":{"this":{"__isSmartRef__":true,"id":1120}},"15067":{"timestamp":{"__isSmartRef__":true,"id":15068},"user":"soergel","tags":[]},"15068":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15069":{"varMapping":{"__isSmartRef__":true,"id":15070},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15071},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15070":{"this":{"__isSmartRef__":true,"id":1120}},"15071":{"timestamp":{"__isSmartRef__":true,"id":15072},"user":"josi","tags":["gemtypes"]},"15072":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15073":{"varMapping":{"__isSmartRef__":true,"id":15074},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15075},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15074":{"this":{"__isSmartRef__":true,"id":1120}},"15075":{"timestamp":{"__isSmartRef__":true,"id":15076},"user":"josi","tags":["gemtypes"]},"15076":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15077":{"varMapping":{"__isSmartRef__":true,"id":15078},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15079},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15078":{"this":{"__isSmartRef__":true,"id":1120}},"15079":{"timestamp":{"__isSmartRef__":true,"id":15080},"user":"jan.sandbrink","tags":[]},"15080":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15081":{"become":{"__isSmartRef__":true,"id":15082},"onMouseDown":{"__isSmartRef__":true,"id":15086},"updatePicture":{"__isSmartRef__":true,"id":15094},"ruby":{"__isSmartRef__":true,"id":15098},"switchPositionWith":{"__isSmartRef__":true,"id":15102},"addNeighbour":{"__isSmartRef__":true,"id":15106},"amethyst":{"__isSmartRef__":true,"id":15110},"diopside":{"__isSmartRef__":true,"id":15114},"gemTypes":{"__isSmartRef__":true,"id":15118},"becomeRandomGem":{"__isSmartRef__":true,"id":15122},"mark":{"__isSmartRef__":true,"id":15126},"unmark":{"__isSmartRef__":true,"id":15130},"hasNeighbour":{"__isSmartRef__":true,"id":15134},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15138},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15142},"disappear":{"__isSmartRef__":true,"id":15146},"findStreakStart":{"__isSmartRef__":true,"id":15150},"buildStreak":{"__isSmartRef__":true,"id":15154},"scoreStreak":{"__isSmartRef__":true,"id":15158},"tryToStreak":{"__isSmartRef__":true,"id":15162},"blueDiamond":{"__isSmartRef__":true,"id":15166},"prehnite":{"__isSmartRef__":true,"id":15170},"debugUnmark":{"__isSmartRef__":true,"id":15174},"debugMark":{"__isSmartRef__":true,"id":15178},"citrine":{"__isSmartRef__":true,"id":15182},"move":{"__isSmartRef__":true,"id":15186},"performMovement":{"__isSmartRef__":true,"id":15190},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15194},"zircon":{"__isSmartRef__":true,"id":15198},"emerald":{"__isSmartRef__":true,"id":15202},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15206}},"15082":{"varMapping":{"__isSmartRef__":true,"id":15083},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15084},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15083":{"this":{"__isSmartRef__":true,"id":985}},"15084":{"timestamp":{"__isSmartRef__":true,"id":15085},"user":"josi","tags":[]},"15085":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15086":{"varMapping":{"__isSmartRef__":true,"id":15087},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15092},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15087":{"this":{"__isSmartRef__":true,"id":985},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15088}},"15088":{"$super":{"__isSmartRef__":true,"id":15089}},"15089":{"varMapping":{"__isSmartRef__":true,"id":15090},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15091},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15090":{"obj":{"__isSmartRef__":true,"id":985},"name":"onMouseDown"},"15091":{},"15092":{"timestamp":{"__isSmartRef__":true,"id":15093},"user":"soergel","tags":[]},"15093":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15094":{"varMapping":{"__isSmartRef__":true,"id":15095},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15096},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15095":{"this":{"__isSmartRef__":true,"id":985}},"15096":{"timestamp":{"__isSmartRef__":true,"id":15097},"user":"soergel","tags":[]},"15097":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15098":{"varMapping":{"__isSmartRef__":true,"id":15099},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15100},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15099":{"this":{"__isSmartRef__":true,"id":985}},"15100":{"timestamp":{"__isSmartRef__":true,"id":15101},"user":"josi","tags":["gemtypes"]},"15101":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15102":{"varMapping":{"__isSmartRef__":true,"id":15103},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15104},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15103":{"this":{"__isSmartRef__":true,"id":985}},"15104":{"timestamp":{"__isSmartRef__":true,"id":15105},"user":"jan.sandbrink","tags":[]},"15105":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15106":{"varMapping":{"__isSmartRef__":true,"id":15107},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15108},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15107":{"this":{"__isSmartRef__":true,"id":985}},"15108":{"timestamp":{"__isSmartRef__":true,"id":15109},"user":"jan.sandbrink","tags":[]},"15109":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15110":{"varMapping":{"__isSmartRef__":true,"id":15111},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15112},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15111":{"this":{"__isSmartRef__":true,"id":985}},"15112":{"timestamp":{"__isSmartRef__":true,"id":15113},"user":"josi","tags":["gemtypes"]},"15113":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15114":{"varMapping":{"__isSmartRef__":true,"id":15115},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15116},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15115":{"this":{"__isSmartRef__":true,"id":985}},"15116":{"timestamp":{"__isSmartRef__":true,"id":15117},"user":"josi","tags":["gemtypes"]},"15117":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15118":{"varMapping":{"__isSmartRef__":true,"id":15119},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15120},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15119":{"this":{"__isSmartRef__":true,"id":985}},"15120":{"timestamp":{"__isSmartRef__":true,"id":15121},"user":"josi","tags":[]},"15121":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15122":{"varMapping":{"__isSmartRef__":true,"id":15123},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15124},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15123":{"this":{"__isSmartRef__":true,"id":985}},"15124":{"timestamp":{"__isSmartRef__":true,"id":15125},"user":"josi","tags":[]},"15125":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15126":{"varMapping":{"__isSmartRef__":true,"id":15127},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15128},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15127":{"this":{"__isSmartRef__":true,"id":985}},"15128":{"timestamp":{"__isSmartRef__":true,"id":15129},"user":"soergel","tags":[]},"15129":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15130":{"varMapping":{"__isSmartRef__":true,"id":15131},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15132},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15131":{"this":{"__isSmartRef__":true,"id":985}},"15132":{"timestamp":{"__isSmartRef__":true,"id":15133},"user":"soergel","tags":[]},"15133":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15134":{"varMapping":{"__isSmartRef__":true,"id":15135},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15136},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15135":{"this":{"__isSmartRef__":true,"id":985}},"15136":{"timestamp":{"__isSmartRef__":true,"id":15137},"user":"soergel","tags":[]},"15137":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15138":{"varMapping":{"__isSmartRef__":true,"id":15139},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15140},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15139":{"this":{"__isSmartRef__":true,"id":985}},"15140":{"timestamp":{"__isSmartRef__":true,"id":15141},"user":"soergel","tags":["debug"]},"15141":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15142":{"varMapping":{"__isSmartRef__":true,"id":15143},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15144},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15143":{"this":{"__isSmartRef__":true,"id":985}},"15144":{"timestamp":{"__isSmartRef__":true,"id":15145},"user":"soergel","tags":["debug"]},"15145":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15146":{"varMapping":{"__isSmartRef__":true,"id":15147},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15148},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15147":{"this":{"__isSmartRef__":true,"id":985}},"15148":{"timestamp":{"__isSmartRef__":true,"id":15149},"user":"jan.sandbrink","tags":[]},"15149":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15150":{"varMapping":{"__isSmartRef__":true,"id":15151},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15152},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15151":{"this":{"__isSmartRef__":true,"id":985}},"15152":{"timestamp":{"__isSmartRef__":true,"id":15153},"user":"jan.sandbrink","tags":[]},"15153":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15154":{"varMapping":{"__isSmartRef__":true,"id":15155},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15156},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15155":{"this":{"__isSmartRef__":true,"id":985}},"15156":{"timestamp":{"__isSmartRef__":true,"id":15157},"user":"jan.sandbrink","tags":[]},"15157":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15158":{"varMapping":{"__isSmartRef__":true,"id":15159},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15160},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15159":{"this":{"__isSmartRef__":true,"id":985}},"15160":{"timestamp":{"__isSmartRef__":true,"id":15161},"user":"jan.sandbrink","tags":[]},"15161":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15162":{"varMapping":{"__isSmartRef__":true,"id":15163},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15164},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15163":{"this":{"__isSmartRef__":true,"id":985}},"15164":{"timestamp":{"__isSmartRef__":true,"id":15165},"user":"jan.sandbrink","tags":[]},"15165":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15166":{"varMapping":{"__isSmartRef__":true,"id":15167},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15168},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15167":{"this":{"__isSmartRef__":true,"id":985}},"15168":{"timestamp":{"__isSmartRef__":true,"id":15169},"user":"josi","tags":["gemtypes"]},"15169":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15170":{"varMapping":{"__isSmartRef__":true,"id":15171},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15172},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15171":{"this":{"__isSmartRef__":true,"id":985}},"15172":{"timestamp":{"__isSmartRef__":true,"id":15173},"user":"josi","tags":["gemtypes"]},"15173":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15174":{"varMapping":{"__isSmartRef__":true,"id":15175},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15176},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15175":{"this":{"__isSmartRef__":true,"id":985}},"15176":{"timestamp":{"__isSmartRef__":true,"id":15177},"user":"soergel","tags":["debug"]},"15177":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15178":{"varMapping":{"__isSmartRef__":true,"id":15179},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15180},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15179":{"this":{"__isSmartRef__":true,"id":985}},"15180":{"timestamp":{"__isSmartRef__":true,"id":15181},"user":"soergel","tags":["debug"]},"15181":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15182":{"varMapping":{"__isSmartRef__":true,"id":15183},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15184},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15183":{"this":{"__isSmartRef__":true,"id":985}},"15184":{"timestamp":{"__isSmartRef__":true,"id":15185},"user":"josi","tags":["gemtypes"]},"15185":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15186":{"varMapping":{"__isSmartRef__":true,"id":15187},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15188},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15187":{"this":{"__isSmartRef__":true,"id":985}},"15188":{"timestamp":{"__isSmartRef__":true,"id":15189},"user":"soergel","tags":[]},"15189":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15190":{"varMapping":{"__isSmartRef__":true,"id":15191},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15192},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15191":{"this":{"__isSmartRef__":true,"id":985}},"15192":{"timestamp":{"__isSmartRef__":true,"id":15193},"user":"soergel","tags":[]},"15193":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15194":{"varMapping":{"__isSmartRef__":true,"id":15195},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15196},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15195":{"this":{"__isSmartRef__":true,"id":985}},"15196":{"timestamp":{"__isSmartRef__":true,"id":15197},"user":"soergel","tags":[]},"15197":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15198":{"varMapping":{"__isSmartRef__":true,"id":15199},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15200},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15199":{"this":{"__isSmartRef__":true,"id":985}},"15200":{"timestamp":{"__isSmartRef__":true,"id":15201},"user":"josi","tags":["gemtypes"]},"15201":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15202":{"varMapping":{"__isSmartRef__":true,"id":15203},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15204},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15203":{"this":{"__isSmartRef__":true,"id":985}},"15204":{"timestamp":{"__isSmartRef__":true,"id":15205},"user":"josi","tags":["gemtypes"]},"15205":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15206":{"varMapping":{"__isSmartRef__":true,"id":15207},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15208},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15207":{"this":{"__isSmartRef__":true,"id":985}},"15208":{"timestamp":{"__isSmartRef__":true,"id":15209},"user":"jan.sandbrink","tags":[]},"15209":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15210":{"become":{"__isSmartRef__":true,"id":15211},"onMouseDown":{"__isSmartRef__":true,"id":15215},"updatePicture":{"__isSmartRef__":true,"id":15223},"ruby":{"__isSmartRef__":true,"id":15227},"switchPositionWith":{"__isSmartRef__":true,"id":15231},"addNeighbour":{"__isSmartRef__":true,"id":15235},"amethyst":{"__isSmartRef__":true,"id":15239},"diopside":{"__isSmartRef__":true,"id":15243},"gemTypes":{"__isSmartRef__":true,"id":15247},"becomeRandomGem":{"__isSmartRef__":true,"id":15251},"mark":{"__isSmartRef__":true,"id":15255},"unmark":{"__isSmartRef__":true,"id":15259},"hasNeighbour":{"__isSmartRef__":true,"id":15263},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15267},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15271},"disappear":{"__isSmartRef__":true,"id":15275},"findStreakStart":{"__isSmartRef__":true,"id":15279},"buildStreak":{"__isSmartRef__":true,"id":15283},"scoreStreak":{"__isSmartRef__":true,"id":15287},"tryToStreak":{"__isSmartRef__":true,"id":15291},"blueDiamond":{"__isSmartRef__":true,"id":15295},"prehnite":{"__isSmartRef__":true,"id":15299},"debugUnmark":{"__isSmartRef__":true,"id":15303},"debugMark":{"__isSmartRef__":true,"id":15307},"citrine":{"__isSmartRef__":true,"id":15311},"move":{"__isSmartRef__":true,"id":15315},"performMovement":{"__isSmartRef__":true,"id":15319},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15323},"zircon":{"__isSmartRef__":true,"id":15327},"emerald":{"__isSmartRef__":true,"id":15331},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15335}},"15211":{"varMapping":{"__isSmartRef__":true,"id":15212},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15213},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15212":{"this":{"__isSmartRef__":true,"id":853}},"15213":{"timestamp":{"__isSmartRef__":true,"id":15214},"user":"josi","tags":[]},"15214":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15215":{"varMapping":{"__isSmartRef__":true,"id":15216},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15221},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15216":{"this":{"__isSmartRef__":true,"id":853},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15217}},"15217":{"$super":{"__isSmartRef__":true,"id":15218}},"15218":{"varMapping":{"__isSmartRef__":true,"id":15219},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15220},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15219":{"obj":{"__isSmartRef__":true,"id":853},"name":"onMouseDown"},"15220":{},"15221":{"timestamp":{"__isSmartRef__":true,"id":15222},"user":"soergel","tags":[]},"15222":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15223":{"varMapping":{"__isSmartRef__":true,"id":15224},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15225},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15224":{"this":{"__isSmartRef__":true,"id":853}},"15225":{"timestamp":{"__isSmartRef__":true,"id":15226},"user":"soergel","tags":[]},"15226":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15227":{"varMapping":{"__isSmartRef__":true,"id":15228},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15229},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15228":{"this":{"__isSmartRef__":true,"id":853}},"15229":{"timestamp":{"__isSmartRef__":true,"id":15230},"user":"josi","tags":["gemtypes"]},"15230":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15231":{"varMapping":{"__isSmartRef__":true,"id":15232},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15233},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15232":{"this":{"__isSmartRef__":true,"id":853}},"15233":{"timestamp":{"__isSmartRef__":true,"id":15234},"user":"jan.sandbrink","tags":[]},"15234":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15235":{"varMapping":{"__isSmartRef__":true,"id":15236},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15237},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15236":{"this":{"__isSmartRef__":true,"id":853}},"15237":{"timestamp":{"__isSmartRef__":true,"id":15238},"user":"jan.sandbrink","tags":[]},"15238":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15239":{"varMapping":{"__isSmartRef__":true,"id":15240},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15241},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15240":{"this":{"__isSmartRef__":true,"id":853}},"15241":{"timestamp":{"__isSmartRef__":true,"id":15242},"user":"josi","tags":["gemtypes"]},"15242":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15243":{"varMapping":{"__isSmartRef__":true,"id":15244},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15245},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15244":{"this":{"__isSmartRef__":true,"id":853}},"15245":{"timestamp":{"__isSmartRef__":true,"id":15246},"user":"josi","tags":["gemtypes"]},"15246":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15247":{"varMapping":{"__isSmartRef__":true,"id":15248},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15249},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15248":{"this":{"__isSmartRef__":true,"id":853}},"15249":{"timestamp":{"__isSmartRef__":true,"id":15250},"user":"josi","tags":[]},"15250":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15251":{"varMapping":{"__isSmartRef__":true,"id":15252},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15253},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15252":{"this":{"__isSmartRef__":true,"id":853}},"15253":{"timestamp":{"__isSmartRef__":true,"id":15254},"user":"josi","tags":[]},"15254":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15255":{"varMapping":{"__isSmartRef__":true,"id":15256},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15257},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15256":{"this":{"__isSmartRef__":true,"id":853}},"15257":{"timestamp":{"__isSmartRef__":true,"id":15258},"user":"soergel","tags":[]},"15258":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15259":{"varMapping":{"__isSmartRef__":true,"id":15260},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15261},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15260":{"this":{"__isSmartRef__":true,"id":853}},"15261":{"timestamp":{"__isSmartRef__":true,"id":15262},"user":"soergel","tags":[]},"15262":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15263":{"varMapping":{"__isSmartRef__":true,"id":15264},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15265},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15264":{"this":{"__isSmartRef__":true,"id":853}},"15265":{"timestamp":{"__isSmartRef__":true,"id":15266},"user":"soergel","tags":[]},"15266":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15267":{"varMapping":{"__isSmartRef__":true,"id":15268},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15269},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15268":{"this":{"__isSmartRef__":true,"id":853}},"15269":{"timestamp":{"__isSmartRef__":true,"id":15270},"user":"soergel","tags":["debug"]},"15270":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15271":{"varMapping":{"__isSmartRef__":true,"id":15272},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15273},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15272":{"this":{"__isSmartRef__":true,"id":853}},"15273":{"timestamp":{"__isSmartRef__":true,"id":15274},"user":"soergel","tags":["debug"]},"15274":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15275":{"varMapping":{"__isSmartRef__":true,"id":15276},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15277},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15276":{"this":{"__isSmartRef__":true,"id":853}},"15277":{"timestamp":{"__isSmartRef__":true,"id":15278},"user":"jan.sandbrink","tags":[]},"15278":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15279":{"varMapping":{"__isSmartRef__":true,"id":15280},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15281},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15280":{"this":{"__isSmartRef__":true,"id":853}},"15281":{"timestamp":{"__isSmartRef__":true,"id":15282},"user":"jan.sandbrink","tags":[]},"15282":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15283":{"varMapping":{"__isSmartRef__":true,"id":15284},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15285},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15284":{"this":{"__isSmartRef__":true,"id":853}},"15285":{"timestamp":{"__isSmartRef__":true,"id":15286},"user":"jan.sandbrink","tags":[]},"15286":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15287":{"varMapping":{"__isSmartRef__":true,"id":15288},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15289},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15288":{"this":{"__isSmartRef__":true,"id":853}},"15289":{"timestamp":{"__isSmartRef__":true,"id":15290},"user":"jan.sandbrink","tags":[]},"15290":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15291":{"varMapping":{"__isSmartRef__":true,"id":15292},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15293},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15292":{"this":{"__isSmartRef__":true,"id":853}},"15293":{"timestamp":{"__isSmartRef__":true,"id":15294},"user":"jan.sandbrink","tags":[]},"15294":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15295":{"varMapping":{"__isSmartRef__":true,"id":15296},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15297},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15296":{"this":{"__isSmartRef__":true,"id":853}},"15297":{"timestamp":{"__isSmartRef__":true,"id":15298},"user":"josi","tags":["gemtypes"]},"15298":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15299":{"varMapping":{"__isSmartRef__":true,"id":15300},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15301},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15300":{"this":{"__isSmartRef__":true,"id":853}},"15301":{"timestamp":{"__isSmartRef__":true,"id":15302},"user":"josi","tags":["gemtypes"]},"15302":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15303":{"varMapping":{"__isSmartRef__":true,"id":15304},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15305},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15304":{"this":{"__isSmartRef__":true,"id":853}},"15305":{"timestamp":{"__isSmartRef__":true,"id":15306},"user":"soergel","tags":["debug"]},"15306":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15307":{"varMapping":{"__isSmartRef__":true,"id":15308},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15309},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15308":{"this":{"__isSmartRef__":true,"id":853}},"15309":{"timestamp":{"__isSmartRef__":true,"id":15310},"user":"soergel","tags":["debug"]},"15310":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15311":{"varMapping":{"__isSmartRef__":true,"id":15312},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15313},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15312":{"this":{"__isSmartRef__":true,"id":853}},"15313":{"timestamp":{"__isSmartRef__":true,"id":15314},"user":"josi","tags":["gemtypes"]},"15314":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15315":{"varMapping":{"__isSmartRef__":true,"id":15316},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15317},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15316":{"this":{"__isSmartRef__":true,"id":853}},"15317":{"timestamp":{"__isSmartRef__":true,"id":15318},"user":"soergel","tags":[]},"15318":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15319":{"varMapping":{"__isSmartRef__":true,"id":15320},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15321},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15320":{"this":{"__isSmartRef__":true,"id":853}},"15321":{"timestamp":{"__isSmartRef__":true,"id":15322},"user":"soergel","tags":[]},"15322":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15323":{"varMapping":{"__isSmartRef__":true,"id":15324},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15325},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15324":{"this":{"__isSmartRef__":true,"id":853}},"15325":{"timestamp":{"__isSmartRef__":true,"id":15326},"user":"soergel","tags":[]},"15326":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15327":{"varMapping":{"__isSmartRef__":true,"id":15328},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15329},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15328":{"this":{"__isSmartRef__":true,"id":853}},"15329":{"timestamp":{"__isSmartRef__":true,"id":15330},"user":"josi","tags":["gemtypes"]},"15330":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15331":{"varMapping":{"__isSmartRef__":true,"id":15332},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15333},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15332":{"this":{"__isSmartRef__":true,"id":853}},"15333":{"timestamp":{"__isSmartRef__":true,"id":15334},"user":"josi","tags":["gemtypes"]},"15334":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15335":{"varMapping":{"__isSmartRef__":true,"id":15336},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15337},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15336":{"this":{"__isSmartRef__":true,"id":853}},"15337":{"timestamp":{"__isSmartRef__":true,"id":15338},"user":"jan.sandbrink","tags":[]},"15338":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15339":{"become":{"__isSmartRef__":true,"id":15340},"onMouseDown":{"__isSmartRef__":true,"id":15344},"updatePicture":{"__isSmartRef__":true,"id":15352},"ruby":{"__isSmartRef__":true,"id":15356},"switchPositionWith":{"__isSmartRef__":true,"id":15360},"addNeighbour":{"__isSmartRef__":true,"id":15364},"amethyst":{"__isSmartRef__":true,"id":15368},"diopside":{"__isSmartRef__":true,"id":15372},"gemTypes":{"__isSmartRef__":true,"id":15376},"becomeRandomGem":{"__isSmartRef__":true,"id":15380},"mark":{"__isSmartRef__":true,"id":15384},"unmark":{"__isSmartRef__":true,"id":15388},"hasNeighbour":{"__isSmartRef__":true,"id":15392},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15396},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15400},"disappear":{"__isSmartRef__":true,"id":15404},"findStreakStart":{"__isSmartRef__":true,"id":15408},"buildStreak":{"__isSmartRef__":true,"id":15412},"scoreStreak":{"__isSmartRef__":true,"id":15416},"tryToStreak":{"__isSmartRef__":true,"id":15420},"blueDiamond":{"__isSmartRef__":true,"id":15424},"prehnite":{"__isSmartRef__":true,"id":15428},"debugUnmark":{"__isSmartRef__":true,"id":15432},"debugMark":{"__isSmartRef__":true,"id":15436},"citrine":{"__isSmartRef__":true,"id":15440},"move":{"__isSmartRef__":true,"id":15444},"performMovement":{"__isSmartRef__":true,"id":15448},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15452},"zircon":{"__isSmartRef__":true,"id":15456},"emerald":{"__isSmartRef__":true,"id":15460},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15464}},"15340":{"varMapping":{"__isSmartRef__":true,"id":15341},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15342},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15341":{"this":{"__isSmartRef__":true,"id":752}},"15342":{"timestamp":{"__isSmartRef__":true,"id":15343},"user":"josi","tags":[]},"15343":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15344":{"varMapping":{"__isSmartRef__":true,"id":15345},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15350},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15345":{"this":{"__isSmartRef__":true,"id":752},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15346}},"15346":{"$super":{"__isSmartRef__":true,"id":15347}},"15347":{"varMapping":{"__isSmartRef__":true,"id":15348},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15349},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15348":{"obj":{"__isSmartRef__":true,"id":752},"name":"onMouseDown"},"15349":{},"15350":{"timestamp":{"__isSmartRef__":true,"id":15351},"user":"soergel","tags":[]},"15351":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15352":{"varMapping":{"__isSmartRef__":true,"id":15353},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15354},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15353":{"this":{"__isSmartRef__":true,"id":752}},"15354":{"timestamp":{"__isSmartRef__":true,"id":15355},"user":"soergel","tags":[]},"15355":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15356":{"varMapping":{"__isSmartRef__":true,"id":15357},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15358},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15357":{"this":{"__isSmartRef__":true,"id":752}},"15358":{"timestamp":{"__isSmartRef__":true,"id":15359},"user":"josi","tags":["gemtypes"]},"15359":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15360":{"varMapping":{"__isSmartRef__":true,"id":15361},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15362},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15361":{"this":{"__isSmartRef__":true,"id":752}},"15362":{"timestamp":{"__isSmartRef__":true,"id":15363},"user":"jan.sandbrink","tags":[]},"15363":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15364":{"varMapping":{"__isSmartRef__":true,"id":15365},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15366},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15365":{"this":{"__isSmartRef__":true,"id":752}},"15366":{"timestamp":{"__isSmartRef__":true,"id":15367},"user":"jan.sandbrink","tags":[]},"15367":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15368":{"varMapping":{"__isSmartRef__":true,"id":15369},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15370},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15369":{"this":{"__isSmartRef__":true,"id":752}},"15370":{"timestamp":{"__isSmartRef__":true,"id":15371},"user":"josi","tags":["gemtypes"]},"15371":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15372":{"varMapping":{"__isSmartRef__":true,"id":15373},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15374},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15373":{"this":{"__isSmartRef__":true,"id":752}},"15374":{"timestamp":{"__isSmartRef__":true,"id":15375},"user":"josi","tags":["gemtypes"]},"15375":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15376":{"varMapping":{"__isSmartRef__":true,"id":15377},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15378},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15377":{"this":{"__isSmartRef__":true,"id":752}},"15378":{"timestamp":{"__isSmartRef__":true,"id":15379},"user":"josi","tags":[]},"15379":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15380":{"varMapping":{"__isSmartRef__":true,"id":15381},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15382},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15381":{"this":{"__isSmartRef__":true,"id":752}},"15382":{"timestamp":{"__isSmartRef__":true,"id":15383},"user":"josi","tags":[]},"15383":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15384":{"varMapping":{"__isSmartRef__":true,"id":15385},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15386},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15385":{"this":{"__isSmartRef__":true,"id":752}},"15386":{"timestamp":{"__isSmartRef__":true,"id":15387},"user":"soergel","tags":[]},"15387":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15388":{"varMapping":{"__isSmartRef__":true,"id":15389},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15390},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15389":{"this":{"__isSmartRef__":true,"id":752}},"15390":{"timestamp":{"__isSmartRef__":true,"id":15391},"user":"soergel","tags":[]},"15391":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15392":{"varMapping":{"__isSmartRef__":true,"id":15393},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15394},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15393":{"this":{"__isSmartRef__":true,"id":752}},"15394":{"timestamp":{"__isSmartRef__":true,"id":15395},"user":"soergel","tags":[]},"15395":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15396":{"varMapping":{"__isSmartRef__":true,"id":15397},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15398},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15397":{"this":{"__isSmartRef__":true,"id":752}},"15398":{"timestamp":{"__isSmartRef__":true,"id":15399},"user":"soergel","tags":["debug"]},"15399":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15400":{"varMapping":{"__isSmartRef__":true,"id":15401},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15402},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15401":{"this":{"__isSmartRef__":true,"id":752}},"15402":{"timestamp":{"__isSmartRef__":true,"id":15403},"user":"soergel","tags":["debug"]},"15403":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15404":{"varMapping":{"__isSmartRef__":true,"id":15405},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15406},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15405":{"this":{"__isSmartRef__":true,"id":752}},"15406":{"timestamp":{"__isSmartRef__":true,"id":15407},"user":"jan.sandbrink","tags":[]},"15407":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15408":{"varMapping":{"__isSmartRef__":true,"id":15409},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15410},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15409":{"this":{"__isSmartRef__":true,"id":752}},"15410":{"timestamp":{"__isSmartRef__":true,"id":15411},"user":"jan.sandbrink","tags":[]},"15411":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15412":{"varMapping":{"__isSmartRef__":true,"id":15413},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15414},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15413":{"this":{"__isSmartRef__":true,"id":752}},"15414":{"timestamp":{"__isSmartRef__":true,"id":15415},"user":"jan.sandbrink","tags":[]},"15415":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15416":{"varMapping":{"__isSmartRef__":true,"id":15417},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15418},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15417":{"this":{"__isSmartRef__":true,"id":752}},"15418":{"timestamp":{"__isSmartRef__":true,"id":15419},"user":"jan.sandbrink","tags":[]},"15419":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15420":{"varMapping":{"__isSmartRef__":true,"id":15421},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15422},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15421":{"this":{"__isSmartRef__":true,"id":752}},"15422":{"timestamp":{"__isSmartRef__":true,"id":15423},"user":"jan.sandbrink","tags":[]},"15423":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15424":{"varMapping":{"__isSmartRef__":true,"id":15425},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15426},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15425":{"this":{"__isSmartRef__":true,"id":752}},"15426":{"timestamp":{"__isSmartRef__":true,"id":15427},"user":"josi","tags":["gemtypes"]},"15427":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15428":{"varMapping":{"__isSmartRef__":true,"id":15429},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15430},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15429":{"this":{"__isSmartRef__":true,"id":752}},"15430":{"timestamp":{"__isSmartRef__":true,"id":15431},"user":"josi","tags":["gemtypes"]},"15431":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15432":{"varMapping":{"__isSmartRef__":true,"id":15433},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15434},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15433":{"this":{"__isSmartRef__":true,"id":752}},"15434":{"timestamp":{"__isSmartRef__":true,"id":15435},"user":"soergel","tags":["debug"]},"15435":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15436":{"varMapping":{"__isSmartRef__":true,"id":15437},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15438},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15437":{"this":{"__isSmartRef__":true,"id":752}},"15438":{"timestamp":{"__isSmartRef__":true,"id":15439},"user":"soergel","tags":["debug"]},"15439":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15440":{"varMapping":{"__isSmartRef__":true,"id":15441},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15442},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15441":{"this":{"__isSmartRef__":true,"id":752}},"15442":{"timestamp":{"__isSmartRef__":true,"id":15443},"user":"josi","tags":["gemtypes"]},"15443":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15444":{"varMapping":{"__isSmartRef__":true,"id":15445},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15446},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15445":{"this":{"__isSmartRef__":true,"id":752}},"15446":{"timestamp":{"__isSmartRef__":true,"id":15447},"user":"soergel","tags":[]},"15447":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15448":{"varMapping":{"__isSmartRef__":true,"id":15449},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15450},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15449":{"this":{"__isSmartRef__":true,"id":752}},"15450":{"timestamp":{"__isSmartRef__":true,"id":15451},"user":"soergel","tags":[]},"15451":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15452":{"varMapping":{"__isSmartRef__":true,"id":15453},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15454},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15453":{"this":{"__isSmartRef__":true,"id":752}},"15454":{"timestamp":{"__isSmartRef__":true,"id":15455},"user":"soergel","tags":[]},"15455":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15456":{"varMapping":{"__isSmartRef__":true,"id":15457},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15458},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15457":{"this":{"__isSmartRef__":true,"id":752}},"15458":{"timestamp":{"__isSmartRef__":true,"id":15459},"user":"josi","tags":["gemtypes"]},"15459":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15460":{"varMapping":{"__isSmartRef__":true,"id":15461},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15462},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15461":{"this":{"__isSmartRef__":true,"id":752}},"15462":{"timestamp":{"__isSmartRef__":true,"id":15463},"user":"josi","tags":["gemtypes"]},"15463":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15464":{"varMapping":{"__isSmartRef__":true,"id":15465},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15466},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15465":{"this":{"__isSmartRef__":true,"id":752}},"15466":{"timestamp":{"__isSmartRef__":true,"id":15467},"user":"jan.sandbrink","tags":[]},"15467":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15468":{"become":{"__isSmartRef__":true,"id":15469},"onMouseDown":{"__isSmartRef__":true,"id":15473},"updatePicture":{"__isSmartRef__":true,"id":15481},"ruby":{"__isSmartRef__":true,"id":15485},"switchPositionWith":{"__isSmartRef__":true,"id":15489},"addNeighbour":{"__isSmartRef__":true,"id":15493},"amethyst":{"__isSmartRef__":true,"id":15497},"diopside":{"__isSmartRef__":true,"id":15501},"gemTypes":{"__isSmartRef__":true,"id":15505},"becomeRandomGem":{"__isSmartRef__":true,"id":15509},"mark":{"__isSmartRef__":true,"id":15513},"unmark":{"__isSmartRef__":true,"id":15517},"hasNeighbour":{"__isSmartRef__":true,"id":15521},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15525},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15529},"disappear":{"__isSmartRef__":true,"id":15533},"findStreakStart":{"__isSmartRef__":true,"id":15537},"buildStreak":{"__isSmartRef__":true,"id":15541},"scoreStreak":{"__isSmartRef__":true,"id":15545},"tryToStreak":{"__isSmartRef__":true,"id":15549},"blueDiamond":{"__isSmartRef__":true,"id":15553},"prehnite":{"__isSmartRef__":true,"id":15557},"debugUnmark":{"__isSmartRef__":true,"id":15561},"debugMark":{"__isSmartRef__":true,"id":15565},"citrine":{"__isSmartRef__":true,"id":15569},"move":{"__isSmartRef__":true,"id":15573},"performMovement":{"__isSmartRef__":true,"id":15577},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15581},"zircon":{"__isSmartRef__":true,"id":15585},"emerald":{"__isSmartRef__":true,"id":15589},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15593}},"15469":{"varMapping":{"__isSmartRef__":true,"id":15470},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15471},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15470":{"this":{"__isSmartRef__":true,"id":617}},"15471":{"timestamp":{"__isSmartRef__":true,"id":15472},"user":"josi","tags":[]},"15472":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15473":{"varMapping":{"__isSmartRef__":true,"id":15474},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15474":{"this":{"__isSmartRef__":true,"id":617},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15475}},"15475":{"$super":{"__isSmartRef__":true,"id":15476}},"15476":{"varMapping":{"__isSmartRef__":true,"id":15477},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15478},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15477":{"obj":{"__isSmartRef__":true,"id":617},"name":"onMouseDown"},"15478":{},"15479":{"timestamp":{"__isSmartRef__":true,"id":15480},"user":"soergel","tags":[]},"15480":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15481":{"varMapping":{"__isSmartRef__":true,"id":15482},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15483},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15482":{"this":{"__isSmartRef__":true,"id":617}},"15483":{"timestamp":{"__isSmartRef__":true,"id":15484},"user":"soergel","tags":[]},"15484":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15485":{"varMapping":{"__isSmartRef__":true,"id":15486},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15487},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15486":{"this":{"__isSmartRef__":true,"id":617}},"15487":{"timestamp":{"__isSmartRef__":true,"id":15488},"user":"josi","tags":["gemtypes"]},"15488":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15489":{"varMapping":{"__isSmartRef__":true,"id":15490},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15491},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15490":{"this":{"__isSmartRef__":true,"id":617}},"15491":{"timestamp":{"__isSmartRef__":true,"id":15492},"user":"jan.sandbrink","tags":[]},"15492":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15493":{"varMapping":{"__isSmartRef__":true,"id":15494},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15495},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15494":{"this":{"__isSmartRef__":true,"id":617}},"15495":{"timestamp":{"__isSmartRef__":true,"id":15496},"user":"jan.sandbrink","tags":[]},"15496":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15497":{"varMapping":{"__isSmartRef__":true,"id":15498},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15498":{"this":{"__isSmartRef__":true,"id":617}},"15499":{"timestamp":{"__isSmartRef__":true,"id":15500},"user":"josi","tags":["gemtypes"]},"15500":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15501":{"varMapping":{"__isSmartRef__":true,"id":15502},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15503},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15502":{"this":{"__isSmartRef__":true,"id":617}},"15503":{"timestamp":{"__isSmartRef__":true,"id":15504},"user":"josi","tags":["gemtypes"]},"15504":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15505":{"varMapping":{"__isSmartRef__":true,"id":15506},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15507},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15506":{"this":{"__isSmartRef__":true,"id":617}},"15507":{"timestamp":{"__isSmartRef__":true,"id":15508},"user":"josi","tags":[]},"15508":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15509":{"varMapping":{"__isSmartRef__":true,"id":15510},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15511},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15510":{"this":{"__isSmartRef__":true,"id":617}},"15511":{"timestamp":{"__isSmartRef__":true,"id":15512},"user":"josi","tags":[]},"15512":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15513":{"varMapping":{"__isSmartRef__":true,"id":15514},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15515},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15514":{"this":{"__isSmartRef__":true,"id":617}},"15515":{"timestamp":{"__isSmartRef__":true,"id":15516},"user":"soergel","tags":[]},"15516":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15517":{"varMapping":{"__isSmartRef__":true,"id":15518},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15519},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15518":{"this":{"__isSmartRef__":true,"id":617}},"15519":{"timestamp":{"__isSmartRef__":true,"id":15520},"user":"soergel","tags":[]},"15520":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15521":{"varMapping":{"__isSmartRef__":true,"id":15522},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15523},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15522":{"this":{"__isSmartRef__":true,"id":617}},"15523":{"timestamp":{"__isSmartRef__":true,"id":15524},"user":"soergel","tags":[]},"15524":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15525":{"varMapping":{"__isSmartRef__":true,"id":15526},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15527},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15526":{"this":{"__isSmartRef__":true,"id":617}},"15527":{"timestamp":{"__isSmartRef__":true,"id":15528},"user":"soergel","tags":["debug"]},"15528":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15529":{"varMapping":{"__isSmartRef__":true,"id":15530},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15531},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15530":{"this":{"__isSmartRef__":true,"id":617}},"15531":{"timestamp":{"__isSmartRef__":true,"id":15532},"user":"soergel","tags":["debug"]},"15532":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15533":{"varMapping":{"__isSmartRef__":true,"id":15534},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15535},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15534":{"this":{"__isSmartRef__":true,"id":617}},"15535":{"timestamp":{"__isSmartRef__":true,"id":15536},"user":"jan.sandbrink","tags":[]},"15536":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15537":{"varMapping":{"__isSmartRef__":true,"id":15538},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15539},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15538":{"this":{"__isSmartRef__":true,"id":617}},"15539":{"timestamp":{"__isSmartRef__":true,"id":15540},"user":"jan.sandbrink","tags":[]},"15540":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15541":{"varMapping":{"__isSmartRef__":true,"id":15542},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15543},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15542":{"this":{"__isSmartRef__":true,"id":617}},"15543":{"timestamp":{"__isSmartRef__":true,"id":15544},"user":"jan.sandbrink","tags":[]},"15544":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15545":{"varMapping":{"__isSmartRef__":true,"id":15546},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15547},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15546":{"this":{"__isSmartRef__":true,"id":617}},"15547":{"timestamp":{"__isSmartRef__":true,"id":15548},"user":"jan.sandbrink","tags":[]},"15548":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15549":{"varMapping":{"__isSmartRef__":true,"id":15550},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15551},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15550":{"this":{"__isSmartRef__":true,"id":617}},"15551":{"timestamp":{"__isSmartRef__":true,"id":15552},"user":"jan.sandbrink","tags":[]},"15552":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15553":{"varMapping":{"__isSmartRef__":true,"id":15554},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15555},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15554":{"this":{"__isSmartRef__":true,"id":617}},"15555":{"timestamp":{"__isSmartRef__":true,"id":15556},"user":"josi","tags":["gemtypes"]},"15556":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15557":{"varMapping":{"__isSmartRef__":true,"id":15558},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15559},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15558":{"this":{"__isSmartRef__":true,"id":617}},"15559":{"timestamp":{"__isSmartRef__":true,"id":15560},"user":"josi","tags":["gemtypes"]},"15560":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15561":{"varMapping":{"__isSmartRef__":true,"id":15562},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15563},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15562":{"this":{"__isSmartRef__":true,"id":617}},"15563":{"timestamp":{"__isSmartRef__":true,"id":15564},"user":"soergel","tags":["debug"]},"15564":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15565":{"varMapping":{"__isSmartRef__":true,"id":15566},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15567},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15566":{"this":{"__isSmartRef__":true,"id":617}},"15567":{"timestamp":{"__isSmartRef__":true,"id":15568},"user":"soergel","tags":["debug"]},"15568":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15569":{"varMapping":{"__isSmartRef__":true,"id":15570},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15571},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15570":{"this":{"__isSmartRef__":true,"id":617}},"15571":{"timestamp":{"__isSmartRef__":true,"id":15572},"user":"josi","tags":["gemtypes"]},"15572":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15573":{"varMapping":{"__isSmartRef__":true,"id":15574},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15575},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15574":{"this":{"__isSmartRef__":true,"id":617}},"15575":{"timestamp":{"__isSmartRef__":true,"id":15576},"user":"soergel","tags":[]},"15576":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15577":{"varMapping":{"__isSmartRef__":true,"id":15578},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15579},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15578":{"this":{"__isSmartRef__":true,"id":617}},"15579":{"timestamp":{"__isSmartRef__":true,"id":15580},"user":"soergel","tags":[]},"15580":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15581":{"varMapping":{"__isSmartRef__":true,"id":15582},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15583},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15582":{"this":{"__isSmartRef__":true,"id":617}},"15583":{"timestamp":{"__isSmartRef__":true,"id":15584},"user":"soergel","tags":[]},"15584":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15585":{"varMapping":{"__isSmartRef__":true,"id":15586},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15587},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15586":{"this":{"__isSmartRef__":true,"id":617}},"15587":{"timestamp":{"__isSmartRef__":true,"id":15588},"user":"josi","tags":["gemtypes"]},"15588":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15589":{"varMapping":{"__isSmartRef__":true,"id":15590},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15591},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15590":{"this":{"__isSmartRef__":true,"id":617}},"15591":{"timestamp":{"__isSmartRef__":true,"id":15592},"user":"josi","tags":["gemtypes"]},"15592":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15593":{"varMapping":{"__isSmartRef__":true,"id":15594},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15595},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15594":{"this":{"__isSmartRef__":true,"id":617}},"15595":{"timestamp":{"__isSmartRef__":true,"id":15596},"user":"jan.sandbrink","tags":[]},"15596":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15597":{"become":{"__isSmartRef__":true,"id":15598},"onMouseDown":{"__isSmartRef__":true,"id":15602},"updatePicture":{"__isSmartRef__":true,"id":15610},"ruby":{"__isSmartRef__":true,"id":15614},"switchPositionWith":{"__isSmartRef__":true,"id":15618},"addNeighbour":{"__isSmartRef__":true,"id":15622},"amethyst":{"__isSmartRef__":true,"id":15626},"diopside":{"__isSmartRef__":true,"id":15630},"gemTypes":{"__isSmartRef__":true,"id":15634},"becomeRandomGem":{"__isSmartRef__":true,"id":15638},"mark":{"__isSmartRef__":true,"id":15642},"unmark":{"__isSmartRef__":true,"id":15646},"hasNeighbour":{"__isSmartRef__":true,"id":15650},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15654},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15658},"disappear":{"__isSmartRef__":true,"id":15662},"findStreakStart":{"__isSmartRef__":true,"id":15666},"buildStreak":{"__isSmartRef__":true,"id":15670},"scoreStreak":{"__isSmartRef__":true,"id":15674},"tryToStreak":{"__isSmartRef__":true,"id":15678},"blueDiamond":{"__isSmartRef__":true,"id":15682},"prehnite":{"__isSmartRef__":true,"id":15686},"debugUnmark":{"__isSmartRef__":true,"id":15690},"debugMark":{"__isSmartRef__":true,"id":15694},"citrine":{"__isSmartRef__":true,"id":15698},"move":{"__isSmartRef__":true,"id":15702},"performMovement":{"__isSmartRef__":true,"id":15706},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15710},"zircon":{"__isSmartRef__":true,"id":15714},"emerald":{"__isSmartRef__":true,"id":15718},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15722}},"15598":{"varMapping":{"__isSmartRef__":true,"id":15599},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15600},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15599":{"this":{"__isSmartRef__":true,"id":490}},"15600":{"timestamp":{"__isSmartRef__":true,"id":15601},"user":"josi","tags":[]},"15601":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15602":{"varMapping":{"__isSmartRef__":true,"id":15603},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15608},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15603":{"this":{"__isSmartRef__":true,"id":490},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15604}},"15604":{"$super":{"__isSmartRef__":true,"id":15605}},"15605":{"varMapping":{"__isSmartRef__":true,"id":15606},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15607},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15606":{"obj":{"__isSmartRef__":true,"id":490},"name":"onMouseDown"},"15607":{},"15608":{"timestamp":{"__isSmartRef__":true,"id":15609},"user":"soergel","tags":[]},"15609":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15610":{"varMapping":{"__isSmartRef__":true,"id":15611},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15612},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15611":{"this":{"__isSmartRef__":true,"id":490}},"15612":{"timestamp":{"__isSmartRef__":true,"id":15613},"user":"soergel","tags":[]},"15613":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15614":{"varMapping":{"__isSmartRef__":true,"id":15615},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15616},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15615":{"this":{"__isSmartRef__":true,"id":490}},"15616":{"timestamp":{"__isSmartRef__":true,"id":15617},"user":"josi","tags":["gemtypes"]},"15617":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15618":{"varMapping":{"__isSmartRef__":true,"id":15619},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15620},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15619":{"this":{"__isSmartRef__":true,"id":490}},"15620":{"timestamp":{"__isSmartRef__":true,"id":15621},"user":"jan.sandbrink","tags":[]},"15621":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15622":{"varMapping":{"__isSmartRef__":true,"id":15623},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15624},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15623":{"this":{"__isSmartRef__":true,"id":490}},"15624":{"timestamp":{"__isSmartRef__":true,"id":15625},"user":"jan.sandbrink","tags":[]},"15625":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15626":{"varMapping":{"__isSmartRef__":true,"id":15627},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15628},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15627":{"this":{"__isSmartRef__":true,"id":490}},"15628":{"timestamp":{"__isSmartRef__":true,"id":15629},"user":"josi","tags":["gemtypes"]},"15629":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15630":{"varMapping":{"__isSmartRef__":true,"id":15631},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15632},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15631":{"this":{"__isSmartRef__":true,"id":490}},"15632":{"timestamp":{"__isSmartRef__":true,"id":15633},"user":"josi","tags":["gemtypes"]},"15633":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15634":{"varMapping":{"__isSmartRef__":true,"id":15635},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15636},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15635":{"this":{"__isSmartRef__":true,"id":490}},"15636":{"timestamp":{"__isSmartRef__":true,"id":15637},"user":"josi","tags":[]},"15637":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15638":{"varMapping":{"__isSmartRef__":true,"id":15639},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15640},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15639":{"this":{"__isSmartRef__":true,"id":490}},"15640":{"timestamp":{"__isSmartRef__":true,"id":15641},"user":"josi","tags":[]},"15641":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15642":{"varMapping":{"__isSmartRef__":true,"id":15643},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15644},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15643":{"this":{"__isSmartRef__":true,"id":490}},"15644":{"timestamp":{"__isSmartRef__":true,"id":15645},"user":"soergel","tags":[]},"15645":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15646":{"varMapping":{"__isSmartRef__":true,"id":15647},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15648},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15647":{"this":{"__isSmartRef__":true,"id":490}},"15648":{"timestamp":{"__isSmartRef__":true,"id":15649},"user":"soergel","tags":[]},"15649":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15650":{"varMapping":{"__isSmartRef__":true,"id":15651},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15652},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15651":{"this":{"__isSmartRef__":true,"id":490}},"15652":{"timestamp":{"__isSmartRef__":true,"id":15653},"user":"soergel","tags":[]},"15653":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15654":{"varMapping":{"__isSmartRef__":true,"id":15655},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15656},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15655":{"this":{"__isSmartRef__":true,"id":490}},"15656":{"timestamp":{"__isSmartRef__":true,"id":15657},"user":"soergel","tags":["debug"]},"15657":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15658":{"varMapping":{"__isSmartRef__":true,"id":15659},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15660},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15659":{"this":{"__isSmartRef__":true,"id":490}},"15660":{"timestamp":{"__isSmartRef__":true,"id":15661},"user":"soergel","tags":["debug"]},"15661":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15662":{"varMapping":{"__isSmartRef__":true,"id":15663},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15664},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15663":{"this":{"__isSmartRef__":true,"id":490}},"15664":{"timestamp":{"__isSmartRef__":true,"id":15665},"user":"jan.sandbrink","tags":[]},"15665":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15666":{"varMapping":{"__isSmartRef__":true,"id":15667},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15668},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15667":{"this":{"__isSmartRef__":true,"id":490}},"15668":{"timestamp":{"__isSmartRef__":true,"id":15669},"user":"jan.sandbrink","tags":[]},"15669":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15670":{"varMapping":{"__isSmartRef__":true,"id":15671},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15672},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15671":{"this":{"__isSmartRef__":true,"id":490}},"15672":{"timestamp":{"__isSmartRef__":true,"id":15673},"user":"jan.sandbrink","tags":[]},"15673":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15674":{"varMapping":{"__isSmartRef__":true,"id":15675},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15676},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15675":{"this":{"__isSmartRef__":true,"id":490}},"15676":{"timestamp":{"__isSmartRef__":true,"id":15677},"user":"jan.sandbrink","tags":[]},"15677":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15678":{"varMapping":{"__isSmartRef__":true,"id":15679},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15680},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15679":{"this":{"__isSmartRef__":true,"id":490}},"15680":{"timestamp":{"__isSmartRef__":true,"id":15681},"user":"jan.sandbrink","tags":[]},"15681":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15682":{"varMapping":{"__isSmartRef__":true,"id":15683},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15684},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15683":{"this":{"__isSmartRef__":true,"id":490}},"15684":{"timestamp":{"__isSmartRef__":true,"id":15685},"user":"josi","tags":["gemtypes"]},"15685":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15686":{"varMapping":{"__isSmartRef__":true,"id":15687},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15688},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15687":{"this":{"__isSmartRef__":true,"id":490}},"15688":{"timestamp":{"__isSmartRef__":true,"id":15689},"user":"josi","tags":["gemtypes"]},"15689":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15690":{"varMapping":{"__isSmartRef__":true,"id":15691},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15692},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15691":{"this":{"__isSmartRef__":true,"id":490}},"15692":{"timestamp":{"__isSmartRef__":true,"id":15693},"user":"soergel","tags":["debug"]},"15693":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15694":{"varMapping":{"__isSmartRef__":true,"id":15695},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15696},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15695":{"this":{"__isSmartRef__":true,"id":490}},"15696":{"timestamp":{"__isSmartRef__":true,"id":15697},"user":"soergel","tags":["debug"]},"15697":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15698":{"varMapping":{"__isSmartRef__":true,"id":15699},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15700},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15699":{"this":{"__isSmartRef__":true,"id":490}},"15700":{"timestamp":{"__isSmartRef__":true,"id":15701},"user":"josi","tags":["gemtypes"]},"15701":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15702":{"varMapping":{"__isSmartRef__":true,"id":15703},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15704},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15703":{"this":{"__isSmartRef__":true,"id":490}},"15704":{"timestamp":{"__isSmartRef__":true,"id":15705},"user":"soergel","tags":[]},"15705":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15706":{"varMapping":{"__isSmartRef__":true,"id":15707},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15708},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15707":{"this":{"__isSmartRef__":true,"id":490}},"15708":{"timestamp":{"__isSmartRef__":true,"id":15709},"user":"soergel","tags":[]},"15709":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15710":{"varMapping":{"__isSmartRef__":true,"id":15711},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15712},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15711":{"this":{"__isSmartRef__":true,"id":490}},"15712":{"timestamp":{"__isSmartRef__":true,"id":15713},"user":"soergel","tags":[]},"15713":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15714":{"varMapping":{"__isSmartRef__":true,"id":15715},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15716},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15715":{"this":{"__isSmartRef__":true,"id":490}},"15716":{"timestamp":{"__isSmartRef__":true,"id":15717},"user":"josi","tags":["gemtypes"]},"15717":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15718":{"varMapping":{"__isSmartRef__":true,"id":15719},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15720},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15719":{"this":{"__isSmartRef__":true,"id":490}},"15720":{"timestamp":{"__isSmartRef__":true,"id":15721},"user":"josi","tags":["gemtypes"]},"15721":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15722":{"varMapping":{"__isSmartRef__":true,"id":15723},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15724},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15723":{"this":{"__isSmartRef__":true,"id":490}},"15724":{"timestamp":{"__isSmartRef__":true,"id":15725},"user":"jan.sandbrink","tags":[]},"15725":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15726":{"become":{"__isSmartRef__":true,"id":15727},"onMouseDown":{"__isSmartRef__":true,"id":15731},"updatePicture":{"__isSmartRef__":true,"id":15739},"ruby":{"__isSmartRef__":true,"id":15743},"switchPositionWith":{"__isSmartRef__":true,"id":15747},"addNeighbour":{"__isSmartRef__":true,"id":15751},"amethyst":{"__isSmartRef__":true,"id":15755},"diopside":{"__isSmartRef__":true,"id":15759},"gemTypes":{"__isSmartRef__":true,"id":15763},"becomeRandomGem":{"__isSmartRef__":true,"id":15767},"mark":{"__isSmartRef__":true,"id":15771},"unmark":{"__isSmartRef__":true,"id":15775},"hasNeighbour":{"__isSmartRef__":true,"id":15779},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15783},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15787},"disappear":{"__isSmartRef__":true,"id":15791},"findStreakStart":{"__isSmartRef__":true,"id":15795},"buildStreak":{"__isSmartRef__":true,"id":15799},"scoreStreak":{"__isSmartRef__":true,"id":15803},"tryToStreak":{"__isSmartRef__":true,"id":15807},"blueDiamond":{"__isSmartRef__":true,"id":15811},"prehnite":{"__isSmartRef__":true,"id":15815},"debugUnmark":{"__isSmartRef__":true,"id":15819},"debugMark":{"__isSmartRef__":true,"id":15823},"citrine":{"__isSmartRef__":true,"id":15827},"move":{"__isSmartRef__":true,"id":15831},"performMovement":{"__isSmartRef__":true,"id":15835},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15839},"zircon":{"__isSmartRef__":true,"id":15843},"emerald":{"__isSmartRef__":true,"id":15847},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15851}},"15727":{"varMapping":{"__isSmartRef__":true,"id":15728},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15729},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15728":{"this":{"__isSmartRef__":true,"id":372}},"15729":{"timestamp":{"__isSmartRef__":true,"id":15730},"user":"josi","tags":[]},"15730":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15731":{"varMapping":{"__isSmartRef__":true,"id":15732},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15737},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15732":{"this":{"__isSmartRef__":true,"id":372},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15733}},"15733":{"$super":{"__isSmartRef__":true,"id":15734}},"15734":{"varMapping":{"__isSmartRef__":true,"id":15735},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15736},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15735":{"obj":{"__isSmartRef__":true,"id":372},"name":"onMouseDown"},"15736":{},"15737":{"timestamp":{"__isSmartRef__":true,"id":15738},"user":"soergel","tags":[]},"15738":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15739":{"varMapping":{"__isSmartRef__":true,"id":15740},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15741},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15740":{"this":{"__isSmartRef__":true,"id":372}},"15741":{"timestamp":{"__isSmartRef__":true,"id":15742},"user":"soergel","tags":[]},"15742":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15743":{"varMapping":{"__isSmartRef__":true,"id":15744},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15745},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15744":{"this":{"__isSmartRef__":true,"id":372}},"15745":{"timestamp":{"__isSmartRef__":true,"id":15746},"user":"josi","tags":["gemtypes"]},"15746":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15747":{"varMapping":{"__isSmartRef__":true,"id":15748},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15749},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15748":{"this":{"__isSmartRef__":true,"id":372}},"15749":{"timestamp":{"__isSmartRef__":true,"id":15750},"user":"jan.sandbrink","tags":[]},"15750":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15751":{"varMapping":{"__isSmartRef__":true,"id":15752},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15753},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15752":{"this":{"__isSmartRef__":true,"id":372}},"15753":{"timestamp":{"__isSmartRef__":true,"id":15754},"user":"jan.sandbrink","tags":[]},"15754":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15755":{"varMapping":{"__isSmartRef__":true,"id":15756},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15757},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15756":{"this":{"__isSmartRef__":true,"id":372}},"15757":{"timestamp":{"__isSmartRef__":true,"id":15758},"user":"josi","tags":["gemtypes"]},"15758":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15759":{"varMapping":{"__isSmartRef__":true,"id":15760},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15761},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15760":{"this":{"__isSmartRef__":true,"id":372}},"15761":{"timestamp":{"__isSmartRef__":true,"id":15762},"user":"josi","tags":["gemtypes"]},"15762":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15763":{"varMapping":{"__isSmartRef__":true,"id":15764},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15765},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15764":{"this":{"__isSmartRef__":true,"id":372}},"15765":{"timestamp":{"__isSmartRef__":true,"id":15766},"user":"josi","tags":[]},"15766":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15767":{"varMapping":{"__isSmartRef__":true,"id":15768},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15769},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15768":{"this":{"__isSmartRef__":true,"id":372}},"15769":{"timestamp":{"__isSmartRef__":true,"id":15770},"user":"josi","tags":[]},"15770":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15771":{"varMapping":{"__isSmartRef__":true,"id":15772},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15773},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15772":{"this":{"__isSmartRef__":true,"id":372}},"15773":{"timestamp":{"__isSmartRef__":true,"id":15774},"user":"soergel","tags":[]},"15774":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15775":{"varMapping":{"__isSmartRef__":true,"id":15776},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15777},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15776":{"this":{"__isSmartRef__":true,"id":372}},"15777":{"timestamp":{"__isSmartRef__":true,"id":15778},"user":"soergel","tags":[]},"15778":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15779":{"varMapping":{"__isSmartRef__":true,"id":15780},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15781},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15780":{"this":{"__isSmartRef__":true,"id":372}},"15781":{"timestamp":{"__isSmartRef__":true,"id":15782},"user":"soergel","tags":[]},"15782":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15783":{"varMapping":{"__isSmartRef__":true,"id":15784},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15785},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15784":{"this":{"__isSmartRef__":true,"id":372}},"15785":{"timestamp":{"__isSmartRef__":true,"id":15786},"user":"soergel","tags":["debug"]},"15786":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15787":{"varMapping":{"__isSmartRef__":true,"id":15788},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15789},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15788":{"this":{"__isSmartRef__":true,"id":372}},"15789":{"timestamp":{"__isSmartRef__":true,"id":15790},"user":"soergel","tags":["debug"]},"15790":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15791":{"varMapping":{"__isSmartRef__":true,"id":15792},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15793},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15792":{"this":{"__isSmartRef__":true,"id":372}},"15793":{"timestamp":{"__isSmartRef__":true,"id":15794},"user":"jan.sandbrink","tags":[]},"15794":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15795":{"varMapping":{"__isSmartRef__":true,"id":15796},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15797},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15796":{"this":{"__isSmartRef__":true,"id":372}},"15797":{"timestamp":{"__isSmartRef__":true,"id":15798},"user":"jan.sandbrink","tags":[]},"15798":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15799":{"varMapping":{"__isSmartRef__":true,"id":15800},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15801},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15800":{"this":{"__isSmartRef__":true,"id":372}},"15801":{"timestamp":{"__isSmartRef__":true,"id":15802},"user":"jan.sandbrink","tags":[]},"15802":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15803":{"varMapping":{"__isSmartRef__":true,"id":15804},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15805},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15804":{"this":{"__isSmartRef__":true,"id":372}},"15805":{"timestamp":{"__isSmartRef__":true,"id":15806},"user":"jan.sandbrink","tags":[]},"15806":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15807":{"varMapping":{"__isSmartRef__":true,"id":15808},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15809},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15808":{"this":{"__isSmartRef__":true,"id":372}},"15809":{"timestamp":{"__isSmartRef__":true,"id":15810},"user":"jan.sandbrink","tags":[]},"15810":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15811":{"varMapping":{"__isSmartRef__":true,"id":15812},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15813},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15812":{"this":{"__isSmartRef__":true,"id":372}},"15813":{"timestamp":{"__isSmartRef__":true,"id":15814},"user":"josi","tags":["gemtypes"]},"15814":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15815":{"varMapping":{"__isSmartRef__":true,"id":15816},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15817},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15816":{"this":{"__isSmartRef__":true,"id":372}},"15817":{"timestamp":{"__isSmartRef__":true,"id":15818},"user":"josi","tags":["gemtypes"]},"15818":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15819":{"varMapping":{"__isSmartRef__":true,"id":15820},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15821},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15820":{"this":{"__isSmartRef__":true,"id":372}},"15821":{"timestamp":{"__isSmartRef__":true,"id":15822},"user":"soergel","tags":["debug"]},"15822":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15823":{"varMapping":{"__isSmartRef__":true,"id":15824},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15825},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15824":{"this":{"__isSmartRef__":true,"id":372}},"15825":{"timestamp":{"__isSmartRef__":true,"id":15826},"user":"soergel","tags":["debug"]},"15826":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15827":{"varMapping":{"__isSmartRef__":true,"id":15828},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15829},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15828":{"this":{"__isSmartRef__":true,"id":372}},"15829":{"timestamp":{"__isSmartRef__":true,"id":15830},"user":"josi","tags":["gemtypes"]},"15830":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15831":{"varMapping":{"__isSmartRef__":true,"id":15832},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15833},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15832":{"this":{"__isSmartRef__":true,"id":372}},"15833":{"timestamp":{"__isSmartRef__":true,"id":15834},"user":"soergel","tags":[]},"15834":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15835":{"varMapping":{"__isSmartRef__":true,"id":15836},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15837},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15836":{"this":{"__isSmartRef__":true,"id":372}},"15837":{"timestamp":{"__isSmartRef__":true,"id":15838},"user":"soergel","tags":[]},"15838":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15839":{"varMapping":{"__isSmartRef__":true,"id":15840},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15841},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15840":{"this":{"__isSmartRef__":true,"id":372}},"15841":{"timestamp":{"__isSmartRef__":true,"id":15842},"user":"soergel","tags":[]},"15842":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15843":{"varMapping":{"__isSmartRef__":true,"id":15844},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15845},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15844":{"this":{"__isSmartRef__":true,"id":372}},"15845":{"timestamp":{"__isSmartRef__":true,"id":15846},"user":"josi","tags":["gemtypes"]},"15846":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15847":{"varMapping":{"__isSmartRef__":true,"id":15848},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15849},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15848":{"this":{"__isSmartRef__":true,"id":372}},"15849":{"timestamp":{"__isSmartRef__":true,"id":15850},"user":"josi","tags":["gemtypes"]},"15850":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15851":{"varMapping":{"__isSmartRef__":true,"id":15852},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15853},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15852":{"this":{"__isSmartRef__":true,"id":372}},"15853":{"timestamp":{"__isSmartRef__":true,"id":15854},"user":"jan.sandbrink","tags":[]},"15854":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15855":{"become":{"__isSmartRef__":true,"id":15856},"onMouseDown":{"__isSmartRef__":true,"id":15860},"updatePicture":{"__isSmartRef__":true,"id":15868},"ruby":{"__isSmartRef__":true,"id":15872},"switchPositionWith":{"__isSmartRef__":true,"id":15876},"addNeighbour":{"__isSmartRef__":true,"id":15880},"amethyst":{"__isSmartRef__":true,"id":15884},"diopside":{"__isSmartRef__":true,"id":15888},"gemTypes":{"__isSmartRef__":true,"id":15892},"becomeRandomGem":{"__isSmartRef__":true,"id":15896},"mark":{"__isSmartRef__":true,"id":15900},"unmark":{"__isSmartRef__":true,"id":15904},"hasNeighbour":{"__isSmartRef__":true,"id":15908},"debugMarkNeighbours":{"__isSmartRef__":true,"id":15912},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":15916},"disappear":{"__isSmartRef__":true,"id":15920},"findStreakStart":{"__isSmartRef__":true,"id":15924},"buildStreak":{"__isSmartRef__":true,"id":15928},"scoreStreak":{"__isSmartRef__":true,"id":15932},"tryToStreak":{"__isSmartRef__":true,"id":15936},"blueDiamond":{"__isSmartRef__":true,"id":15940},"prehnite":{"__isSmartRef__":true,"id":15944},"debugUnmark":{"__isSmartRef__":true,"id":15948},"debugMark":{"__isSmartRef__":true,"id":15952},"citrine":{"__isSmartRef__":true,"id":15956},"move":{"__isSmartRef__":true,"id":15960},"performMovement":{"__isSmartRef__":true,"id":15964},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":15968},"zircon":{"__isSmartRef__":true,"id":15972},"emerald":{"__isSmartRef__":true,"id":15976},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":15980}},"15856":{"varMapping":{"__isSmartRef__":true,"id":15857},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15858},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15857":{"this":{"__isSmartRef__":true,"id":237}},"15858":{"timestamp":{"__isSmartRef__":true,"id":15859},"user":"josi","tags":[]},"15859":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15860":{"varMapping":{"__isSmartRef__":true,"id":15861},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15866},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15861":{"this":{"__isSmartRef__":true,"id":237},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15862}},"15862":{"$super":{"__isSmartRef__":true,"id":15863}},"15863":{"varMapping":{"__isSmartRef__":true,"id":15864},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15865},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15864":{"obj":{"__isSmartRef__":true,"id":237},"name":"onMouseDown"},"15865":{},"15866":{"timestamp":{"__isSmartRef__":true,"id":15867},"user":"soergel","tags":[]},"15867":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15868":{"varMapping":{"__isSmartRef__":true,"id":15869},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15870},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15869":{"this":{"__isSmartRef__":true,"id":237}},"15870":{"timestamp":{"__isSmartRef__":true,"id":15871},"user":"soergel","tags":[]},"15871":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"15872":{"varMapping":{"__isSmartRef__":true,"id":15873},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":15874},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15873":{"this":{"__isSmartRef__":true,"id":237}},"15874":{"timestamp":{"__isSmartRef__":true,"id":15875},"user":"josi","tags":["gemtypes"]},"15875":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"15876":{"varMapping":{"__isSmartRef__":true,"id":15877},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15878},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15877":{"this":{"__isSmartRef__":true,"id":237}},"15878":{"timestamp":{"__isSmartRef__":true,"id":15879},"user":"jan.sandbrink","tags":[]},"15879":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"15880":{"varMapping":{"__isSmartRef__":true,"id":15881},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15882},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15881":{"this":{"__isSmartRef__":true,"id":237}},"15882":{"timestamp":{"__isSmartRef__":true,"id":15883},"user":"jan.sandbrink","tags":[]},"15883":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"15884":{"varMapping":{"__isSmartRef__":true,"id":15885},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":15886},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15885":{"this":{"__isSmartRef__":true,"id":237}},"15886":{"timestamp":{"__isSmartRef__":true,"id":15887},"user":"josi","tags":["gemtypes"]},"15887":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"15888":{"varMapping":{"__isSmartRef__":true,"id":15889},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":15890},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15889":{"this":{"__isSmartRef__":true,"id":237}},"15890":{"timestamp":{"__isSmartRef__":true,"id":15891},"user":"josi","tags":["gemtypes"]},"15891":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"15892":{"varMapping":{"__isSmartRef__":true,"id":15893},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":15894},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15893":{"this":{"__isSmartRef__":true,"id":237}},"15894":{"timestamp":{"__isSmartRef__":true,"id":15895},"user":"josi","tags":[]},"15895":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"15896":{"varMapping":{"__isSmartRef__":true,"id":15897},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":15898},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15897":{"this":{"__isSmartRef__":true,"id":237}},"15898":{"timestamp":{"__isSmartRef__":true,"id":15899},"user":"josi","tags":[]},"15899":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"15900":{"varMapping":{"__isSmartRef__":true,"id":15901},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":15902},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15901":{"this":{"__isSmartRef__":true,"id":237}},"15902":{"timestamp":{"__isSmartRef__":true,"id":15903},"user":"soergel","tags":[]},"15903":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"15904":{"varMapping":{"__isSmartRef__":true,"id":15905},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":15906},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15905":{"this":{"__isSmartRef__":true,"id":237}},"15906":{"timestamp":{"__isSmartRef__":true,"id":15907},"user":"soergel","tags":[]},"15907":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"15908":{"varMapping":{"__isSmartRef__":true,"id":15909},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":15910},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15909":{"this":{"__isSmartRef__":true,"id":237}},"15910":{"timestamp":{"__isSmartRef__":true,"id":15911},"user":"soergel","tags":[]},"15911":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"15912":{"varMapping":{"__isSmartRef__":true,"id":15913},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15914},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15913":{"this":{"__isSmartRef__":true,"id":237}},"15914":{"timestamp":{"__isSmartRef__":true,"id":15915},"user":"soergel","tags":["debug"]},"15915":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"15916":{"varMapping":{"__isSmartRef__":true,"id":15917},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":15918},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15917":{"this":{"__isSmartRef__":true,"id":237}},"15918":{"timestamp":{"__isSmartRef__":true,"id":15919},"user":"soergel","tags":["debug"]},"15919":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"15920":{"varMapping":{"__isSmartRef__":true,"id":15921},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":15922},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15921":{"this":{"__isSmartRef__":true,"id":237}},"15922":{"timestamp":{"__isSmartRef__":true,"id":15923},"user":"jan.sandbrink","tags":[]},"15923":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"15924":{"varMapping":{"__isSmartRef__":true,"id":15925},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15926},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15925":{"this":{"__isSmartRef__":true,"id":237}},"15926":{"timestamp":{"__isSmartRef__":true,"id":15927},"user":"jan.sandbrink","tags":[]},"15927":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"15928":{"varMapping":{"__isSmartRef__":true,"id":15929},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":15930},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15929":{"this":{"__isSmartRef__":true,"id":237}},"15930":{"timestamp":{"__isSmartRef__":true,"id":15931},"user":"jan.sandbrink","tags":[]},"15931":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"15932":{"varMapping":{"__isSmartRef__":true,"id":15933},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":15934},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15933":{"this":{"__isSmartRef__":true,"id":237}},"15934":{"timestamp":{"__isSmartRef__":true,"id":15935},"user":"jan.sandbrink","tags":[]},"15935":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"15936":{"varMapping":{"__isSmartRef__":true,"id":15937},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":15938},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15937":{"this":{"__isSmartRef__":true,"id":237}},"15938":{"timestamp":{"__isSmartRef__":true,"id":15939},"user":"jan.sandbrink","tags":[]},"15939":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"15940":{"varMapping":{"__isSmartRef__":true,"id":15941},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":15942},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15941":{"this":{"__isSmartRef__":true,"id":237}},"15942":{"timestamp":{"__isSmartRef__":true,"id":15943},"user":"josi","tags":["gemtypes"]},"15943":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"15944":{"varMapping":{"__isSmartRef__":true,"id":15945},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":15946},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15945":{"this":{"__isSmartRef__":true,"id":237}},"15946":{"timestamp":{"__isSmartRef__":true,"id":15947},"user":"josi","tags":["gemtypes"]},"15947":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"15948":{"varMapping":{"__isSmartRef__":true,"id":15949},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":15950},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15949":{"this":{"__isSmartRef__":true,"id":237}},"15950":{"timestamp":{"__isSmartRef__":true,"id":15951},"user":"soergel","tags":["debug"]},"15951":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"15952":{"varMapping":{"__isSmartRef__":true,"id":15953},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":15954},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15953":{"this":{"__isSmartRef__":true,"id":237}},"15954":{"timestamp":{"__isSmartRef__":true,"id":15955},"user":"soergel","tags":["debug"]},"15955":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"15956":{"varMapping":{"__isSmartRef__":true,"id":15957},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":15958},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15957":{"this":{"__isSmartRef__":true,"id":237}},"15958":{"timestamp":{"__isSmartRef__":true,"id":15959},"user":"josi","tags":["gemtypes"]},"15959":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"15960":{"varMapping":{"__isSmartRef__":true,"id":15961},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":15962},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15961":{"this":{"__isSmartRef__":true,"id":237}},"15962":{"timestamp":{"__isSmartRef__":true,"id":15963},"user":"soergel","tags":[]},"15963":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"15964":{"varMapping":{"__isSmartRef__":true,"id":15965},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":15966},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15965":{"this":{"__isSmartRef__":true,"id":237}},"15966":{"timestamp":{"__isSmartRef__":true,"id":15967},"user":"soergel","tags":[]},"15967":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"15968":{"varMapping":{"__isSmartRef__":true,"id":15969},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":15970},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15969":{"this":{"__isSmartRef__":true,"id":237}},"15970":{"timestamp":{"__isSmartRef__":true,"id":15971},"user":"soergel","tags":[]},"15971":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"15972":{"varMapping":{"__isSmartRef__":true,"id":15973},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":15974},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15973":{"this":{"__isSmartRef__":true,"id":237}},"15974":{"timestamp":{"__isSmartRef__":true,"id":15975},"user":"josi","tags":["gemtypes"]},"15975":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"15976":{"varMapping":{"__isSmartRef__":true,"id":15977},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":15978},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15977":{"this":{"__isSmartRef__":true,"id":237}},"15978":{"timestamp":{"__isSmartRef__":true,"id":15979},"user":"josi","tags":["gemtypes"]},"15979":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"15980":{"varMapping":{"__isSmartRef__":true,"id":15981},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":15982},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15981":{"this":{"__isSmartRef__":true,"id":237}},"15982":{"timestamp":{"__isSmartRef__":true,"id":15983},"user":"jan.sandbrink","tags":[]},"15983":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"15984":{"become":{"__isSmartRef__":true,"id":15985},"onMouseDown":{"__isSmartRef__":true,"id":15989},"updatePicture":{"__isSmartRef__":true,"id":15997},"ruby":{"__isSmartRef__":true,"id":16001},"switchPositionWith":{"__isSmartRef__":true,"id":16005},"addNeighbour":{"__isSmartRef__":true,"id":16009},"amethyst":{"__isSmartRef__":true,"id":16013},"diopside":{"__isSmartRef__":true,"id":16017},"gemTypes":{"__isSmartRef__":true,"id":16021},"becomeRandomGem":{"__isSmartRef__":true,"id":16025},"mark":{"__isSmartRef__":true,"id":16029},"unmark":{"__isSmartRef__":true,"id":16033},"hasNeighbour":{"__isSmartRef__":true,"id":16037},"debugMarkNeighbours":{"__isSmartRef__":true,"id":16041},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":16045},"disappear":{"__isSmartRef__":true,"id":16049},"findStreakStart":{"__isSmartRef__":true,"id":16053},"buildStreak":{"__isSmartRef__":true,"id":16057},"scoreStreak":{"__isSmartRef__":true,"id":16061},"tryToStreak":{"__isSmartRef__":true,"id":16065},"blueDiamond":{"__isSmartRef__":true,"id":16069},"prehnite":{"__isSmartRef__":true,"id":16073},"debugUnmark":{"__isSmartRef__":true,"id":16077},"debugMark":{"__isSmartRef__":true,"id":16081},"citrine":{"__isSmartRef__":true,"id":16085},"move":{"__isSmartRef__":true,"id":16089},"performMovement":{"__isSmartRef__":true,"id":16093},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":16097},"zircon":{"__isSmartRef__":true,"id":16101},"emerald":{"__isSmartRef__":true,"id":16105},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":16109}},"15985":{"varMapping":{"__isSmartRef__":true,"id":15986},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":15987},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15986":{"this":{"__isSmartRef__":true,"id":104}},"15987":{"timestamp":{"__isSmartRef__":true,"id":15988},"user":"josi","tags":[]},"15988":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"15989":{"varMapping":{"__isSmartRef__":true,"id":15990},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":15995},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15990":{"this":{"__isSmartRef__":true,"id":104},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":15991}},"15991":{"$super":{"__isSmartRef__":true,"id":15992}},"15992":{"varMapping":{"__isSmartRef__":true,"id":15993},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":15994},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15993":{"obj":{"__isSmartRef__":true,"id":104},"name":"onMouseDown"},"15994":{},"15995":{"timestamp":{"__isSmartRef__":true,"id":15996},"user":"soergel","tags":[]},"15996":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"15997":{"varMapping":{"__isSmartRef__":true,"id":15998},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":15999},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"15998":{"this":{"__isSmartRef__":true,"id":104}},"15999":{"timestamp":{"__isSmartRef__":true,"id":16000},"user":"soergel","tags":[]},"16000":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"16001":{"varMapping":{"__isSmartRef__":true,"id":16002},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":16003},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16002":{"this":{"__isSmartRef__":true,"id":104}},"16003":{"timestamp":{"__isSmartRef__":true,"id":16004},"user":"josi","tags":["gemtypes"]},"16004":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"16005":{"varMapping":{"__isSmartRef__":true,"id":16006},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":16007},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16006":{"this":{"__isSmartRef__":true,"id":104}},"16007":{"timestamp":{"__isSmartRef__":true,"id":16008},"user":"jan.sandbrink","tags":[]},"16008":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"16009":{"varMapping":{"__isSmartRef__":true,"id":16010},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16011},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16010":{"this":{"__isSmartRef__":true,"id":104}},"16011":{"timestamp":{"__isSmartRef__":true,"id":16012},"user":"jan.sandbrink","tags":[]},"16012":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"16013":{"varMapping":{"__isSmartRef__":true,"id":16014},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":16015},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16014":{"this":{"__isSmartRef__":true,"id":104}},"16015":{"timestamp":{"__isSmartRef__":true,"id":16016},"user":"josi","tags":["gemtypes"]},"16016":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"16017":{"varMapping":{"__isSmartRef__":true,"id":16018},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":16019},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16018":{"this":{"__isSmartRef__":true,"id":104}},"16019":{"timestamp":{"__isSmartRef__":true,"id":16020},"user":"josi","tags":["gemtypes"]},"16020":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"16021":{"varMapping":{"__isSmartRef__":true,"id":16022},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":16023},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16022":{"this":{"__isSmartRef__":true,"id":104}},"16023":{"timestamp":{"__isSmartRef__":true,"id":16024},"user":"josi","tags":[]},"16024":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"16025":{"varMapping":{"__isSmartRef__":true,"id":16026},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":16027},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16026":{"this":{"__isSmartRef__":true,"id":104}},"16027":{"timestamp":{"__isSmartRef__":true,"id":16028},"user":"josi","tags":[]},"16028":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"16029":{"varMapping":{"__isSmartRef__":true,"id":16030},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16031},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16030":{"this":{"__isSmartRef__":true,"id":104}},"16031":{"timestamp":{"__isSmartRef__":true,"id":16032},"user":"soergel","tags":[]},"16032":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"16033":{"varMapping":{"__isSmartRef__":true,"id":16034},"source":"function unmark() {\n this.setFill(null);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":16035},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16034":{"this":{"__isSmartRef__":true,"id":104}},"16035":{"timestamp":{"__isSmartRef__":true,"id":16036},"user":"soergel","tags":[]},"16036":{"isSerializedDate":true,"string":"Mon May 14 2012 16:05:54 GMT+0200 (CEST)"},"16037":{"varMapping":{"__isSmartRef__":true,"id":16038},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":16039},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16038":{"this":{"__isSmartRef__":true,"id":104}},"16039":{"timestamp":{"__isSmartRef__":true,"id":16040},"user":"soergel","tags":[]},"16040":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"16041":{"varMapping":{"__isSmartRef__":true,"id":16042},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16043},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16042":{"this":{"__isSmartRef__":true,"id":104}},"16043":{"timestamp":{"__isSmartRef__":true,"id":16044},"user":"soergel","tags":["debug"]},"16044":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"16045":{"varMapping":{"__isSmartRef__":true,"id":16046},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16047},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16046":{"this":{"__isSmartRef__":true,"id":104}},"16047":{"timestamp":{"__isSmartRef__":true,"id":16048},"user":"soergel","tags":["debug"]},"16048":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"16049":{"varMapping":{"__isSmartRef__":true,"id":16050},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":16051},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16050":{"this":{"__isSmartRef__":true,"id":104}},"16051":{"timestamp":{"__isSmartRef__":true,"id":16052},"user":"jan.sandbrink","tags":[]},"16052":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"16053":{"varMapping":{"__isSmartRef__":true,"id":16054},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16055},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16054":{"this":{"__isSmartRef__":true,"id":104}},"16055":{"timestamp":{"__isSmartRef__":true,"id":16056},"user":"jan.sandbrink","tags":[]},"16056":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"16057":{"varMapping":{"__isSmartRef__":true,"id":16058},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":16059},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16058":{"this":{"__isSmartRef__":true,"id":104}},"16059":{"timestamp":{"__isSmartRef__":true,"id":16060},"user":"jan.sandbrink","tags":[]},"16060":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"16061":{"varMapping":{"__isSmartRef__":true,"id":16062},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16063},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16062":{"this":{"__isSmartRef__":true,"id":104}},"16063":{"timestamp":{"__isSmartRef__":true,"id":16064},"user":"jan.sandbrink","tags":[]},"16064":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"16065":{"varMapping":{"__isSmartRef__":true,"id":16066},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":16067},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16066":{"this":{"__isSmartRef__":true,"id":104}},"16067":{"timestamp":{"__isSmartRef__":true,"id":16068},"user":"jan.sandbrink","tags":[]},"16068":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"16069":{"varMapping":{"__isSmartRef__":true,"id":16070},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":16071},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16070":{"this":{"__isSmartRef__":true,"id":104}},"16071":{"timestamp":{"__isSmartRef__":true,"id":16072},"user":"josi","tags":["gemtypes"]},"16072":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"16073":{"varMapping":{"__isSmartRef__":true,"id":16074},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":16075},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16074":{"this":{"__isSmartRef__":true,"id":104}},"16075":{"timestamp":{"__isSmartRef__":true,"id":16076},"user":"josi","tags":["gemtypes"]},"16076":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"16077":{"varMapping":{"__isSmartRef__":true,"id":16078},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":16079},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16078":{"this":{"__isSmartRef__":true,"id":104}},"16079":{"timestamp":{"__isSmartRef__":true,"id":16080},"user":"soergel","tags":["debug"]},"16080":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"16081":{"varMapping":{"__isSmartRef__":true,"id":16082},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":16083},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16082":{"this":{"__isSmartRef__":true,"id":104}},"16083":{"timestamp":{"__isSmartRef__":true,"id":16084},"user":"soergel","tags":["debug"]},"16084":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"16085":{"varMapping":{"__isSmartRef__":true,"id":16086},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":16087},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16086":{"this":{"__isSmartRef__":true,"id":104}},"16087":{"timestamp":{"__isSmartRef__":true,"id":16088},"user":"josi","tags":["gemtypes"]},"16088":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"16089":{"varMapping":{"__isSmartRef__":true,"id":16090},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":16091},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16090":{"this":{"__isSmartRef__":true,"id":104}},"16091":{"timestamp":{"__isSmartRef__":true,"id":16092},"user":"soergel","tags":[]},"16092":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"16093":{"varMapping":{"__isSmartRef__":true,"id":16094},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":16095},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16094":{"this":{"__isSmartRef__":true,"id":104}},"16095":{"timestamp":{"__isSmartRef__":true,"id":16096},"user":"soergel","tags":[]},"16096":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"16097":{"varMapping":{"__isSmartRef__":true,"id":16098},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":16099},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16098":{"this":{"__isSmartRef__":true,"id":104}},"16099":{"timestamp":{"__isSmartRef__":true,"id":16100},"user":"soergel","tags":[]},"16100":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"16101":{"varMapping":{"__isSmartRef__":true,"id":16102},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":16103},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16102":{"this":{"__isSmartRef__":true,"id":104}},"16103":{"timestamp":{"__isSmartRef__":true,"id":16104},"user":"josi","tags":["gemtypes"]},"16104":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"16105":{"varMapping":{"__isSmartRef__":true,"id":16106},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":16107},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16106":{"this":{"__isSmartRef__":true,"id":104}},"16107":{"timestamp":{"__isSmartRef__":true,"id":16108},"user":"josi","tags":["gemtypes"]},"16108":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"16109":{"varMapping":{"__isSmartRef__":true,"id":16110},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":16111},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16110":{"this":{"__isSmartRef__":true,"id":104}},"16111":{"timestamp":{"__isSmartRef__":true,"id":16112},"user":"jan.sandbrink","tags":[]},"16112":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"16113":{"position":{"__isSmartRef__":true,"id":16114},"_Extent":{"__isSmartRef__":true,"id":16115},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16116},"_Fill":{"__isSmartRef__":true,"id":16117},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16118},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16119},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16114":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16115":{"x":396,"y":411,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16116":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16117":{"r":0,"g":0,"b":0,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16118":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16119":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16120":{"x":13.972014000000058,"y":12.974013,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16121":{"partsSpaceName":"PartsBin/Basic/","__SourceModuleName__":"Global.lively.PartsBin","comment":"A simple box morph. A really blue one. Its amazing what you can build out of simple boxes.... Who needs stars when you got blue rectangles!","migrationLevel":4,"partName":"Rectangle","changes":[{"__isSmartRef__":true,"id":16122},{"__isSmartRef__":true,"id":16124},{"__isSmartRef__":true,"id":16126},{"__isSmartRef__":true,"id":16128}],"revisionOnLoad":150682,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16122":{"date":{"__isSmartRef__":true,"id":16123},"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350"},"16123":{"isSerializedDate":true,"string":"Mon Apr 09 2012 13:42:07 GMT+0200 (CEST)"},"16124":{"date":{"__isSmartRef__":true,"id":16125},"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7"},"16125":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:42:26 GMT+0100 (CET)"},"16126":{"date":{"__isSmartRef__":true,"id":16127},"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B"},"16127":{"isSerializedDate":true,"string":"Sat Feb 25 2012 02:59:09 GMT+0100 (CET)"},"16128":{"date":{"__isSmartRef__":true,"id":16129},"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2"},"16129":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:53:45 GMT+0100 (CET)"},"16130":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16131":{"morph":{"__isSmartRef__":true,"id":103},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16132":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16133}},"16133":{"test01IsMorph":{"__isSmartRef__":true,"id":16134}},"16134":{"varMapping":{"__isSmartRef__":true,"id":16135},"source":"function test01IsMorph(aPart) {\n this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":16136},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16135":{"this":{"__isSmartRef__":true,"id":16132}},"16136":{},"16137":{"x":395,"y":411,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16138":{"runFieldPhysics":{"__isSmartRef__":true,"id":16139},"iterationHasNext":{"__isSmartRef__":true,"id":16143},"restartIteration":{"__isSmartRef__":true,"id":16147},"iterationGetNext":{"__isSmartRef__":true,"id":16151},"cleanInitialStreaks":{"__isSmartRef__":true,"id":16155},"scorePoints":{"__isSmartRef__":true,"id":16159},"setScore":{"__isSmartRef__":true,"id":16163},"clear":{"__isSmartRef__":true,"id":16167},"isScoringPossible":{"__isSmartRef__":true,"id":16171}},"16139":{"varMapping":{"__isSmartRef__":true,"id":16140},"source":"function runFieldPhysics() {\n var isStillDirty = false;\n var wasEverChanged = false;\n var gemCount = 0;\n do {\n isStillDirty = false;\n this.restartIteration();\n while(this.iterationHasNext()) {\n var gem = this.iterationGetNext();\n\n if(gem.shouldBeDeleted) {\n wasEverChanged = true;\n gemCount += 1;\n gem.disappear();\n gem.shouldBeDeleted = false;\n }\n }\n this.restartIteration();\n while(this.iterationHasNext()) {\n var gem = this.iterationGetNext();\n\n if(gem.isDirty) {\n isStillDirty = true;\n gem.isDirty = false;\n gem.tryToStreak();\n }\n }\n } while(isStillDirty);\n this.scorePoints(gemCount);\n\n if(!this.isScoringPossible()) {\n this.owner.gameIsOver();\n }\n\n return wasEverChanged;\n}","funcProperties":{"__isSmartRef__":true,"id":16141},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16140":{"this":{"__isSmartRef__":true,"id":103}},"16141":{"timestamp":{"__isSmartRef__":true,"id":16142},"user":"jan.sandbrink","tags":[]},"16142":{"isSerializedDate":true,"string":"Mon May 14 2012 11:41:56 GMT+0200 (CEST)"},"16143":{"varMapping":{"__isSmartRef__":true,"id":16144},"source":"function iterationHasNext() {\n return this.iteratorPos != null;\n}","funcProperties":{"__isSmartRef__":true,"id":16145},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16144":{"this":{"__isSmartRef__":true,"id":103}},"16145":{"timestamp":{"__isSmartRef__":true,"id":16146},"user":"jan.sandbrink","tags":["iteration"]},"16146":{"isSerializedDate":true,"string":"Wed May 02 2012 17:44:37 GMT+0200 (CEST)"},"16147":{"varMapping":{"__isSmartRef__":true,"id":16148},"source":"function restartIteration() {\n this.iteratorPos = this.fieldHead;\n this.primaryIterDirection = this.iteratorPos.directions.right;\n this.secondaryIterDirection = this.iteratorPos.directions.down;\n}","funcProperties":{"__isSmartRef__":true,"id":16149},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16148":{"this":{"__isSmartRef__":true,"id":103}},"16149":{"timestamp":{"__isSmartRef__":true,"id":16150},"user":"jan.sandbrink","tags":["iteration"]},"16150":{"isSerializedDate":true,"string":"Wed May 02 2012 17:24:01 GMT+0200 (CEST)"},"16151":{"varMapping":{"__isSmartRef__":true,"id":16152},"source":"function iterationGetNext() {\n var primaryNext = this.iteratorPos.neighbours[this.primaryIterDirection];\n var secondaryNext = this.iteratorPos.neighbours[this.secondaryIterDirection];\n \n oldPosition = this.iteratorPos;\n if(primaryNext != null) {\n this.iteratorPos = primaryNext;\n } else {\n this.iteratorPos = secondaryNext;\n this.primaryIterDirection = (this.primaryIterDirection + 2) % 4;\n }\n return oldPosition;\n}","funcProperties":{"__isSmartRef__":true,"id":16153},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16152":{"this":{"__isSmartRef__":true,"id":103}},"16153":{"timestamp":{"__isSmartRef__":true,"id":16154},"user":"jan.sandbrink","tags":["iteration"]},"16154":{"isSerializedDate":true,"string":"Wed May 02 2012 17:45:53 GMT+0200 (CEST)"},"16155":{"varMapping":{"__isSmartRef__":true,"id":16156},"source":"function cleanInitialStreaks() {\n this.restartIteration();\n while(this.iterationHasNext()) {\n var gem = this.iterationGetNext();\n gem.tryToStreak();\n }\n \n this.runFieldPhysics();\n}","funcProperties":{"__isSmartRef__":true,"id":16157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16156":{"this":{"__isSmartRef__":true,"id":103}},"16157":{"timestamp":{"__isSmartRef__":true,"id":16158},"user":"jan.sandbrink","tags":[]},"16158":{"isSerializedDate":true,"string":"Thu May 10 2012 13:44:52 GMT+0200 (CEST)"},"16159":{"varMapping":{"__isSmartRef__":true,"id":16160},"source":"function scorePoints(gemCount) {\n var scoreIncrement = gemCount * 10 * Math.ceil(gemCount / 3);\n if(this.score > 0){\n var scoreMultiplicator = Math.ceil(this.score / 5000);\n } else {\n var scoreMultiplicator = 1;\n }\n this.setScore(this.score + (scoreIncrement * scoreMultiplicator));\n}","funcProperties":{"__isSmartRef__":true,"id":16161},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16160":{"this":{"__isSmartRef__":true,"id":103}},"16161":{"timestamp":{"__isSmartRef__":true,"id":16162},"user":"soergel","tags":[]},"16162":{"isSerializedDate":true,"string":"Mon May 14 2012 16:22:02 GMT+0200 (CEST)"},"16163":{"varMapping":{"__isSmartRef__":true,"id":16164},"source":"function setScore(score) {\n this.score = score;\n this.owner.updateScore(this.score);\n}","funcProperties":{"__isSmartRef__":true,"id":16165},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16164":{"this":{"__isSmartRef__":true,"id":103}},"16165":{"timestamp":{"__isSmartRef__":true,"id":16166},"user":"jan.sandbrink","tags":[]},"16166":{"isSerializedDate":true,"string":"Tue May 08 2012 12:38:31 GMT+0200 (CEST)"},"16167":{"varMapping":{"__isSmartRef__":true,"id":16168},"source":"function clear() {\n this.submorphs.select(function(e) {\n return e.isGem;\n }).each(function(e) {\n e.remove();\n });\n this.markedGem = null;\n this.score = 0;\n}","funcProperties":{"__isSmartRef__":true,"id":16169},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16168":{"this":{"__isSmartRef__":true,"id":103}},"16169":{"timestamp":{"__isSmartRef__":true,"id":16170},"user":"jan.sandbrink","tags":[]},"16170":{"isSerializedDate":true,"string":"Thu May 10 2012 13:44:41 GMT+0200 (CEST)"},"16171":{"varMapping":{"__isSmartRef__":true,"id":16172},"source":"function isScoringPossible() {\n var isPossible = false;\n this.restartIteration();\n while(this.iterationHasNext() && !isPossible) {\n var gem = this.iterationGetNext();\n\n var neighbour = gem.neighbours[gem.directions.down];\n if(neighbour != null)\n isPossible = gem.canScoreBySwitchingWith(neighbour);\n \n neighbour = gem.neighbours[gem.directions.right];\n if(neighbour != null)\n isPossible = isPossible || gem.canScoreBySwitchingWith(neighbour);\n }\n\n this.restartIteration();\n while(this.iterationHasNext()) {\n var gem = this.iterationGetNext();\n gem.shouldBeDeleted = false;\n }\n\n return isPossible;\n}","funcProperties":{"__isSmartRef__":true,"id":16173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16172":{"this":{"__isSmartRef__":true,"id":103}},"16173":{"timestamp":{"__isSmartRef__":true,"id":16174},"user":"jan.sandbrink","tags":[]},"16174":{"isSerializedDate":true,"string":"Mon May 14 2012 11:27:57 GMT+0200 (CEST)"},"16175":{"submorphs":[{"__isSmartRef__":true,"id":16176}],"scripts":[],"id":"950EF7A8-4FE6-4868-815E-4BE8178F0501","shape":{"__isSmartRef__":true,"id":16192},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16199},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":16200},"lighterFill":{"__isSmartRef__":true,"id":16201},"label":{"__isSmartRef__":true,"id":16176},"name":"Button1","showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":16202},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"__SourceModuleName__":"Global.lively.morphic.Widgets","priorExtent":{"__isSmartRef__":true,"id":16205},"renderContextTable":{"__isSmartRef__":true,"id":16206},"eventHandler":{"__isSmartRef__":true,"id":16207},"distanceToDragEvent":{"__isSmartRef__":true,"id":16208},"derivationIds":[7251,"AE965E5C-19BD-4049-96CC-319842C6E018","850C5E5C-2ACF-46C2-9F4A-8AE95E60D788","89C6E9B6-7DC0-41A2-A617-9553CD5CD937","0BCB13E8-8F74-4712-9252-F922F3A67A7B","25C1A1F2-A1D9-423D-BF51-D67E8B17F6B1","1FD9C092-0086-4E41-97F3-B9C0E879014A","CABC6739-B8CB-4938-8869-EE639B50BC46","A53DD70A-22E7-45CB-A342-F53929F8FDE1","14917149-E73A-4261-BA6D-6B6323E41B3E","DB4C3B10-90D1-4FC3-B1B4-69AC7021C0B6","3A89AD15-D736-458B-B279-096A76A88A7A","2500068F-492B-454D-B9FC-BCB574C9EFDA","741AFC0B-25B3-49CD-9281-C50A5195A826","1CACFC59-5F7F-4EA8-BF87-163156D52BDB","9C6CE593-5EFB-456D-9D87-D3BAC81D9D4B","CE9AA98F-E1BA-4121-A516-127A8A428350","62F2B200-5DFD-4C86-98AB-C56FA9678473","3A4A7D0E-B1A2-479A-BB1C-2E071C5080B3","EB164B2C-085B-471A-BCB1-A712582EAB31","7B77808E-31ED-48FA-B575-7A30DE2EDD92","7E62C040-3AF8-4B0A-9429-B4D629193A68","4CE18596-67F7-4555-A72F-F8340286549D","8D245830-C85A-4B8D-AE3F-2AC9DD08D129","0F9CBE6D-F390-451C-B498-351F43286CF4","8DC5FFBC-E7C1-4D12-813D-9A73AF0E88BB","2A2665A8-43B4-41E2-99EB-31F2A7A85365","5A1D2E50-28A5-4FA9-8AE3-0B902FE792CD"],"_ClipMode":"visible","moved":true,"prevScroll":[0,0],"owner":{"__isSmartRef__":true,"id":60},"_Rotation":0,"_Scale":0.998001,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16209},"__LivelyClassName__":"lively.morphic.Button"},"16176":{"submorphs":[],"scripts":[],"id":"76C3A726-E95F-4378-92EF-B35D9F20FD34","shape":{"__isSmartRef__":true,"id":16177},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Comic Sans MS","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16183},"_MaxTextWidth":110,"_MaxTextHeight":null,"textStyle":null,"padding":{"__isSmartRef__":true,"id":16184},"_Padding":{"__isSmartRef__":true,"id":16185},"owner":{"__isSmartRef__":true,"id":16175},"isLabel":true,"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","_ClipMode":"hidden","priorExtent":{"__isSmartRef__":true,"id":16186},"textChunks":[{"__isSmartRef__":true,"id":16187}],"_Align":"center","renderContextTable":{"__isSmartRef__":true,"id":16189},"eventHandler":{"__isSmartRef__":true,"id":16190},"_HandStyle":"default","_PointerEvents":"none","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[7252,"5136A758-BF53-43D4-B39B-DF7EFA37E738","4B2048BC-5868-48E2-AAA6-7F23E2BB8663","7641B212-AD63-46C0-A195-DA606FC40C83","27948213-E9B0-4045-BF41-0A42C99764B0","FA42BC01-C3D5-45DB-89F4-D8E735B98407","9BFA64A4-A071-46C9-A022-2B964C7E82E9","446A4399-4F2F-4E48-94FF-E91CCF9926A5","1C848188-9278-42B7-9FAD-2D20D5308E57","C4CCAF06-1C80-4BD6-A947-075FBFFDDC5D","06E1D9F9-D8A9-4D1E-843E-3AFB2AA2E550","5D5D2DB3-DC07-4EDE-A5FE-82B4635182FB","882DE748-AC7E-4F8A-B9BA-4E02022C0070","76C142F5-34C1-4944-8CD3-C6C8B810B270","98234A81-6B76-48F7-8015-7BBBA29837BC","4A3BFE48-245A-483F-A945-0340E29680DE","04383239-1AB6-4641-BAC6-E505C39D4F40","9A932E1B-7295-4AD1-A2BC-A235C6A41846","63D4BE39-C391-44EC-954E-64C1F18DF66F","687542A2-DBCB-4CBD-8AAF-0F059D95C781","EBB206D6-F673-4C50-B7C7-F34EDF7617F0","7F1D2C57-5D61-4B33-B7A4-F074A3D6EB62","14CFA068-FB26-4655-A57B-036F8FBB70C0","A1672C23-4798-4CBD-8319-45C53DAECFFA","07420C34-2151-460A-B870-DA8856C14B57","80C54D07-386C-4C10-A112-080A5EA810AD","818F082A-004A-4C58-B5F3-B2E4BC1369CD","3711D6E3-6D3F-421F-A3A3-2C88E2511E5C"],"_MinTextWidth":110,"_MinTextHeight":null,"_FontSize":10,"_TextColor":{"__isSmartRef__":true,"id":16191},"__LivelyClassName__":"lively.morphic.Text"},"16177":{"position":{"__isSmartRef__":true,"id":16178},"_Extent":{"__isSmartRef__":true,"id":16179},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16180},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16181},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":16182},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16178":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16179":{"x":110,"y":30,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16180":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16181":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16182":{"x":0,"y":3,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16183":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16184":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16185":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16186":{"x":110,"y":30,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16187":{"style":{"__isSmartRef__":true,"id":16188},"chunkOwner":{"__isSmartRef__":true,"id":16176},"storedString":"Clear","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"16188":{"textShadow":"0px 1px 0 rgba(255,255,255,1)","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16189":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16190":{"morph":{"__isSmartRef__":true,"id":16176},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16191":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16192":{"position":{"__isSmartRef__":true,"id":16193},"_Extent":{"__isSmartRef__":true,"id":16194},"_BorderWidth":2.516,"_BorderColor":{"__isSmartRef__":true,"id":16195},"_Fill":{"__isSmartRef__":true,"id":16196},"_BorderRadius":5.2,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16197},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16198},"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16193":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16194":{"x":110,"y":30,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16195":{"r":0.372,"g":0.369,"b":0.372,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16196":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16197":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16198":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16199":{"x":665.7186410000005,"y":406.18640700000014,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16200":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16201":{"r":0.9,"g":0.9,"b":0.9,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16202":{"partsSpaceName":"PartsBin/SketchyInputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"partName":"Button","comment":"Has a script that is called on button press","changes":[{"__isSmartRef__":true,"id":16203}],"revisionOnLoad":140039,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16203":{"date":{"__isSmartRef__":true,"id":16204},"author":"lauritz","message":"","id":"959919F0-D51D-45E6-9205-4D7A114D8C7E"},"16204":{"isSerializedDate":true,"string":"Tue Jan 24 2012 21:35:57 GMT+0100 (CET)"},"16205":{"x":110,"y":30,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16206":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16207":{"morph":{"__isSmartRef__":true,"id":16175},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16208":{"x":81,"y":-13,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16209":{"onMouseDown":{"__isSmartRef__":true,"id":16210}},"16210":{"varMapping":{"__isSmartRef__":true,"id":16211},"source":"function onMouseDown() {\n this.owner.clear();\n}","funcProperties":{"__isSmartRef__":true,"id":16216},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16211":{"this":{"__isSmartRef__":true,"id":16175},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16212}},"16212":{"$super":{"__isSmartRef__":true,"id":16213}},"16213":{"varMapping":{"__isSmartRef__":true,"id":16214},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":16215},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16214":{"obj":{"__isSmartRef__":true,"id":16175},"name":"onMouseDown"},"16215":{},"16216":{"timestamp":{"__isSmartRef__":true,"id":16217},"user":"soergel","tags":[]},"16217":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:33:34 GMT+0200 (CEST)"},"16218":{"submorphs":[],"scripts":[],"id":"4BB5ACEF-6E20-4D5E-9CA6-DE8F1AFBE7AD","shape":{"__isSmartRef__":true,"id":16219},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16225},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16222},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"ScoreIndicator","partsBinMetaInfo":{"__isSmartRef__":true,"id":16226},"textChunks":[{"__isSmartRef__":true,"id":16235}],"charsReplaced":"foo!?","lastFindLoc":10,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16237},"renderContextTable":{"__isSmartRef__":true,"id":16238},"eventHandler":{"__isSmartRef__":true,"id":16239},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16240},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","2573B759-62DC-415C-8492-96EE2DA1D148","695F454E-5EF5-42FA-823A-04C3A5025E0F","0F954437-59B2-4E33-BEE7-CFD1A4BAD12D","2C787A82-E571-4C6F-AFBD-AA01F76AD16B","322F315B-A585-484E-8C4E-3E635AC6188A","20964E56-8B08-4C7C-B99F-BC092C025505","849553FB-B20B-4068-8F5F-A525B0CC3D0B","0915BA9E-8CD7-42E5-9AC6-F9B166BC327C","2020ED3E-5AA7-4EBC-A737-04053D65328A","9C3B90D8-F199-4B8E-A0CD-04AA364A44AD","42F1D6EB-047F-4C7E-9417-30AC79A94042"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"owner":{"__isSmartRef__":true,"id":60},"distanceToDragEvent":{"__isSmartRef__":true,"id":16241},"#startLetters":"","_Align":"right","_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16243},"__LivelyClassName__":"lively.morphic.Text"},"16219":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16220},"_Extent":{"__isSmartRef__":true,"id":16221},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16222},"renderContextTable":{"__isSmartRef__":true,"id":16223},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16224},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16220":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16221":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16222":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16223":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16224":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16225":{"x":653.7246380000006,"y":83.8300850000003,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16226":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16227},{"__isSmartRef__":true,"id":16229},{"__isSmartRef__":true,"id":16231},{"__isSmartRef__":true,"id":16233}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16227":{"date":{"__isSmartRef__":true,"id":16228},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16228":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16229":{"date":{"__isSmartRef__":true,"id":16230},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16230":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16231":{"date":{"__isSmartRef__":true,"id":16232},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16232":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16233":{"date":{"__isSmartRef__":true,"id":16234},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16234":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16235":{"style":{"__isSmartRef__":true,"id":16236},"chunkOwner":{"__isSmartRef__":true,"id":16218},"storedString":"180","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"16236":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"16237":{"x":128.695652,"y":26,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16238":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16239":{"morph":{"__isSmartRef__":true,"id":16218},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16240":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16241":{"x":86.96594893191491,"y":-18.997996995995265,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16242":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16243":{"setScore":{"__isSmartRef__":true,"id":16244}},"16244":{"varMapping":{"__isSmartRef__":true,"id":16245},"source":"function setScore(score) {\n this.setTextString(score);\n}","funcProperties":{"__isSmartRef__":true,"id":16246},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16245":{"this":{"__isSmartRef__":true,"id":16218}},"16246":{"timestamp":{"__isSmartRef__":true,"id":16247},"user":"jan.sandbrink","tags":[]},"16247":{"isSerializedDate":true,"string":"Tue May 08 2012 12:34:02 GMT+0200 (CEST)"},"16248":{"submorphs":[],"scripts":[],"id":"70A5E02B-CD8B-4BB6-BDCF-01D00BA8F847","shape":{"__isSmartRef__":true,"id":16249},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16255},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16252},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"Text","partsBinMetaInfo":{"__isSmartRef__":true,"id":16256},"textChunks":[{"__isSmartRef__":true,"id":16267}],"charsReplaced":"Some Text","lastFindLoc":9,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16269},"renderContextTable":{"__isSmartRef__":true,"id":16270},"eventHandler":{"__isSmartRef__":true,"id":16271},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16272},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","F6A714BA-4735-41ED-8A2A-45CB153FBDF8","755BEFAF-1751-4988-9E3F-AE5127E1E069","EFDA59B4-4677-447E-8C99-82AFBAFD90D2","E7F75FAD-1890-4742-8133-0D868503B3B5","0FEC0E0F-2532-4229-9C7A-640E3E578F91","187961CF-2543-4DF7-9D95-EE79BEDF042B","CC35E776-362B-4E0E-8643-C094A9B0C168","E078F1DA-15FF-4574-8AA8-6436BD32EC82","17F9C1E3-CAB8-44CC-85F4-3106B0A6EA01","4CA58920-F51D-4761-8FFD-49773985F8BA"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"moved":true,"owner":{"__isSmartRef__":true,"id":60},"_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"16249":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16250},"_Extent":{"__isSmartRef__":true,"id":16251},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16252},"renderContextTable":{"__isSmartRef__":true,"id":16253},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16254},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16250":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16251":{"x":128.695652,"y":48,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16252":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16253":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16254":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16255":{"x":465.06846600000006,"y":318.362319,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16256":{"partsSpaceName":"PartsBin/Basic/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16257},{"__isSmartRef__":true,"id":16259},{"__isSmartRef__":true,"id":16261},{"__isSmartRef__":true,"id":16263},{"__isSmartRef__":true,"id":16265}],"revisionOnLoad":160159,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16257":{"date":{"__isSmartRef__":true,"id":16258},"author":"timfelgentreff","message":"better text","id":"B904F9AC-6EA0-4A8A-83C9-AFC85AADC194"},"16258":{"isSerializedDate":true,"string":"Tue May 08 2012 14:18:18 GMT+0200 (CEST)"},"16259":{"date":{"__isSmartRef__":true,"id":16260},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16260":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16261":{"date":{"__isSmartRef__":true,"id":16262},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16262":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16263":{"date":{"__isSmartRef__":true,"id":16264},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16264":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16265":{"date":{"__isSmartRef__":true,"id":16266},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16266":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16267":{"style":{"__isSmartRef__":true,"id":16268},"morph":{"__isSmartRef__":true,"id":16248},"__SourceModuleName__":"Global.lively.morphic.TextCore","chunkOwner":{"__isSmartRef__":true,"id":16248},"storedString":"Gem Prototype","__LivelyClassName__":"lively.morphic.TextChunk"},"16268":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16269":{"x":128.695652,"y":48,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16270":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16271":{"morph":{"__isSmartRef__":true,"id":16248},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16272":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16273":{"submorphs":[],"scripts":[],"id":"0D967D3E-B208-4F27-8CA3-7B6D9EC32C50","shape":{"__isSmartRef__":true,"id":16274},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16281},"showsHalos":false,"name":"PrototypeBox","partsBinMetaInfo":{"__isSmartRef__":true,"id":16282},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":16295},"eventHandler":{"__isSmartRef__":true,"id":16296},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","FE91EA31-D8AE-461B-8A49-95DA5FBAE5B4","88B54E86-9B7A-4CB5-910F-576F8A3C02D8","94DC3186-87C5-4D65-816A-C787EF22117A","11C95B71-DA81-45C7-86EE-AC7A2FF02EE3","E7D7F14A-6347-407A-BD84-EBCBA6EBFC07","D9E766F2-6219-4745-A482-51EADC5FE01C","49719470-1588-4A54-B98A-04390F8FC229","AE3642A5-1609-4F58-82FA-A33E43F5DDF9","8A0EA7DE-39DF-407A-BC72-B37C71EEDD08","B9E6510A-6BCD-44F3-939B-3E829BDABD5F"],"partTests":{"__isSmartRef__":true,"id":16297},"_ClipMode":"visible","owner":{"__isSmartRef__":true,"id":60},"moved":true,"isBeingDragged":false,"markedGem":{"__isSmartRef__":true,"id":16302},"isPrototypeBox":true,"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Box"},"16274":{"position":{"__isSmartRef__":true,"id":16275},"_Extent":{"__isSmartRef__":true,"id":16276},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16277},"_Fill":{"__isSmartRef__":true,"id":16278},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16279},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16280},"_BorderRadius":0,"_Opacity":0.3929,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16275":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16276":{"x":100,"y":100,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16277":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16278":{"r":0.42251384761555266,"g":0.6564697760174577,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16279":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16280":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16281":{"x":477.044478,"y":373.25237400000003,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16282":{"partsSpaceName":"PartsBin/Basic/","__SourceModuleName__":"Global.lively.PartsBin","comment":"A simple box morph. A really blue one. Its amazing what you can build out of simple boxes.... Who needs stars when you got blue rectangles!","migrationLevel":4,"partName":"Rectangle","changes":[{"__isSmartRef__":true,"id":16283},{"__isSmartRef__":true,"id":16285},{"__isSmartRef__":true,"id":16287},{"__isSmartRef__":true,"id":16289},{"__isSmartRef__":true,"id":16291},{"__isSmartRef__":true,"id":16293}],"revisionOnLoad":158846,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16283":{"date":{"__isSmartRef__":true,"id":16284},"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23"},"16284":{"isSerializedDate":true,"string":"Thu May 03 2012 15:51:36 GMT+0200 (CEST)"},"16285":{"date":{"__isSmartRef__":true,"id":16286},"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC"},"16286":{"isSerializedDate":true,"string":"Thu May 03 2012 15:51:30 GMT+0200 (CEST)"},"16287":{"date":{"__isSmartRef__":true,"id":16288},"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2"},"16288":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:53:45 GMT+0100 (CET)"},"16289":{"date":{"__isSmartRef__":true,"id":16290},"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B"},"16290":{"isSerializedDate":true,"string":"Sat Feb 25 2012 02:59:09 GMT+0100 (CET)"},"16291":{"date":{"__isSmartRef__":true,"id":16292},"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7"},"16292":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:42:26 GMT+0100 (CET)"},"16293":{"date":{"__isSmartRef__":true,"id":16294},"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350"},"16294":{"isSerializedDate":true,"string":"Mon Apr 09 2012 13:42:07 GMT+0200 (CEST)"},"16295":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16296":{"morph":{"__isSmartRef__":true,"id":16273},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16297":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16298}},"16298":{"test01IsMorph":{"__isSmartRef__":true,"id":16299}},"16299":{"varMapping":{"__isSmartRef__":true,"id":16300},"source":"function test01IsMorph(aPart) {\n this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":16301},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16300":{"this":{"__isSmartRef__":true,"id":16297}},"16301":{},"16302":{"submorphs":[{"__isSmartRef__":true,"id":16303}],"scripts":[],"id":"49FBAA93-C826-4AED-9225-7A228A504BCE","shape":{"__isSmartRef__":true,"id":16348},"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16355},"showsHalos":false,"name":"BasicGem","partsBinMetaInfo":{"__isSmartRef__":true,"id":16356},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":16395},"eventHandler":{"__isSmartRef__":true,"id":16396},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","AF79EBFF-EF50-4426-AAE4-ED153D00A7E8","231CE1FA-9ED5-498D-A2DF-89DCD8144910","353F1852-04EC-4BCE-B2D6-4B5BF1753990","DDBE40C6-C133-41C6-B7AB-CA63C08F24F5","D1192A47-67F3-449E-9223-70A2A4F36856","75566D59-70F6-4AC8-8499-D875B662ECE5","E84F6B69-CB86-4B23-A179-E1901C44E7CA","F734BDBC-D3D8-42FB-9D16-548E840AB400","C174E41E-99FE-4D88-8A99-9BF241D0E165","B798353D-D92A-4D24-9726-BDB0AFAE5660","4E12B7B9-9BA2-467C-ACCD-FDFDE3C0DC33","5E04972C-44C7-415F-B605-60EA8C9BCD29","374843A8-AD07-4F8D-88B2-0634A578EB14","07809FA0-A598-444A-B93D-42AB64283836","E878F9DF-A780-4AAB-956C-259018E74EB1","5FDA9CAD-1AB7-41B0-AB29-7AED81CE9321","2726CC2B-6ECF-4368-9B68-F7C9DF9EFCEC","6327F5FC-33CF-4DD8-B5A3-C22EAEA3128F","74A3F065-BA26-4115-8BEA-1A792FB89BB8","EDE35919-4CF0-4C71-A0E0-0CE22C0667B8","D7035A71-41B4-4732-B905-50C7606B41ED","46388232-02EC-4B63-B17C-144511B8833E","F422CEDD-E5FB-460F-B7F6-51C8D23E532E","BB8E878F-D4F9-40AB-89A7-6DD557AFD370"],"partTests":{"__isSmartRef__":true,"id":16397},"_ClipMode":"visible","priorExtent":{"__isSmartRef__":true,"id":16402},"isBeingDragged":false,"grabbingEnabled":false,"draggingEnabled":false,"moved":true,"directions":{"__isSmartRef__":true,"id":16403},"neighbours":[null,null,null,null],"#startLetters":"","isGem":true,"isDirty":false,"gem":"citrine","shouldBeDeleted":false,"owner":null,"_Rotation":0,"_Scale":1.010055220717008,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16404},"__LivelyClassName__":"lively.morphic.Box"},"16303":{"submorphs":[{"__isSmartRef__":true,"id":16304},{"__isSmartRef__":true,"id":16317}],"scripts":[],"shape":{"__isSmartRef__":true,"id":16330},"derivationIds":[null,"7EFDE6FA-E2B9-4F99-9DBF-0E84C79F2DB8","7A26E19C-5558-45A1-A324-99DCC4CE837D","F7D253A5-132C-4319-8FD3-C612C4DA0A86","F3A128B9-43F9-405C-8D4A-9D44E495FCE7","CA2B95B3-20A4-49EA-8530-9DDE8D848605"],"id":"2A553949-ABEE-4732-AD7D-EA8925EA4B9D","renderContextTable":{"__isSmartRef__":true,"id":16341},"eventHandler":{"__isSmartRef__":true,"id":16342},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16302},"_Position":{"__isSmartRef__":true,"id":16343},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"controlPoints":[{"__isSmartRef__":true,"id":16344},{"__isSmartRef__":true,"id":16345},{"__isSmartRef__":true,"id":16346},{"__isSmartRef__":true,"id":16347}],"__LivelyClassName__":"lively.morphic.Path"},"16304":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":16305},"derivationIds":[null,"340CA065-619A-420D-A32F-09779DC5F000","D00735BE-05E6-4955-B539-D8F7079BA436","CE16D72F-ED74-4A2F-BD43-6B87DAD1AB59","8AC4A2E1-0469-4F38-A983-3C40516D7F1A","3873D6FD-6155-4116-8ADB-F16F514730C1"],"id":"26DFE482-84D0-4052-B28E-3ABF90831A7A","renderContextTable":{"__isSmartRef__":true,"id":16313},"eventHandler":{"__isSmartRef__":true,"id":16314},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16303},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"controlPoints":[{"__isSmartRef__":true,"id":16315},{"__isSmartRef__":true,"id":16316}],"__LivelyClassName__":"lively.morphic.Path"},"16305":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16306},{"__isSmartRef__":true,"id":16307}],"renderContextTable":{"__isSmartRef__":true,"id":16308},"_Position":{"__isSmartRef__":true,"id":16309},"_Extent":{"__isSmartRef__":true,"id":16310},"_Padding":{"__isSmartRef__":true,"id":16311},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":16312},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16306":{"isAbsolute":true,"x":25,"y":5,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16307":{"isAbsolute":true,"x":25,"y":45,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16308":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16309":{"x":23,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16310":{"x":3,"y":43,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16311":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16312":{"r":1,"g":1,"b":0.5882352941176471,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16313":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16314":{"morph":{"__isSmartRef__":true,"id":16304},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16315":{"morph":{"__isSmartRef__":true,"id":16304},"index":0,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16316":{"morph":{"__isSmartRef__":true,"id":16304},"index":1,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16317":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":16318},"derivationIds":[null,"3A7D0CA7-ECAD-417D-8D0F-BEF3D2B2554D","356CC547-164D-45A1-AA55-2225360E8761","9F509872-8633-4F57-8D88-3B0631022468","468203A6-F82E-44CF-AEDC-5E830D9D73E9","BA502365-9531-4DCF-8B1F-561257C4F50A"],"id":"E28D39BA-939F-4869-99A4-B36FEB93ED22","renderContextTable":{"__isSmartRef__":true,"id":16326},"eventHandler":{"__isSmartRef__":true,"id":16327},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16303},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"controlPoints":[{"__isSmartRef__":true,"id":16328},{"__isSmartRef__":true,"id":16329}],"__LivelyClassName__":"lively.morphic.Path"},"16318":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16319},{"__isSmartRef__":true,"id":16320}],"renderContextTable":{"__isSmartRef__":true,"id":16321},"_Position":{"__isSmartRef__":true,"id":16322},"_Extent":{"__isSmartRef__":true,"id":16323},"_Padding":{"__isSmartRef__":true,"id":16324},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":16325},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16319":{"isAbsolute":true,"x":13,"y":25,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16320":{"isAbsolute":true,"x":37,"y":25,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16321":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16322":{"x":11,"y":23,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16323":{"x":27,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16324":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16325":{"r":1,"g":1,"b":0.5882352941176471,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16326":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16327":{"morph":{"__isSmartRef__":true,"id":16317},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16328":{"morph":{"__isSmartRef__":true,"id":16317},"index":0,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16329":{"morph":{"__isSmartRef__":true,"id":16317},"index":1,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16330":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16331},{"__isSmartRef__":true,"id":16332},{"__isSmartRef__":true,"id":16333},{"__isSmartRef__":true,"id":16334}],"renderContextTable":{"__isSmartRef__":true,"id":16335},"_Position":{"__isSmartRef__":true,"id":16336},"_Extent":{"__isSmartRef__":true,"id":16337},"_Padding":{"__isSmartRef__":true,"id":16338},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16339},"_Fill":{"__isSmartRef__":true,"id":16340},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16331":{"isAbsolute":true,"x":25,"y":5,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16332":{"isAbsolute":true,"x":13,"y":25,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16333":{"isAbsolute":true,"x":25,"y":45,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16334":{"isAbsolute":true,"x":37,"y":25,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16335":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16336":{"x":12,"y":4,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16337":{"x":25,"y":41,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16338":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16339":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16340":{"r":1,"g":1,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16341":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16342":{"morph":{"__isSmartRef__":true,"id":16303},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16343":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16344":{"morph":{"__isSmartRef__":true,"id":16303},"index":0,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16345":{"morph":{"__isSmartRef__":true,"id":16303},"index":1,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16346":{"morph":{"__isSmartRef__":true,"id":16303},"index":2,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16347":{"morph":{"__isSmartRef__":true,"id":16303},"index":3,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"16348":{"position":{"__isSmartRef__":true,"id":16349},"_Extent":{"__isSmartRef__":true,"id":16350},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16351},"_Fill":{"__isSmartRef__":true,"id":16352},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16353},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16354},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16349":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16350":{"x":49.20369420394888,"y":50.19970019994978,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16351":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16352":{"r":0.8,"g":0.8,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16353":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16354":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16355":{"x":22.954023000000007,"y":26.934033,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16356":{"partsSpaceName":"PartsBin/groupBejeweled/","__SourceModuleName__":"Global.lively.PartsBin","comment":"This is a basic gem that can become different types of gems (such as ruby and amethyst).","migrationLevel":4,"partName":"BasicGem","changes":[{"__isSmartRef__":true,"id":16357},{"__isSmartRef__":true,"id":16359},{"__isSmartRef__":true,"id":16361},{"__isSmartRef__":true,"id":16363},{"__isSmartRef__":true,"id":16365},{"__isSmartRef__":true,"id":16367},{"__isSmartRef__":true,"id":16369},{"__isSmartRef__":true,"id":16371},{"__isSmartRef__":true,"id":16373},{"__isSmartRef__":true,"id":16375},{"__isSmartRef__":true,"id":16377},{"__isSmartRef__":true,"id":16379},{"__isSmartRef__":true,"id":16381},{"__isSmartRef__":true,"id":16383},{"__isSmartRef__":true,"id":16385},{"__isSmartRef__":true,"id":16387},{"__isSmartRef__":true,"id":16389},{"__isSmartRef__":true,"id":16391},{"__isSmartRef__":true,"id":16393}],"revisionOnLoad":160123,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16357":{"date":{"__isSmartRef__":true,"id":16358},"author":"josi","message":"another gemType","id":"16C44641-15C6-4404-A5C5-ED4650E67206"},"16358":{"isSerializedDate":true,"string":"Mon May 07 2012 15:56:34 GMT+0200 (CEST)"},"16359":{"date":{"__isSmartRef__":true,"id":16360},"author":"soergel","message":"overridden","id":"F2823C2C-326F-4A57-95DA-860674FAAE98"},"16360":{"isSerializedDate":true,"string":"Wed May 02 2012 13:40:12 GMT+0200 (CEST)"},"16361":{"date":{"__isSmartRef__":true,"id":16362},"author":"josi","message":"gem type can now be changed into amethyst","id":"BC7F4160-A8F1-492B-806B-E0C2DB3C3D2A"},"16362":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:38:32 GMT+0200 (CEST)"},"16363":{"date":{"__isSmartRef__":true,"id":16364},"author":"josi","message":"can now become a styled ruby ;)","id":"5FD66E1D-7111-430C-A6A6-AC42566771E6"},"16364":{"isSerializedDate":true,"string":"Thu Apr 26 2012 13:43:28 GMT+0200 (CEST)"},"16365":{"date":{"__isSmartRef__":true,"id":16366},"author":"josi","message":"some minor changes (like size and no border for \"gems\")","id":"08765E93-94C3-44D0-840E-5260CAD06CE8"},"16366":{"isSerializedDate":true,"string":"Thu Apr 26 2012 12:12:32 GMT+0200 (CEST)"},"16367":{"date":{"__isSmartRef__":true,"id":16368},"author":"josi","message":"basic functionality of adding real picture (morph) to gem","id":"6A73B3AE-225F-4447-9129-87575BFE4893"},"16368":{"isSerializedDate":true,"string":"Thu Apr 26 2012 11:58:39 GMT+0200 (CEST)"},"16369":{"date":{"__isSmartRef__":true,"id":16370},"author":"josi","message":"added become-functionality (inspired by the FreedomSpeech group), but still lacks of a lot of functionality","id":"E31E69D2-46FE-487C-810B-C284826E0A11"},"16370":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:49:02 GMT+0200 (CEST)"},"16371":{"date":{"__isSmartRef__":true,"id":16372},"author":"josi","message":"no comment","id":"3B32B7A3-D2B4-41A4-AFD2-59AA1837004C"},"16372":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:01:57 GMT+0200 (CEST)"},"16373":{"date":{"__isSmartRef__":true,"id":16374},"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350"},"16374":{"isSerializedDate":true,"string":"Mon Apr 09 2012 13:42:07 GMT+0200 (CEST)"},"16375":{"date":{"__isSmartRef__":true,"id":16376},"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7"},"16376":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:42:26 GMT+0100 (CET)"},"16377":{"date":{"__isSmartRef__":true,"id":16378},"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B"},"16378":{"isSerializedDate":true,"string":"Sat Feb 25 2012 02:59:09 GMT+0100 (CET)"},"16379":{"date":{"__isSmartRef__":true,"id":16380},"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2"},"16380":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:53:45 GMT+0100 (CET)"},"16381":{"date":{"__isSmartRef__":true,"id":16382},"author":"josi","message":"more styled version of ruby","id":"E35A76D9-3A82-4589-B827-20254EA51FB8"},"16382":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:36:26 GMT+0200 (CEST)"},"16383":{"date":{"__isSmartRef__":true,"id":16384},"author":"josi","message":"another gemType & array for all gemTypes","id":"E4C93F7A-B95D-4587-8485-C7940304143B"},"16384":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:52:49 GMT+0200 (CEST)"},"16385":{"date":{"__isSmartRef__":true,"id":16386},"author":"josi","message":"styling diopside","id":"65B5E617-A4DF-460D-A7F4-1F8DEC927840"},"16386":{"isSerializedDate":true,"string":"Mon Apr 30 2012 13:06:13 GMT+0200 (CEST)"},"16387":{"date":{"__isSmartRef__":true,"id":16388},"author":"josi","message":"updating picture is now more general (but needs some refactoring!!!)","id":"C235D240-065B-4DD0-BCBD-00A9B6AD63A1"},"16388":{"isSerializedDate":true,"string":"Mon Apr 30 2012 14:56:55 GMT+0200 (CEST)"},"16389":{"date":{"__isSmartRef__":true,"id":16390},"author":"josi","message":"added blue diamond","id":"62B702D1-677C-4634-8751-EE3FBEC68D50"},"16390":{"isSerializedDate":true,"string":"Mon Apr 30 2012 15:22:13 GMT+0200 (CEST)"},"16391":{"date":{"__isSmartRef__":true,"id":16392},"author":"josi","message":"added prehnite","id":"21C33415-A95E-46F9-A434-B17D3B1D3FE3"},"16392":{"isSerializedDate":true,"string":"Tue May 01 2012 16:17:53 GMT+0200 (CEST)"},"16393":{"date":{"__isSmartRef__":true,"id":16394},"author":"josi","message":"merged (hopefully doesn't overwrite anything again)","id":"3863DEF2-14D9-4777-9E4B-01A2957B34ED"},"16394":{"isSerializedDate":true,"string":"Wed May 02 2012 22:16:49 GMT+0200 (CEST)"},"16395":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16396":{"morph":{"__isSmartRef__":true,"id":16302},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16397":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16398}},"16398":{"test01IsMorph":{"__isSmartRef__":true,"id":16399}},"16399":{"varMapping":{"__isSmartRef__":true,"id":16400},"source":"function test01IsMorph(aPart) {\n this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":16401},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16400":{"this":{"__isSmartRef__":true,"id":16397}},"16401":{},"16402":{"x":49.20369420394888,"y":51.19570619595078,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16403":{"left":0,"up":1,"right":2,"down":3},"16404":{"become":{"__isSmartRef__":true,"id":16405},"onMouseDown":{"__isSmartRef__":true,"id":16409},"updatePicture":{"__isSmartRef__":true,"id":16417},"ruby":{"__isSmartRef__":true,"id":16421},"switchPositionWith":{"__isSmartRef__":true,"id":16425},"addNeighbour":{"__isSmartRef__":true,"id":16429},"amethyst":{"__isSmartRef__":true,"id":16433},"diopside":{"__isSmartRef__":true,"id":16437},"gemTypes":{"__isSmartRef__":true,"id":16441},"becomeRandomGem":{"__isSmartRef__":true,"id":16445},"mark":{"__isSmartRef__":true,"id":16449},"unmark":{"__isSmartRef__":true,"id":16453},"hasNeighbour":{"__isSmartRef__":true,"id":16457},"debugMarkNeighbours":{"__isSmartRef__":true,"id":16461},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":16465},"disappear":{"__isSmartRef__":true,"id":16469},"findStreakStart":{"__isSmartRef__":true,"id":16473},"buildStreak":{"__isSmartRef__":true,"id":16477},"scoreStreak":{"__isSmartRef__":true,"id":16481},"tryToStreak":{"__isSmartRef__":true,"id":16485},"blueDiamond":{"__isSmartRef__":true,"id":16489},"prehnite":{"__isSmartRef__":true,"id":16493},"debugUnmark":{"__isSmartRef__":true,"id":16497},"debugMark":{"__isSmartRef__":true,"id":16501},"citrine":{"__isSmartRef__":true,"id":16505}},"16405":{"varMapping":{"__isSmartRef__":true,"id":16406},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":16407},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16406":{"this":{"__isSmartRef__":true,"id":16302}},"16407":{"timestamp":{"__isSmartRef__":true,"id":16408},"user":"josi","tags":[]},"16408":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"16409":{"varMapping":{"__isSmartRef__":true,"id":16410},"source":"function onMouseDown(evt) {\n if (this.owner != $world && !this.owner.isPrototypeBox) {\n if (this.owner.markedGem == null) {\n this.mark();\n } else if (this.owner.markedGem == this) {\n this.unmark();\n } else {\n console.log(this.neighbours);\n console.log(this.owner.markedGem);\n if (this.hasNeighbour(this.owner.markedGem)) {\n this.switchPositionWith(this.owner.markedGem);\n this.owner.markedGem.unmark();\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":16415},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16410":{"this":{"__isSmartRef__":true,"id":16302},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16411}},"16411":{"$super":{"__isSmartRef__":true,"id":16412}},"16412":{"varMapping":{"__isSmartRef__":true,"id":16413},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":16414},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16413":{"obj":{"__isSmartRef__":true,"id":16302},"name":"onMouseDown"},"16414":{},"16415":{"timestamp":{"__isSmartRef__":true,"id":16416},"user":"soergel","tags":[]},"16416":{"isSerializedDate":true,"string":"Tue May 08 2012 19:38:37 GMT+0200 (CEST)"},"16417":{"varMapping":{"__isSmartRef__":true,"id":16418},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":16419},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16418":{"this":{"__isSmartRef__":true,"id":16302}},"16419":{"timestamp":{"__isSmartRef__":true,"id":16420},"user":"soergel","tags":[]},"16420":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"16421":{"varMapping":{"__isSmartRef__":true,"id":16422},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":16423},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16422":{"this":{"__isSmartRef__":true,"id":16302}},"16423":{"timestamp":{"__isSmartRef__":true,"id":16424},"user":"josi","tags":["gemtypes"]},"16424":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"16425":{"varMapping":{"__isSmartRef__":true,"id":16426},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":16427},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16426":{"this":{"__isSmartRef__":true,"id":16302}},"16427":{"timestamp":{"__isSmartRef__":true,"id":16428},"user":"jan.sandbrink","tags":[]},"16428":{"isSerializedDate":true,"string":"Tue May 08 2012 12:58:00 GMT+0200 (CEST)"},"16429":{"varMapping":{"__isSmartRef__":true,"id":16430},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16431},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16430":{"this":{"__isSmartRef__":true,"id":16302}},"16431":{"timestamp":{"__isSmartRef__":true,"id":16432},"user":"jan.sandbrink","tags":[]},"16432":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"16433":{"varMapping":{"__isSmartRef__":true,"id":16434},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":16435},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16434":{"this":{"__isSmartRef__":true,"id":16302}},"16435":{"timestamp":{"__isSmartRef__":true,"id":16436},"user":"josi","tags":["gemtypes"]},"16436":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"16437":{"varMapping":{"__isSmartRef__":true,"id":16438},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":16439},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16438":{"this":{"__isSmartRef__":true,"id":16302}},"16439":{"timestamp":{"__isSmartRef__":true,"id":16440},"user":"josi","tags":["gemtypes"]},"16440":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"16441":{"varMapping":{"__isSmartRef__":true,"id":16442},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"prehnite\", \"ruby\"];\n}","funcProperties":{"__isSmartRef__":true,"id":16443},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16442":{"this":{"__isSmartRef__":true,"id":16302}},"16443":{"timestamp":{"__isSmartRef__":true,"id":16444},"user":"josi","tags":[]},"16444":{"isSerializedDate":true,"string":"Mon May 07 2012 15:44:18 GMT+0200 (CEST)"},"16445":{"varMapping":{"__isSmartRef__":true,"id":16446},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":16447},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16446":{"this":{"__isSmartRef__":true,"id":16302}},"16447":{"timestamp":{"__isSmartRef__":true,"id":16448},"user":"josi","tags":[]},"16448":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"16449":{"varMapping":{"__isSmartRef__":true,"id":16450},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16451},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16450":{"this":{"__isSmartRef__":true,"id":16302}},"16451":{"timestamp":{"__isSmartRef__":true,"id":16452},"user":"soergel","tags":[]},"16452":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"16453":{"varMapping":{"__isSmartRef__":true,"id":16454},"source":"function unmark() {\n this.setFill(Color.white);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":16455},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16454":{"this":{"__isSmartRef__":true,"id":16302}},"16455":{"timestamp":{"__isSmartRef__":true,"id":16456},"user":"soergel","tags":[]},"16456":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:52 GMT+0200 (CEST)"},"16457":{"varMapping":{"__isSmartRef__":true,"id":16458},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":16459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16458":{"this":{"__isSmartRef__":true,"id":16302}},"16459":{"timestamp":{"__isSmartRef__":true,"id":16460},"user":"soergel","tags":[]},"16460":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"16461":{"varMapping":{"__isSmartRef__":true,"id":16462},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16463},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16462":{"this":{"__isSmartRef__":true,"id":16302}},"16463":{"timestamp":{"__isSmartRef__":true,"id":16464},"user":"soergel","tags":["debug"]},"16464":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"16465":{"varMapping":{"__isSmartRef__":true,"id":16466},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16467},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16466":{"this":{"__isSmartRef__":true,"id":16302}},"16467":{"timestamp":{"__isSmartRef__":true,"id":16468},"user":"soergel","tags":["debug"]},"16468":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"16469":{"varMapping":{"__isSmartRef__":true,"id":16470},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":16471},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16470":{"this":{"__isSmartRef__":true,"id":16302}},"16471":{"timestamp":{"__isSmartRef__":true,"id":16472},"user":"jan.sandbrink","tags":[]},"16472":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"16473":{"varMapping":{"__isSmartRef__":true,"id":16474},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16475},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16474":{"this":{"__isSmartRef__":true,"id":16302}},"16475":{"timestamp":{"__isSmartRef__":true,"id":16476},"user":"jan.sandbrink","tags":[]},"16476":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"16477":{"varMapping":{"__isSmartRef__":true,"id":16478},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":16479},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16478":{"this":{"__isSmartRef__":true,"id":16302}},"16479":{"timestamp":{"__isSmartRef__":true,"id":16480},"user":"jan.sandbrink","tags":[]},"16480":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"16481":{"varMapping":{"__isSmartRef__":true,"id":16482},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16483},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16482":{"this":{"__isSmartRef__":true,"id":16302}},"16483":{"timestamp":{"__isSmartRef__":true,"id":16484},"user":"jan.sandbrink","tags":[]},"16484":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"16485":{"varMapping":{"__isSmartRef__":true,"id":16486},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":16487},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16486":{"this":{"__isSmartRef__":true,"id":16302}},"16487":{"timestamp":{"__isSmartRef__":true,"id":16488},"user":"jan.sandbrink","tags":[]},"16488":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"16489":{"varMapping":{"__isSmartRef__":true,"id":16490},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":16491},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16490":{"this":{"__isSmartRef__":true,"id":16302}},"16491":{"timestamp":{"__isSmartRef__":true,"id":16492},"user":"josi","tags":["gemtypes"]},"16492":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"16493":{"varMapping":{"__isSmartRef__":true,"id":16494},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":16495},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16494":{"this":{"__isSmartRef__":true,"id":16302}},"16495":{"timestamp":{"__isSmartRef__":true,"id":16496},"user":"josi","tags":["gemtypes"]},"16496":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"16497":{"varMapping":{"__isSmartRef__":true,"id":16498},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":16499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16498":{"this":{"__isSmartRef__":true,"id":16302}},"16499":{"timestamp":{"__isSmartRef__":true,"id":16500},"user":"soergel","tags":["debug"]},"16500":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"16501":{"varMapping":{"__isSmartRef__":true,"id":16502},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":16503},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16502":{"this":{"__isSmartRef__":true,"id":16302}},"16503":{"timestamp":{"__isSmartRef__":true,"id":16504},"user":"soergel","tags":["debug"]},"16504":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"16505":{"varMapping":{"__isSmartRef__":true,"id":16506},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":16507},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16506":{"this":{"__isSmartRef__":true,"id":16302}},"16507":{"timestamp":{"__isSmartRef__":true,"id":16508},"user":"josi","tags":[]},"16508":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"16509":{"submorphs":[],"scripts":[],"id":"608D6DA5-CAB0-4D1E-A4EF-C0F93B21188A","shape":{"__isSmartRef__":true,"id":16510},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16516},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16513},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"Text","partsBinMetaInfo":{"__isSmartRef__":true,"id":16517},"textChunks":[{"__isSmartRef__":true,"id":16526}],"charsReplaced":"foo!?","lastFindLoc":10,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16528},"renderContextTable":{"__isSmartRef__":true,"id":16529},"eventHandler":{"__isSmartRef__":true,"id":16530},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16531},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","11ADBF9E-8B46-456B-AAE8-2EEB02CCEBAF","2D4F6D33-3C51-476E-AE40-60546A40DE68","A9E70861-E556-47AB-BEAD-D0FAECEB5600","3E98996B-8CBD-43EE-838B-7077F40CDCA5","EA703C32-8C90-434E-B41C-C68157AD30F2","66D5E71D-9222-4C09-8302-AA3CDEB20949","0EBA5973-0BAA-44DC-A022-D1CC0EC0BE46","3EEBF083-903F-4557-8F8B-41B6A2AE60F6","5ED65BB1-290A-42F1-9926-1C44E8888455","522B7458-AFC8-4DEA-877E-FD77F857AFB7","420A518D-042B-4C9E-8ACF-08ACFA991884"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"owner":{"__isSmartRef__":true,"id":60},"distanceToDragEvent":{"__isSmartRef__":true,"id":16532},"_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"16510":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16511},"_Extent":{"__isSmartRef__":true,"id":16512},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16513},"renderContextTable":{"__isSmartRef__":true,"id":16514},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16515},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16511":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16512":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16513":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16514":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16515":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16516":{"x":721.574712999999,"y":60.86806600000017,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16517":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16518},{"__isSmartRef__":true,"id":16520},{"__isSmartRef__":true,"id":16522},{"__isSmartRef__":true,"id":16524}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16518":{"date":{"__isSmartRef__":true,"id":16519},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16519":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16520":{"date":{"__isSmartRef__":true,"id":16521},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16521":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16522":{"date":{"__isSmartRef__":true,"id":16523},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16523":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16524":{"date":{"__isSmartRef__":true,"id":16525},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16525":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16526":{"style":{"__isSmartRef__":true,"id":16527},"morph":{"__isSmartRef__":true,"id":16509},"__SourceModuleName__":"Global.lively.morphic.TextCore","chunkOwner":{"__isSmartRef__":true,"id":16509},"storedString":"Score","__LivelyClassName__":"lively.morphic.TextChunk"},"16527":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16528":{"x":128.695652,"y":26,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16529":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16530":{"morph":{"__isSmartRef__":true,"id":16509},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16531":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16532":{"x":82.9799699599514,"y":-8.989984979975077,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16533":{"submorphs":[],"scripts":[],"id":"EC1E0590-309E-477C-8B62-0D4EC3DEDB02","shape":{"__isSmartRef__":true,"id":16534},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16540},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16537},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"Text1","partsBinMetaInfo":{"__isSmartRef__":true,"id":16541},"textChunks":[{"__isSmartRef__":true,"id":16550}],"charsReplaced":"S","lastFindLoc":2,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16552},"renderContextTable":{"__isSmartRef__":true,"id":16553},"eventHandler":{"__isSmartRef__":true,"id":16554},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16555},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","11ADBF9E-8B46-456B-AAE8-2EEB02CCEBAF","2D4F6D33-3C51-476E-AE40-60546A40DE68","A9E70861-E556-47AB-BEAD-D0FAECEB5600","3E98996B-8CBD-43EE-838B-7077F40CDCA5","EA703C32-8C90-434E-B41C-C68157AD30F2","66D5E71D-9222-4C09-8302-AA3CDEB20949","84032FE3-8AB6-4424-B83A-FF4E52EED123","0FAD02C2-3CE1-4CDE-91EB-323997C07917","5131ACA3-7F65-4E6A-91B8-6AC15443B98E","D7C16494-3067-4C45-BF94-DD9054822671","EA666F0C-4E3E-4DAF-907F-7383403BB8A6","7DA4B648-E9DD-47ED-8535-C1D59A964675"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":16556},"owner":{"__isSmartRef__":true,"id":60},"_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":1,"priorSelectionRange":[0,9],"__LivelyClassName__":"lively.morphic.Text"},"16534":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16535},"_Extent":{"__isSmartRef__":true,"id":16536},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16537},"renderContextTable":{"__isSmartRef__":true,"id":16538},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16539},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16535":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16536":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16537":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16538":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16539":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16540":{"x":681.6446779999991,"y":231.5422290000002,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16541":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16542},{"__isSmartRef__":true,"id":16544},{"__isSmartRef__":true,"id":16546},{"__isSmartRef__":true,"id":16548}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16542":{"date":{"__isSmartRef__":true,"id":16543},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16543":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16544":{"date":{"__isSmartRef__":true,"id":16545},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16545":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16546":{"date":{"__isSmartRef__":true,"id":16547},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16547":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16548":{"date":{"__isSmartRef__":true,"id":16549},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16549":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16550":{"style":{"__isSmartRef__":true,"id":16551},"morph":{"__isSmartRef__":true,"id":16533},"__SourceModuleName__":"Global.lively.morphic.TextCore","chunkOwner":{"__isSmartRef__":true,"id":16533},"storedString":"Highscore","__LivelyClassName__":"lively.morphic.TextChunk"},"16551":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16552":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16553":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16554":{"morph":{"__isSmartRef__":true,"id":16533},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16555":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16556":{"x":83.98998497997638,"y":-16.006009012015113,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16557":{"submorphs":[],"scripts":[],"id":"FCE73E56-7C84-4973-8416-69A5C4F30D90","shape":{"__isSmartRef__":true,"id":16558},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16564},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16561},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"ScoreIndicator1","partsBinMetaInfo":{"__isSmartRef__":true,"id":16565},"textChunks":[{"__isSmartRef__":true,"id":16574}],"charsReplaced":"1313337","lastFindLoc":7,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16576},"renderContextTable":{"__isSmartRef__":true,"id":16577},"eventHandler":{"__isSmartRef__":true,"id":16578},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16579},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","2573B759-62DC-415C-8492-96EE2DA1D148","695F454E-5EF5-42FA-823A-04C3A5025E0F","0F954437-59B2-4E33-BEE7-CFD1A4BAD12D","2C787A82-E571-4C6F-AFBD-AA01F76AD16B","322F315B-A585-484E-8C4E-3E635AC6188A","20964E56-8B08-4C7C-B99F-BC092C025505","6F046F59-08A3-4649-8105-BD15168FF188","E5745F85-8486-445D-93F3-DFF85B039E7E","0F610A45-E0CB-416D-9EE6-BEFC34CF6B9B","377EB211-6973-4CC2-B421-A363BD21B2A5","DDFA3B52-799A-428B-9BF5-8396E69562F9","6BB65F7B-2CB5-43D6-A615-DB33E9594787"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":16580},"#startLetters":"","_Align":"right","owner":{"__isSmartRef__":true,"id":60},"previousSelection":[3,3],"_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16581},"__LivelyClassName__":"lively.morphic.Text"},"16558":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16559},"_Extent":{"__isSmartRef__":true,"id":16560},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16561},"renderContextTable":{"__isSmartRef__":true,"id":16562},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16563},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16559":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16560":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16561":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16562":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16563":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16564":{"x":651.716642000001,"y":259.5022490000005,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16565":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16566},{"__isSmartRef__":true,"id":16568},{"__isSmartRef__":true,"id":16570},{"__isSmartRef__":true,"id":16572}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16566":{"date":{"__isSmartRef__":true,"id":16567},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16567":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16568":{"date":{"__isSmartRef__":true,"id":16569},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16569":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16570":{"date":{"__isSmartRef__":true,"id":16571},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16571":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16572":{"date":{"__isSmartRef__":true,"id":16573},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16573":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16574":{"style":{"__isSmartRef__":true,"id":16575},"chunkOwner":{"__isSmartRef__":true,"id":16557},"storedString":"1337","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"16575":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16576":{"x":128.695652,"y":26,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16577":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16578":{"morph":{"__isSmartRef__":true,"id":16557},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16579":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16580":{"x":92.97796695594423,"y":-17.022033044055377,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16581":{"setScore":{"__isSmartRef__":true,"id":16582}},"16582":{"varMapping":{"__isSmartRef__":true,"id":16583},"source":"function setScore(score) {\n this.setTextString(score);\n}","funcProperties":{"__isSmartRef__":true,"id":16584},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16583":{"this":{"__isSmartRef__":true,"id":16557}},"16584":{"timestamp":{"__isSmartRef__":true,"id":16585},"user":"jan.sandbrink","tags":[]},"16585":{"isSerializedDate":true,"string":"Tue May 08 2012 12:34:02 GMT+0200 (CEST)"},"16586":{"submorphs":[],"scripts":[],"id":"034E11CB-368A-4E0A-A12F-1166BD7756AF","shape":{"__isSmartRef__":true,"id":16587},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16593},"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16590},"showsHalos":false,"_FontSize":14,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"GameOverIndicator","partsBinMetaInfo":{"__isSmartRef__":true,"id":16594},"textChunks":[{"__isSmartRef__":true,"id":16603}],"charsReplaced":"foo!?","lastFindLoc":10,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16605},"renderContextTable":{"__isSmartRef__":true,"id":16606},"eventHandler":{"__isSmartRef__":true,"id":16607},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16608},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","11ADBF9E-8B46-456B-AAE8-2EEB02CCEBAF","2D4F6D33-3C51-476E-AE40-60546A40DE68","A9E70861-E556-47AB-BEAD-D0FAECEB5600","3E98996B-8CBD-43EE-838B-7077F40CDCA5","EA703C32-8C90-434E-B41C-C68157AD30F2","66D5E71D-9222-4C09-8302-AA3CDEB20949","0EBA5973-0BAA-44DC-A022-D1CC0EC0BE46","3EEBF083-903F-4557-8F8B-41B6A2AE60F6","B37357D0-B1A5-4E83-96FB-D2CA063F2DC3","5324E268-AF55-4777-9CAE-FDD6CAE93B2C","38DE0189-4A0F-4C1E-9026-26C0729D8F0A","4E984210-24D7-4796-9119-FCC9DD07159A"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"isBeingDragged":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":16609},"owner":{"__isSmartRef__":true,"id":60},"_TextColor":{"__isSmartRef__":true,"id":16242},"_Rotation":0,"_Scale":0.998001,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16610},"__LivelyClassName__":"lively.morphic.Text"},"16587":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16588},"_Extent":{"__isSmartRef__":true,"id":16589},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16590},"renderContextTable":{"__isSmartRef__":true,"id":16591},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16592},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16588":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16589":{"x":128.695652,"y":26,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16590":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16591":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16592":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16593":{"x":553.8905549999979,"y":226.5402300000007,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16594":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16595},{"__isSmartRef__":true,"id":16597},{"__isSmartRef__":true,"id":16599},{"__isSmartRef__":true,"id":16601}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16595":{"date":{"__isSmartRef__":true,"id":16596},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16596":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16597":{"date":{"__isSmartRef__":true,"id":16598},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16598":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16599":{"date":{"__isSmartRef__":true,"id":16600},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16600":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16601":{"date":{"__isSmartRef__":true,"id":16602},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16602":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16603":{"style":{"__isSmartRef__":true,"id":16604},"chunkOwner":{"__isSmartRef__":true,"id":16586},"storedString":"","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"16604":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"16605":{"x":128.695652,"y":26,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16606":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16607":{"morph":{"__isSmartRef__":true,"id":16586},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16608":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16609":{"x":90.00000000000159,"y":-12.99399098798574,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16610":{"gameOver":{"__isSmartRef__":true,"id":16611},"gameStarted":{"__isSmartRef__":true,"id":16615}},"16611":{"varMapping":{"__isSmartRef__":true,"id":16612},"source":"function gameOver() {\n this.setTextString(\"GAME OVER\");\n}","funcProperties":{"__isSmartRef__":true,"id":16613},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16612":{"this":{"__isSmartRef__":true,"id":16586}},"16613":{"timestamp":{"__isSmartRef__":true,"id":16614},"user":"jan.sandbrink","tags":[]},"16614":{"isSerializedDate":true,"string":"Mon May 14 2012 11:46:18 GMT+0200 (CEST)"},"16615":{"varMapping":{"__isSmartRef__":true,"id":16616},"source":"function gameStarted() {\n this.setTextString(\"\");\n}","funcProperties":{"__isSmartRef__":true,"id":16617},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16616":{"this":{"__isSmartRef__":true,"id":16586}},"16617":{"timestamp":{"__isSmartRef__":true,"id":16618},"user":"jan.sandbrink","tags":[]},"16618":{"isSerializedDate":true,"string":"Mon May 14 2012 11:46:06 GMT+0200 (CEST)"},"16619":{"submorphs":[],"scripts":[],"id":"435CCF0A-840C-4943-8125-B551328D4896","shape":{"__isSmartRef__":true,"id":16620},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16626},"_MaxTextWidth":249.95403951664724,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":16623},"showsHalos":false,"_FontSize":20,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"Text2","partsBinMetaInfo":{"__isSmartRef__":true,"id":16627},"textChunks":[{"__isSmartRef__":true,"id":16636}],"charsReplaced":"Highscore","lastFindLoc":9,"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":16638},"renderContextTable":{"__isSmartRef__":true,"id":16639},"eventHandler":{"__isSmartRef__":true,"id":16640},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Padding":{"__isSmartRef__":true,"id":16641},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","11ADBF9E-8B46-456B-AAE8-2EEB02CCEBAF","2D4F6D33-3C51-476E-AE40-60546A40DE68","A9E70861-E556-47AB-BEAD-D0FAECEB5600","3E98996B-8CBD-43EE-838B-7077F40CDCA5","EA703C32-8C90-434E-B41C-C68157AD30F2","66D5E71D-9222-4C09-8302-AA3CDEB20949","84032FE3-8AB6-4424-B83A-FF4E52EED123","0FAD02C2-3CE1-4CDE-91EB-323997C07917","5131ACA3-7F65-4E6A-91B8-6AC15443B98E","D7C16494-3067-4C45-BF94-DD9054822671","EA666F0C-4E3E-4DAF-907F-7383403BB8A6","7DA4B648-E9DD-47ED-8535-C1D59A964675","4205BE17-C142-43FE-805E-B6EAE2265539"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":249.95403951664724,"_MinTextHeight":null,"isBeingDragged":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":16642},"_TextColor":{"__isSmartRef__":true,"id":16643},"owner":{"__isSmartRef__":true,"id":60},"previousSelection":[3,3],"_Rotation":0,"_Scale":0.998001,"__LivelyClassName__":"lively.morphic.Text"},"16620":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":16621},"_Extent":{"__isSmartRef__":true,"id":16622},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16623},"renderContextTable":{"__isSmartRef__":true,"id":16624},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16625},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16621":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16622":{"x":257.95403951664724,"y":66,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16623":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16624":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16625":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16626":{"x":420.1564219999992,"y":21.962019000000225,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16627":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":16628},{"__isSmartRef__":true,"id":16630},{"__isSmartRef__":true,"id":16632},{"__isSmartRef__":true,"id":16634}],"revisionOnLoad":154263,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16628":{"date":{"__isSmartRef__":true,"id":16629},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9"},"16629":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:32:09 GMT+0200 (CEST)"},"16630":{"date":{"__isSmartRef__":true,"id":16631},"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF"},"16631":{"isSerializedDate":true,"string":"Sat Apr 21 2012 07:31:43 GMT+0200 (CEST)"},"16632":{"date":{"__isSmartRef__":true,"id":16633},"author":"undefined","message":"Set the inset as: this.setPadding(Rectangle.inset(4,2)). This gives it a more pleasing appearance with a border, and also makes it easier to select near the bounds.","id":"BD5B0E4C-4830-4863-A013-35BB66D5AD6F"},"16633":{"isSerializedDate":true,"string":"Mon Feb 27 2012 06:20:38 GMT+0100 (CET)"},"16634":{"date":{"__isSmartRef__":true,"id":16635},"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0"},"16635":{"isSerializedDate":true,"string":"Sat Apr 21 2012 16:30:30 GMT+0200 (CEST)"},"16636":{"style":{"__isSmartRef__":true,"id":16637},"morph":{"__isSmartRef__":true,"id":16619},"__SourceModuleName__":"Global.lively.morphic.TextCore","chunkOwner":{"__isSmartRef__":true,"id":16619},"storedString":"Yet Another Bejeweled Clone ...","__LivelyClassName__":"lively.morphic.TextChunk"},"16637":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16638":{"x":257.95403951664724,"y":66,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16639":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16640":{"morph":{"__isSmartRef__":true,"id":16619},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16641":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16642":{"x":83.98998497997638,"y":-16.006009012015113,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16643":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16644":{"position":{"__isSmartRef__":true,"id":16645},"_Extent":{"__isSmartRef__":true,"id":16646},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16647},"_Fill":{"__isSmartRef__":true,"id":16648},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16649},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16650},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16645":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16646":{"x":798.6006999999992,"y":505.18840599999965,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16647":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16648":{"r":0.0060878553845526324,"g":0,"b":0.3391805142822193,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16649":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16650":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16651":{"x":209,"y":122,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16652":{"partsSpaceName":"PartsBin/groupBejeweled/","__SourceModuleName__":"Global.lively.PartsBin","comment":"Our Bejeweled board to put the gems on","migrationLevel":4,"partName":"GemBoard","changes":[{"__isSmartRef__":true,"id":16653},{"__isSmartRef__":true,"id":16655},{"__isSmartRef__":true,"id":16657},{"__isSmartRef__":true,"id":16659},{"__isSmartRef__":true,"id":16661},{"__isSmartRef__":true,"id":16663}],"revisionOnLoad":162175,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16653":{"date":{"__isSmartRef__":true,"id":16654},"author":"soergel","message":"no comment","id":"30926D46-00C1-4F97-A64C-603BD6C898B1"},"16654":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:43:24 GMT+0200 (CEST)"},"16655":{"date":{"__isSmartRef__":true,"id":16656},"author":"soergel","message":"first version","id":"00D9A790-91D2-4A63-8FA4-78C344DA038C"},"16656":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:30 GMT+0200 (CEST)"},"16657":{"date":{"__isSmartRef__":true,"id":16658},"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2"},"16658":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:53:45 GMT+0100 (CET)"},"16659":{"date":{"__isSmartRef__":true,"id":16660},"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B"},"16660":{"isSerializedDate":true,"string":"Sat Feb 25 2012 02:59:09 GMT+0100 (CET)"},"16661":{"date":{"__isSmartRef__":true,"id":16662},"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7"},"16662":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:42:26 GMT+0100 (CET)"},"16663":{"date":{"__isSmartRef__":true,"id":16664},"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350"},"16664":{"isSerializedDate":true,"string":"Mon Apr 09 2012 13:42:07 GMT+0200 (CEST)"},"16665":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16666":{"morph":{"__isSmartRef__":true,"id":60},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16667":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16668}},"16668":{"test01IsMorph":{"__isSmartRef__":true,"id":16669}},"16669":{"varMapping":{"__isSmartRef__":true,"id":16670},"source":"function test01IsMorph(aPart) {\n this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":16671},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16670":{"this":{"__isSmartRef__":true,"id":16667}},"16671":{},"16672":{"x":799.5987009999992,"y":505.18840599999965,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16673":{"submorphs":[{"__isSmartRef__":true,"id":16674}],"scripts":[],"id":"567D401E-5E34-43E0-9C43-9A16C906A731","shape":{"__isSmartRef__":true,"id":16720},"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":16727},"showsHalos":false,"name":"BasicGem","partsBinMetaInfo":{"__isSmartRef__":true,"id":16728},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":16767},"eventHandler":{"__isSmartRef__":true,"id":16768},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","AF79EBFF-EF50-4426-AAE4-ED153D00A7E8","231CE1FA-9ED5-498D-A2DF-89DCD8144910","353F1852-04EC-4BCE-B2D6-4B5BF1753990","DDBE40C6-C133-41C6-B7AB-CA63C08F24F5","D1192A47-67F3-449E-9223-70A2A4F36856","75566D59-70F6-4AC8-8499-D875B662ECE5","E84F6B69-CB86-4B23-A179-E1901C44E7CA","F734BDBC-D3D8-42FB-9D16-548E840AB400","C174E41E-99FE-4D88-8A99-9BF241D0E165","B798353D-D92A-4D24-9726-BDB0AFAE5660","4E12B7B9-9BA2-467C-ACCD-FDFDE3C0DC33","5E04972C-44C7-415F-B605-60EA8C9BCD29","374843A8-AD07-4F8D-88B2-0634A578EB14","07809FA0-A598-444A-B93D-42AB64283836","E878F9DF-A780-4AAB-956C-259018E74EB1","5FDA9CAD-1AB7-41B0-AB29-7AED81CE9321","2726CC2B-6ECF-4368-9B68-F7C9DF9EFCEC","6327F5FC-33CF-4DD8-B5A3-C22EAEA3128F","74A3F065-BA26-4115-8BEA-1A792FB89BB8","EDE35919-4CF0-4C71-A0E0-0CE22C0667B8","D7035A71-41B4-4732-B905-50C7606B41ED","46388232-02EC-4B63-B17C-144511B8833E","F422CEDD-E5FB-460F-B7F6-51C8D23E532E","20659DFA-EB76-4512-BD73-5E1A131B7876","DC654FC2-2207-4E58-9112-F036389CE174","8972791B-72BF-49D9-9019-EBF824E16F1D","3EE080D6-CBA4-4469-98B6-5C762F93980C","661A3584-063D-4AAF-9325-E1A48622B6A5"],"partTests":{"__isSmartRef__":true,"id":16769},"_ClipMode":"visible","priorExtent":{"__isSmartRef__":true,"id":16774},"isBeingDragged":false,"grabbingEnabled":false,"draggingEnabled":false,"moved":true,"directions":{"__isSmartRef__":true,"id":16775},"neighbours":[null,null,null,null],"#startLetters":"","isGem":true,"isDirty":false,"gem":"emerald","shouldBeDeleted":false,"prevScroll":[0,0],"owner":null,"_Rotation":0,"_Scale":1.0040100200350572,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16776},"__LivelyClassName__":"lively.morphic.Box"},"16674":{"submorphs":[{"__isSmartRef__":true,"id":16675},{"__isSmartRef__":true,"id":16686},{"__isSmartRef__":true,"id":16696}],"scripts":[],"shape":{"__isSmartRef__":true,"id":16706},"derivationIds":[null,"4BC28AF3-05B0-4746-9A43-CDB37C384755","1202424B-E159-44EA-BA2E-AF64AE2B725A","BCD640AE-8267-4E19-B342-E124777D21D7"],"id":"BBE4C125-C0B9-4740-B077-B963A0B200ED","renderContextTable":{"__isSmartRef__":true,"id":16717},"eventHandler":{"__isSmartRef__":true,"id":16718},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16673},"_Position":{"__isSmartRef__":true,"id":16719},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"__LivelyClassName__":"lively.morphic.Path"},"16675":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":16676},"derivationIds":[null,"AB037B4D-D1CA-41D6-8C01-53402DAC598F","8E6A49D5-BB63-4B5F-BA22-AB655B94AF2C","5A5C8BDB-FF34-4EFE-951E-DDC911D061CD"],"id":"E36EB14E-8B51-48D5-BE28-1F8CB2BB83A9","renderContextTable":{"__isSmartRef__":true,"id":16684},"eventHandler":{"__isSmartRef__":true,"id":16685},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16674},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"__LivelyClassName__":"lively.morphic.Path"},"16676":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16677},{"__isSmartRef__":true,"id":16678}],"renderContextTable":{"__isSmartRef__":true,"id":16679},"_Position":{"__isSmartRef__":true,"id":16680},"_Extent":{"__isSmartRef__":true,"id":16681},"_Padding":{"__isSmartRef__":true,"id":16682},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":16683},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16677":{"isAbsolute":true,"x":25,"y":8,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16678":{"isAbsolute":true,"x":25,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16679":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16680":{"x":23,"y":6,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16681":{"x":3,"y":25,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16682":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16683":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16684":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16685":{"morph":{"__isSmartRef__":true,"id":16675},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16686":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":16687},"derivationIds":[null,"B2C7A79B-B687-4BFE-AF3F-6C2720ECDB73","0D117D66-2D14-4E57-BB84-344BA73AC602","06FC3CB7-BE88-45B0-801A-F5BAC9AD821F"],"id":"EC93A197-9396-465E-AB75-4B03E4907C8C","renderContextTable":{"__isSmartRef__":true,"id":16694},"eventHandler":{"__isSmartRef__":true,"id":16695},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16674},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"__LivelyClassName__":"lively.morphic.Path"},"16687":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16688},{"__isSmartRef__":true,"id":16689}],"renderContextTable":{"__isSmartRef__":true,"id":16690},"_Position":{"__isSmartRef__":true,"id":16691},"_Extent":{"__isSmartRef__":true,"id":16692},"_Padding":{"__isSmartRef__":true,"id":16693},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":16683},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16688":{"isAbsolute":true,"x":9,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16689":{"isAbsolute":true,"x":25,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16690":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16691":{"x":7,"y":28,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16692":{"x":19,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16693":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16694":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16695":{"morph":{"__isSmartRef__":true,"id":16686},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16696":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":16697},"derivationIds":[null,"B190EFCC-18CC-4462-AF93-AAD6722CE2AF","76FA41EC-56AE-4286-A022-18F7261A4505","6BD87AF2-6911-4B47-9AA2-41B58A6C3D77"],"id":"B70AD881-1807-44C6-98E2-E4A116D29F80","renderContextTable":{"__isSmartRef__":true,"id":16704},"eventHandler":{"__isSmartRef__":true,"id":16705},"_ClipMode":"visible","droppingEnabled":false,"halosEnabled":true,"owner":{"__isSmartRef__":true,"id":16674},"grabbingEnabled":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"__LivelyClassName__":"lively.morphic.Path"},"16697":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16698},{"__isSmartRef__":true,"id":16699}],"renderContextTable":{"__isSmartRef__":true,"id":16700},"_Position":{"__isSmartRef__":true,"id":16701},"_Extent":{"__isSmartRef__":true,"id":16702},"_Padding":{"__isSmartRef__":true,"id":16703},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":16683},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16698":{"isAbsolute":true,"x":41,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16699":{"isAbsolute":true,"x":25,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16700":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16701":{"x":23,"y":28,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16702":{"x":19,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16703":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16704":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16705":{"morph":{"__isSmartRef__":true,"id":16696},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16706":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":16707},{"__isSmartRef__":true,"id":16708},{"__isSmartRef__":true,"id":16709},{"__isSmartRef__":true,"id":16710},{"__isSmartRef__":true,"id":16711}],"renderContextTable":{"__isSmartRef__":true,"id":16712},"_Position":{"__isSmartRef__":true,"id":16713},"_Extent":{"__isSmartRef__":true,"id":16714},"_Padding":{"__isSmartRef__":true,"id":16715},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16683},"_Fill":{"__isSmartRef__":true,"id":16716},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"16707":{"isAbsolute":true,"x":25,"y":9,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"16708":{"isAbsolute":true,"x":38,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16709":{"isAbsolute":true,"x":30,"y":41,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16710":{"isAbsolute":true,"x":20,"y":41,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16711":{"isAbsolute":true,"x":12,"y":30,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"16712":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"16713":{"x":11,"y":8,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16714":{"x":27,"y":33,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16715":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16716":{"r":0.10196078431372549,"g":1,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16717":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16718":{"morph":{"__isSmartRef__":true,"id":16674},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16719":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16720":{"position":{"__isSmartRef__":true,"id":16721},"_Extent":{"__isSmartRef__":true,"id":16722},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16723},"_Fill":{"__isSmartRef__":true,"id":16724},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16725},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":16726},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16721":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16722":{"x":49.20369420394888,"y":50.19970019994978,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16723":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16724":{"r":0.8,"g":0.8,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16725":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16726":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16727":{"x":483.03248399999995,"y":67.86406799999999,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16728":{"partsSpaceName":"PartsBin/groupBejeweled/","__SourceModuleName__":"Global.lively.PartsBin","comment":"This is a basic gem that can become different types of gems (such as ruby and amethyst).","migrationLevel":4,"partName":"BasicGem","changes":[{"__isSmartRef__":true,"id":16729},{"__isSmartRef__":true,"id":16731},{"__isSmartRef__":true,"id":16733},{"__isSmartRef__":true,"id":16735},{"__isSmartRef__":true,"id":16737},{"__isSmartRef__":true,"id":16739},{"__isSmartRef__":true,"id":16741},{"__isSmartRef__":true,"id":16743},{"__isSmartRef__":true,"id":16745},{"__isSmartRef__":true,"id":16747},{"__isSmartRef__":true,"id":16749},{"__isSmartRef__":true,"id":16751},{"__isSmartRef__":true,"id":16753},{"__isSmartRef__":true,"id":16755},{"__isSmartRef__":true,"id":16757},{"__isSmartRef__":true,"id":16759},{"__isSmartRef__":true,"id":16761},{"__isSmartRef__":true,"id":16763},{"__isSmartRef__":true,"id":16765}],"revisionOnLoad":162033,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16729":{"date":{"__isSmartRef__":true,"id":16730},"author":"josi","message":"another gemType","id":"16C44641-15C6-4404-A5C5-ED4650E67206"},"16730":{"isSerializedDate":true,"string":"Mon May 07 2012 15:56:34 GMT+0200 (CEST)"},"16731":{"date":{"__isSmartRef__":true,"id":16732},"author":"soergel","message":"overridden","id":"F2823C2C-326F-4A57-95DA-860674FAAE98"},"16732":{"isSerializedDate":true,"string":"Wed May 02 2012 13:40:12 GMT+0200 (CEST)"},"16733":{"date":{"__isSmartRef__":true,"id":16734},"author":"josi","message":"gem type can now be changed into amethyst","id":"BC7F4160-A8F1-492B-806B-E0C2DB3C3D2A"},"16734":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:38:32 GMT+0200 (CEST)"},"16735":{"date":{"__isSmartRef__":true,"id":16736},"author":"josi","message":"can now become a styled ruby ;)","id":"5FD66E1D-7111-430C-A6A6-AC42566771E6"},"16736":{"isSerializedDate":true,"string":"Thu Apr 26 2012 13:43:28 GMT+0200 (CEST)"},"16737":{"date":{"__isSmartRef__":true,"id":16738},"author":"josi","message":"some minor changes (like size and no border for \"gems\")","id":"08765E93-94C3-44D0-840E-5260CAD06CE8"},"16738":{"isSerializedDate":true,"string":"Thu Apr 26 2012 12:12:32 GMT+0200 (CEST)"},"16739":{"date":{"__isSmartRef__":true,"id":16740},"author":"josi","message":"basic functionality of adding real picture (morph) to gem","id":"6A73B3AE-225F-4447-9129-87575BFE4893"},"16740":{"isSerializedDate":true,"string":"Thu Apr 26 2012 11:58:39 GMT+0200 (CEST)"},"16741":{"date":{"__isSmartRef__":true,"id":16742},"author":"josi","message":"added become-functionality (inspired by the FreedomSpeech group), but still lacks of a lot of functionality","id":"E31E69D2-46FE-487C-810B-C284826E0A11"},"16742":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:49:02 GMT+0200 (CEST)"},"16743":{"date":{"__isSmartRef__":true,"id":16744},"author":"josi","message":"no comment","id":"3B32B7A3-D2B4-41A4-AFD2-59AA1837004C"},"16744":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:01:57 GMT+0200 (CEST)"},"16745":{"date":{"__isSmartRef__":true,"id":16746},"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350"},"16746":{"isSerializedDate":true,"string":"Mon Apr 09 2012 13:42:07 GMT+0200 (CEST)"},"16747":{"date":{"__isSmartRef__":true,"id":16748},"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7"},"16748":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:42:26 GMT+0100 (CET)"},"16749":{"date":{"__isSmartRef__":true,"id":16750},"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B"},"16750":{"isSerializedDate":true,"string":"Sat Feb 25 2012 02:59:09 GMT+0100 (CET)"},"16751":{"date":{"__isSmartRef__":true,"id":16752},"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2"},"16752":{"isSerializedDate":true,"string":"Wed Mar 14 2012 10:53:45 GMT+0100 (CET)"},"16753":{"date":{"__isSmartRef__":true,"id":16754},"author":"josi","message":"more styled version of ruby","id":"E35A76D9-3A82-4589-B827-20254EA51FB8"},"16754":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:36:26 GMT+0200 (CEST)"},"16755":{"date":{"__isSmartRef__":true,"id":16756},"author":"josi","message":"another gemType & array for all gemTypes","id":"E4C93F7A-B95D-4587-8485-C7940304143B"},"16756":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:52:49 GMT+0200 (CEST)"},"16757":{"date":{"__isSmartRef__":true,"id":16758},"author":"josi","message":"styling diopside","id":"65B5E617-A4DF-460D-A7F4-1F8DEC927840"},"16758":{"isSerializedDate":true,"string":"Mon Apr 30 2012 13:06:13 GMT+0200 (CEST)"},"16759":{"date":{"__isSmartRef__":true,"id":16760},"author":"josi","message":"updating picture is now more general (but needs some refactoring!!!)","id":"C235D240-065B-4DD0-BCBD-00A9B6AD63A1"},"16760":{"isSerializedDate":true,"string":"Mon Apr 30 2012 14:56:55 GMT+0200 (CEST)"},"16761":{"date":{"__isSmartRef__":true,"id":16762},"author":"josi","message":"added blue diamond","id":"62B702D1-677C-4634-8751-EE3FBEC68D50"},"16762":{"isSerializedDate":true,"string":"Mon Apr 30 2012 15:22:13 GMT+0200 (CEST)"},"16763":{"date":{"__isSmartRef__":true,"id":16764},"author":"josi","message":"added prehnite","id":"21C33415-A95E-46F9-A434-B17D3B1D3FE3"},"16764":{"isSerializedDate":true,"string":"Tue May 01 2012 16:17:53 GMT+0200 (CEST)"},"16765":{"date":{"__isSmartRef__":true,"id":16766},"author":"josi","message":"merged (hopefully doesn't overwrite anything again)","id":"3863DEF2-14D9-4777-9E4B-01A2957B34ED"},"16766":{"isSerializedDate":true,"string":"Wed May 02 2012 22:16:49 GMT+0200 (CEST)"},"16767":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"16768":{"morph":{"__isSmartRef__":true,"id":16673},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16769":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16770}},"16770":{"test01IsMorph":{"__isSmartRef__":true,"id":16771}},"16771":{"varMapping":{"__isSmartRef__":true,"id":16772},"source":"function test01IsMorph(aPart) {\n this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":16773},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16772":{"this":{"__isSmartRef__":true,"id":16769}},"16773":{},"16774":{"x":49.20369420394888,"y":51.19570619595078,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16775":{"left":0,"up":1,"right":2,"down":3},"16776":{"become":{"__isSmartRef__":true,"id":16777},"onMouseDown":{"__isSmartRef__":true,"id":16781},"updatePicture":{"__isSmartRef__":true,"id":16789},"ruby":{"__isSmartRef__":true,"id":16793},"switchPositionWith":{"__isSmartRef__":true,"id":16797},"addNeighbour":{"__isSmartRef__":true,"id":16801},"amethyst":{"__isSmartRef__":true,"id":16805},"diopside":{"__isSmartRef__":true,"id":16809},"gemTypes":{"__isSmartRef__":true,"id":16813},"becomeRandomGem":{"__isSmartRef__":true,"id":16817},"mark":{"__isSmartRef__":true,"id":16821},"unmark":{"__isSmartRef__":true,"id":16825},"hasNeighbour":{"__isSmartRef__":true,"id":16829},"debugMarkNeighbours":{"__isSmartRef__":true,"id":16833},"debugUnmarkNeighbours":{"__isSmartRef__":true,"id":16837},"disappear":{"__isSmartRef__":true,"id":16841},"findStreakStart":{"__isSmartRef__":true,"id":16845},"buildStreak":{"__isSmartRef__":true,"id":16849},"scoreStreak":{"__isSmartRef__":true,"id":16853},"tryToStreak":{"__isSmartRef__":true,"id":16857},"blueDiamond":{"__isSmartRef__":true,"id":16861},"prehnite":{"__isSmartRef__":true,"id":16865},"debugUnmark":{"__isSmartRef__":true,"id":16869},"debugMark":{"__isSmartRef__":true,"id":16873},"citrine":{"__isSmartRef__":true,"id":16877},"move":{"__isSmartRef__":true,"id":16881},"performMovement":{"__isSmartRef__":true,"id":16885},"getDirectionForNeighbour":{"__isSmartRef__":true,"id":16889},"zircon":{"__isSmartRef__":true,"id":16893},"emerald":{"__isSmartRef__":true,"id":16897},"canScoreBySwitchingWith":{"__isSmartRef__":true,"id":16901}},"16777":{"varMapping":{"__isSmartRef__":true,"id":16778},"source":"function become(gem) {\n this.gem = gem;\n this.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":16779},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16778":{"this":{"__isSmartRef__":true,"id":16673}},"16779":{"timestamp":{"__isSmartRef__":true,"id":16780},"user":"josi","tags":[]},"16780":{"isSerializedDate":true,"string":"Wed Apr 25 2012 16:17:19 GMT+0200 (CEST)"},"16781":{"varMapping":{"__isSmartRef__":true,"id":16782},"source":"function onMouseDown(evt) {\n var markedGem = this.owner.markedGem;\n if (this.owner != $world) {\n if (markedGem == null) {\n this.mark();\n } else if (markedGem == this) {\n this.unmark();\n } else {\n if (this.hasNeighbour(markedGem)) {\n var thisGem = this;\n var thisDirection = this.getDirectionForNeighbour(markedGem);\n var otherDirection = (thisDirection + 2) % 4;\n markedGem.move(otherDirection);\n this.move(thisDirection, function() {\n thisGem.switchPositionWith(markedGem);\n markedGem.unmark();\n });\n }\n }\n }\n\n console.log(this.gem);\n}","funcProperties":{"__isSmartRef__":true,"id":16787},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16782":{"this":{"__isSmartRef__":true,"id":16673},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16783}},"16783":{"$super":{"__isSmartRef__":true,"id":16784}},"16784":{"varMapping":{"__isSmartRef__":true,"id":16785},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch (e) {\n if ($world) \n $world.logError(e, 'Error in $super call')\n else\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":16786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16785":{"obj":{"__isSmartRef__":true,"id":16673},"name":"onMouseDown"},"16786":{},"16787":{"timestamp":{"__isSmartRef__":true,"id":16788},"user":"soergel","tags":[]},"16788":{"isSerializedDate":true,"string":"Tue May 08 2012 22:44:31 GMT+0200 (CEST)"},"16789":{"varMapping":{"__isSmartRef__":true,"id":16790},"source":"function updatePicture() {\n this.removeAllMorphs();\n if (this.gemTypes().include(this.gem)) {\n this.addMorph(this[this.gem]());\n this.topMorph().setPosition(pt(0, 0));\n } else {\n gem = Morph.makeRectangle(0, 0, 30, 30);\n gem.setFill(Color.random());\n gem.setPosition(pt(10, 10));\n gem.setBorderWidth(0);\n this.addMorph(gem);\n }\n this.topMorph().disableGrabbing(true);\n this.topMorph().disableDropping(true);\n}","funcProperties":{"__isSmartRef__":true,"id":16791},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16790":{"this":{"__isSmartRef__":true,"id":16673}},"16791":{"timestamp":{"__isSmartRef__":true,"id":16792},"user":"soergel","tags":[]},"16792":{"isSerializedDate":true,"string":"Sun Apr 29 2012 21:44:47 GMT+0200 (CEST)"},"16793":{"varMapping":{"__isSmartRef__":true,"id":16794},"source":"function ruby() {\n var ruby = Morph.makePolygon([pt(15, 9), pt(35, 9), pt(45, 20), pt(25, 41), pt(25, 41), pt(5, 20)], 1, Color.white, Color.red);\n line = Morph.makeLine([pt(5, 20, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(45, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 9, 0), pt(13, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 9, 0), pt(37, 20)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(37, 20, 0), pt(25, 41)], 2, Color.white);\n ruby.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return ruby;\n}","funcProperties":{"__isSmartRef__":true,"id":16795},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16794":{"this":{"__isSmartRef__":true,"id":16673}},"16795":{"timestamp":{"__isSmartRef__":true,"id":16796},"user":"josi","tags":["gemtypes"]},"16796":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:35:37 GMT+0200 (CEST)"},"16797":{"varMapping":{"__isSmartRef__":true,"id":16798},"source":"function switchPositionWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n if(!this.owner.runFieldPhysics())\n {\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n alertOK(\"Move not allowed!\");\n }\n\n this.updatePicture();\n gem.updatePicture();\n}","funcProperties":{"__isSmartRef__":true,"id":16799},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16798":{"this":{"__isSmartRef__":true,"id":16673}},"16799":{"timestamp":{"__isSmartRef__":true,"id":16800},"user":"jan.sandbrink","tags":[]},"16800":{"isSerializedDate":true,"string":"Mon May 14 2012 11:19:03 GMT+0200 (CEST)"},"16801":{"varMapping":{"__isSmartRef__":true,"id":16802},"source":"function addNeighbour(gem, direction) {\n this.neighbours[direction] = gem;\n gem.neighbours[(direction+2) % 4] = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16803},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16802":{"this":{"__isSmartRef__":true,"id":16673}},"16803":{"timestamp":{"__isSmartRef__":true,"id":16804},"user":"jan.sandbrink","tags":[]},"16804":{"isSerializedDate":true,"string":"Thu Apr 26 2012 14:12:13 GMT+0200 (CEST)"},"16805":{"varMapping":{"__isSmartRef__":true,"id":16806},"source":"function amethyst() {\n var amethyst = Morph.makePolygon([pt(14, 9), pt(36, 9), pt(41, 14), pt(41, 36), pt(36, 41), pt(14, 41), pt(9, 36), pt(9, 14)], 1, Color.white, Color.rgb(138, 40, 143));\n line = Morph.makeLine([pt(17, 17, 0), pt(33, 17)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 33, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(33, 17, 0), pt(33, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(17, 17, 0), pt(17, 33)], 2, Color.rgb(200, 120, 200));\n amethyst.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return amethyst;\n}","funcProperties":{"__isSmartRef__":true,"id":16807},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16806":{"this":{"__isSmartRef__":true,"id":16673}},"16807":{"timestamp":{"__isSmartRef__":true,"id":16808},"user":"josi","tags":["gemtypes"]},"16808":{"isSerializedDate":true,"string":"Sat Apr 28 2012 23:35:45 GMT+0200 (CEST)"},"16809":{"varMapping":{"__isSmartRef__":true,"id":16810},"source":"function diopside() {\n var diopside = Morph.makePolygon([pt(9, 25), pt(15, 15), pt(35, 15), pt(41, 25), pt(35, 35), pt(15, 35)], 1, Color.white, Color.rgb(47, 92, 0));\n line = Morph.makeLine([pt(19, 25, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 16, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(16, 34, 0), pt(19, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 16, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(34, 34, 0), pt(31, 25)], 2, Color.rgb(100, 200, 0));\n diopside.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diopside;\n}","funcProperties":{"__isSmartRef__":true,"id":16811},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16810":{"this":{"__isSmartRef__":true,"id":16673}},"16811":{"timestamp":{"__isSmartRef__":true,"id":16812},"user":"josi","tags":["gemtypes"]},"16812":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:20 GMT+0200 (CEST)"},"16813":{"varMapping":{"__isSmartRef__":true,"id":16814},"source":"function gemTypes() {\n return [\"amethyst\", \"blueDiamond\", \"citrine\", \"diopside\", \"emerald\", \"prehnite\", \"ruby\", \"zircon\"];\n}","funcProperties":{"__isSmartRef__":true,"id":16815},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16814":{"this":{"__isSmartRef__":true,"id":16673}},"16815":{"timestamp":{"__isSmartRef__":true,"id":16816},"user":"josi","tags":[]},"16816":{"isSerializedDate":true,"string":"Thu May 10 2012 15:56:15 GMT+0200 (CEST)"},"16817":{"varMapping":{"__isSmartRef__":true,"id":16818},"source":"function becomeRandomGem() {\n gemTypes = this.gemTypes();\n this.become(gemTypes[Math.round(Math.random() * (gemTypes.length - 1))]);\n}","funcProperties":{"__isSmartRef__":true,"id":16819},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16818":{"this":{"__isSmartRef__":true,"id":16673}},"16819":{"timestamp":{"__isSmartRef__":true,"id":16820},"user":"josi","tags":[]},"16820":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:50:07 GMT+0200 (CEST)"},"16821":{"varMapping":{"__isSmartRef__":true,"id":16822},"source":"function mark() {\n this.setFill(Color.yellow);\n\n this.owner.markedGem = this;\n}","funcProperties":{"__isSmartRef__":true,"id":16823},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16822":{"this":{"__isSmartRef__":true,"id":16673}},"16823":{"timestamp":{"__isSmartRef__":true,"id":16824},"user":"soergel","tags":[]},"16824":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:29 GMT+0200 (CEST)"},"16825":{"varMapping":{"__isSmartRef__":true,"id":16826},"source":"function unmark() {\n this.setFill(Color.white);\n\n this.owner.markedGem = null;\n}","funcProperties":{"__isSmartRef__":true,"id":16827},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16826":{"this":{"__isSmartRef__":true,"id":16673}},"16827":{"timestamp":{"__isSmartRef__":true,"id":16828},"user":"soergel","tags":[]},"16828":{"isSerializedDate":true,"string":"Sun Apr 29 2012 22:13:52 GMT+0200 (CEST)"},"16829":{"varMapping":{"__isSmartRef__":true,"id":16830},"source":"function hasNeighbour(gem) {\n return $.inArray(gem, this.neighbours) != -1;\n}","funcProperties":{"__isSmartRef__":true,"id":16831},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16830":{"this":{"__isSmartRef__":true,"id":16673}},"16831":{"timestamp":{"__isSmartRef__":true,"id":16832},"user":"soergel","tags":[]},"16832":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:17:26 GMT+0200 (CEST)"},"16833":{"varMapping":{"__isSmartRef__":true,"id":16834},"source":"function debugMarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.red);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16835},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16834":{"this":{"__isSmartRef__":true,"id":16673}},"16835":{"timestamp":{"__isSmartRef__":true,"id":16836},"user":"soergel","tags":["debug"]},"16836":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:40:53 GMT+0200 (CEST)"},"16837":{"varMapping":{"__isSmartRef__":true,"id":16838},"source":"function debugUnmarkNeighbours() {\n this.neighbours.each(function(n) {\n n.setFill(Color.white);\n });\n}","funcProperties":{"__isSmartRef__":true,"id":16839},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16838":{"this":{"__isSmartRef__":true,"id":16673}},"16839":{"timestamp":{"__isSmartRef__":true,"id":16840},"user":"soergel","tags":["debug"]},"16840":{"isSerializedDate":true,"string":"Sun Apr 29 2012 23:47:47 GMT+0200 (CEST)"},"16841":{"varMapping":{"__isSmartRef__":true,"id":16842},"source":"function disappear() {\n var upperNeighbour = this.neighbours[this.directions.up];\n if(upperNeighbour != null) {\n this.gem = upperNeighbour.gem;\n upperNeighbour.disappear();\n }\n else {\n this.becomeRandomGem();\n }\n this.updatePicture();\n this.isDirty = true;\n}","funcProperties":{"__isSmartRef__":true,"id":16843},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16842":{"this":{"__isSmartRef__":true,"id":16673}},"16843":{"timestamp":{"__isSmartRef__":true,"id":16844},"user":"jan.sandbrink","tags":[]},"16844":{"isSerializedDate":true,"string":"Wed May 02 2012 16:48:59 GMT+0200 (CEST)"},"16845":{"varMapping":{"__isSmartRef__":true,"id":16846},"source":"function findStreakStart(direction) {\n var neighbour = this.neighbours[direction];\n if(neighbour == null || neighbour.gem != this.gem) {\n var streakDirection = (direction + 2) % 4;\n this.buildStreak(streakDirection, 0);\n }\n else {\n neighbour.findStreakStart(direction);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16847},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16846":{"this":{"__isSmartRef__":true,"id":16673}},"16847":{"timestamp":{"__isSmartRef__":true,"id":16848},"user":"jan.sandbrink","tags":[]},"16848":{"isSerializedDate":true,"string":"Wed May 02 2012 16:37:10 GMT+0200 (CEST)"},"16849":{"varMapping":{"__isSmartRef__":true,"id":16850},"source":"function buildStreak(direction, streakLength) {\n var neighbour= this.neighbours[direction];\n streakLength += 1;\n if(neighbour != null && neighbour.gem == this.gem) {\n streakLength = neighbour.buildStreak(direction, streakLength);\n }\n\n this.scoreStreak(streakLength);\n return streakLength;\n}","funcProperties":{"__isSmartRef__":true,"id":16851},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16850":{"this":{"__isSmartRef__":true,"id":16673}},"16851":{"timestamp":{"__isSmartRef__":true,"id":16852},"user":"jan.sandbrink","tags":[]},"16852":{"isSerializedDate":true,"string":"Wed May 02 2012 16:42:34 GMT+0200 (CEST)"},"16853":{"varMapping":{"__isSmartRef__":true,"id":16854},"source":"function scoreStreak(streakLength) {\n if(streakLength >= 3) {\n this.shouldBeDeleted = true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16855},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16854":{"this":{"__isSmartRef__":true,"id":16673}},"16855":{"timestamp":{"__isSmartRef__":true,"id":16856},"user":"jan.sandbrink","tags":[]},"16856":{"isSerializedDate":true,"string":"Tue May 08 2012 11:09:19 GMT+0200 (CEST)"},"16857":{"varMapping":{"__isSmartRef__":true,"id":16858},"source":"function tryToStreak(direction) {\n this.findStreakStart(this.directions.down);\n this.findStreakStart(this.directions.left);\n}","funcProperties":{"__isSmartRef__":true,"id":16859},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16858":{"this":{"__isSmartRef__":true,"id":16673}},"16859":{"timestamp":{"__isSmartRef__":true,"id":16860},"user":"jan.sandbrink","tags":[]},"16860":{"isSerializedDate":true,"string":"Wed May 02 2012 15:15:30 GMT+0200 (CEST)"},"16861":{"varMapping":{"__isSmartRef__":true,"id":16862},"source":"function blueDiamond() {\n var diamond = Morph.makePolygon([pt(25, 10), pt(10, 40), pt(40, 40)], 1, Color.white, Color.blue);\n line = Morph.makeLine([pt(25, 11, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(11, 39, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(39, 39, 0), pt(30, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(20, 30)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 30, 0), pt(25, 20)], 2, Color.rgb(179, 179, 245));\n diamond.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return diamond;\n}","funcProperties":{"__isSmartRef__":true,"id":16863},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16862":{"this":{"__isSmartRef__":true,"id":16673}},"16863":{"timestamp":{"__isSmartRef__":true,"id":16864},"user":"josi","tags":["gemtypes"]},"16864":{"isSerializedDate":true,"string":"Wed May 02 2012 22:13:55 GMT+0200 (CEST)"},"16865":{"varMapping":{"__isSmartRef__":true,"id":16866},"source":"function prehnite() {\n var prehnite = Morph.makePolygon([pt(20, 10), pt(30, 10), pt(40, 20), pt(40, 30), pt(30, 40), pt(20, 40), pt(10, 30), pt(10, 20)], 1, Color.white, Color.rgb(160, 250, 200));\n line = Morph.makeLine([pt(10, 30, 0), pt(40, 20)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(10, 20, 0), pt(40, 30)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(20, 10, 0), pt(30, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(30, 10, 0), pt(20, 40)], 1, Color.rgb(215, 255, 230));\n prehnite.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return prehnite;\n}","funcProperties":{"__isSmartRef__":true,"id":16867},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16866":{"this":{"__isSmartRef__":true,"id":16673}},"16867":{"timestamp":{"__isSmartRef__":true,"id":16868},"user":"josi","tags":["gemtypes"]},"16868":{"isSerializedDate":true,"string":"Wed May 02 2012 22:14:33 GMT+0200 (CEST)"},"16869":{"varMapping":{"__isSmartRef__":true,"id":16870},"source":"function debugUnmark() {\n this.setFill(Color.white);\n}","funcProperties":{"__isSmartRef__":true,"id":16871},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16870":{"this":{"__isSmartRef__":true,"id":16673}},"16871":{"timestamp":{"__isSmartRef__":true,"id":16872},"user":"soergel","tags":["debug"]},"16872":{"isSerializedDate":true,"string":"Sun May 06 2012 22:20:49 GMT+0200 (CEST)"},"16873":{"varMapping":{"__isSmartRef__":true,"id":16874},"source":"function debugMark() {\n this.setFill(Color.red);\n}","funcProperties":{"__isSmartRef__":true,"id":16875},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16874":{"this":{"__isSmartRef__":true,"id":16673}},"16875":{"timestamp":{"__isSmartRef__":true,"id":16876},"user":"soergel","tags":["debug"]},"16876":{"isSerializedDate":true,"string":"Sun May 06 2012 22:21:12 GMT+0200 (CEST)"},"16877":{"varMapping":{"__isSmartRef__":true,"id":16878},"source":"function citrine() {\n var citrine = Morph.makePolygon([pt(25, 5), pt(13, 25), pt(25, 45), pt(37, 25)], 1, Color.white, Color.rgb(255, 255, 0));\n line = Morph.makeLine([pt(25, 5, 0), pt(25, 45)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(13, 25, 0), pt(37, 25)], 2, Color.rgb(255, 255, 150));\n citrine.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return citrine;\n}","funcProperties":{"__isSmartRef__":true,"id":16879},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16878":{"this":{"__isSmartRef__":true,"id":16673}},"16879":{"timestamp":{"__isSmartRef__":true,"id":16880},"user":"josi","tags":["gemtypes"]},"16880":{"isSerializedDate":true,"string":"Mon May 07 2012 15:55:31 GMT+0200 (CEST)"},"16881":{"varMapping":{"__isSmartRef__":true,"id":16882},"source":"function move(direction, onFinish) {\n this.originalPosition = this.getPosition();\n console.log(\"Before start stepping\");\n this.startStepping(3, \"performMovement\", {direction: direction, onFinish: onFinish});\n}","funcProperties":{"__isSmartRef__":true,"id":16883},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16882":{"this":{"__isSmartRef__":true,"id":16673}},"16883":{"timestamp":{"__isSmartRef__":true,"id":16884},"user":"soergel","tags":[]},"16884":{"isSerializedDate":true,"string":"Tue May 08 2012 22:47:35 GMT+0200 (CEST)"},"16885":{"varMapping":{"__isSmartRef__":true,"id":16886},"source":"function performMovement(param) {\n var direction = param.direction;\n var onFinish = param.onFinish;\n\n var x = this.getPosition().x;\n var y = this.getPosition().y;\n\n if (direction == undefined) direction = 0; \n\n if (direction % 2 == 0) {\n var newPosition = new Point((x + (direction - 1) * 2), y);\n this.setPosition(newPosition);\n if (Math.abs(x - this.originalPosition.x) > this.getExtent().x) {\n this.stopStepping();\n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n } else {\n var newPosition = new Point(x, y + (direction - 2) * 2);\n this.setPosition(newPosition);\n if (Math.abs(y - this.originalPosition.y) > this.getExtent().y) {\n this.stopStepping(); \n if (onFinish != undefined) onFinish();\n this.setPosition(this.originalPosition)\n }\n }\n \n}","funcProperties":{"__isSmartRef__":true,"id":16887},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16886":{"this":{"__isSmartRef__":true,"id":16673}},"16887":{"timestamp":{"__isSmartRef__":true,"id":16888},"user":"soergel","tags":[]},"16888":{"isSerializedDate":true,"string":"Tue May 08 2012 22:48:18 GMT+0200 (CEST)"},"16889":{"varMapping":{"__isSmartRef__":true,"id":16890},"source":"function getDirectionForNeighbour(neighbour) {\n var direction = undefined;\n $.each(this.neighbours, function(idx, n) {\n if (n == neighbour) \n direction = idx;\n });\n\n return direction;\n}","funcProperties":{"__isSmartRef__":true,"id":16891},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16890":{"this":{"__isSmartRef__":true,"id":16673}},"16891":{"timestamp":{"__isSmartRef__":true,"id":16892},"user":"soergel","tags":[]},"16892":{"isSerializedDate":true,"string":"Tue May 08 2012 22:41:37 GMT+0200 (CEST)"},"16893":{"varMapping":{"__isSmartRef__":true,"id":16894},"source":"function zircon() {\n var zircon = Morph.makePolygon([pt(25, 9), pt(41, 18), pt(41, 32), pt(25, 41), pt(9, 32), pt(9, 18)], 1, Color.white, Color.rgb(255, 201, 38));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 27)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 32, 0), pt(25, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(42, 32, 0), pt(24, 25)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 18, 0), pt(24, 25)], 1, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(25, 43, 0), pt(25, 24)], 2, Color.white);\n zircon.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return zircon;\n}","funcProperties":{"__isSmartRef__":true,"id":16895},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16894":{"this":{"__isSmartRef__":true,"id":16673}},"16895":{"timestamp":{"__isSmartRef__":true,"id":16896},"user":"josi","tags":["gemtypes"]},"16896":{"isSerializedDate":true,"string":"Thu May 10 2012 15:23:48 GMT+0200 (CEST)"},"16897":{"varMapping":{"__isSmartRef__":true,"id":16898},"source":"function emerald() {\n var emerald = Morph.makePolygon([pt(25, 9), pt(38, 30), pt(30, 41), pt(20, 41), pt(12, 30)], 1, Color.white, Color.rgb(26, 255, 0));\n line = Morph.makeLine([pt(25, 8, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(9, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n line = Morph.makeLine([pt(41, 30, 0), pt(25, 30)], 2, Color.white);\n emerald.addMorph(line);\n line.disableDropping(true);\n line.disableGrabbing(true);\n return emerald;\n}","funcProperties":{"__isSmartRef__":true,"id":16899},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16898":{"this":{"__isSmartRef__":true,"id":16673}},"16899":{"timestamp":{"__isSmartRef__":true,"id":16900},"user":"josi","tags":["gemtypes"]},"16900":{"isSerializedDate":true,"string":"Thu May 10 2012 16:04:14 GMT+0200 (CEST)"},"16901":{"varMapping":{"__isSmartRef__":true,"id":16902},"source":"function canScoreBySwitchingWith(gem) {\n var tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n this.tryToStreak();\n gem.tryToStreak();\n\n var canScore = this.shouldBeDeleted || gem.shouldBeDeleted;\n\n tmpGem = this.gem;\n this.gem = gem.gem;\n gem.gem = tmpGem;\n\n return canScore;\n}","funcProperties":{"__isSmartRef__":true,"id":16903},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16902":{"this":{"__isSmartRef__":true,"id":16673}},"16903":{"timestamp":{"__isSmartRef__":true,"id":16904},"user":"jan.sandbrink","tags":[]},"16904":{"isSerializedDate":true,"string":"Mon May 14 2012 11:21:12 GMT+0200 (CEST)"},"16905":{"newGame":{"__isSmartRef__":true,"id":16906},"getGemFrame":{"__isSmartRef__":true,"id":16910},"clear":{"__isSmartRef__":true,"id":16914},"updateScore":{"__isSmartRef__":true,"id":16918},"getPrototype":{"__isSmartRef__":true,"id":16922},"gameIsOver":{"__isSmartRef__":true,"id":16926}},"16906":{"varMapping":{"__isSmartRef__":true,"id":16907},"source":"function newGame() {\n this.clear();\n\n var gemPrototype = this.getPrototype();\n var gemFrame = this.getGemFrame();\n var gemExtent = gemPrototype.priorExtent;\n\n var lastRow = null;\n var isFirstGem = true;\n \n for (row = 0; row < this.numberOfVerticalGems; row++) {\n var leftNeighbour = null;\n var currentRow = [];\n for (column = 0; column < this.numberOfHorizontalGems; column++) {\n var newGem = gemPrototype.copy();\n newGem.becomeRandomGem();\n gemFrame.addMorph(newGem);\n newGem.setPosition(new Point(1 + column * gemExtent.x, 1 + row * gemExtent.y));\n \n if(leftNeighbour != null)\n newGem.addNeighbour(leftNeighbour, newGem.directions.left);\n\n leftNeighbour = newGem;\n\n if(lastRow != null)\n newGem.addNeighbour(lastRow[column], newGem.directions.up);\n currentRow[column] = newGem;\n\n if(isFirstGem) {\n isFirstGem = false;\n this.getGemFrame().fieldHead = newGem; \n }\n }\n lastRow = currentRow;\n }\n\n this.lockScore = true;\n this.getGemFrame().cleanInitialStreaks();\n this.lockScore = false;\n}","funcProperties":{"__isSmartRef__":true,"id":16908},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16907":{"this":{"__isSmartRef__":true,"id":60}},"16908":{"timestamp":{"__isSmartRef__":true,"id":16909},"user":"soergel","tags":[]},"16909":{"isSerializedDate":true,"string":"Mon May 14 2012 14:07:17 GMT+0200 (CEST)"},"16910":{"varMapping":{"__isSmartRef__":true,"id":16911},"source":"function getGemFrame() {\n return this.submorphs.select(function(e) {\n return e.isGemFrame;\n })[0];\n}","funcProperties":{"__isSmartRef__":true,"id":16912},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16911":{"this":{"__isSmartRef__":true,"id":60}},"16912":{"timestamp":{"__isSmartRef__":true,"id":16913},"user":"soergel","tags":[]},"16913":{"isSerializedDate":true,"string":"Sun Apr 29 2012 17:24:18 GMT+0200 (CEST)"},"16914":{"varMapping":{"__isSmartRef__":true,"id":16915},"source":"function clear() {\n this.getGemFrame().clear();\n this.gameOverIndicator.gameStarted();\n this.updateScore(0);\n}","funcProperties":{"__isSmartRef__":true,"id":16916},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16915":{"this":{"__isSmartRef__":true,"id":60}},"16916":{"timestamp":{"__isSmartRef__":true,"id":16917},"user":"jan.sandbrink","tags":[]},"16917":{"isSerializedDate":true,"string":"Mon May 14 2012 11:43:46 GMT+0200 (CEST)"},"16918":{"varMapping":{"__isSmartRef__":true,"id":16919},"source":"function updateScore(score) {\n if(this.lockScore)\n return;\n\n this.ScoreIndicator.setScore(score);\n if(score > this.highscore)\n {\n this.highscore = score;\n this.HighscoreIndicator.setScore(score);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":16920},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16919":{"this":{"__isSmartRef__":true,"id":60}},"16920":{"timestamp":{"__isSmartRef__":true,"id":16921},"user":"jan.sandbrink","tags":[]},"16921":{"isSerializedDate":true,"string":"Thu May 10 2012 13:46:30 GMT+0200 (CEST)"},"16922":{"varMapping":{"__isSmartRef__":true,"id":16923},"source":"function getPrototype() {\n var availablePrototypeList = this.prototypeBox.submorphs.select(function(sm) {\n return sm.isGem;\n });\n \n if (availablePrototypeList.length == 0)\n return $world.loadPartItem(\"BasicGem\", 'PartsBin/groupBejeweled');\n else\n return availablePrototypeList[0];\n}","funcProperties":{"__isSmartRef__":true,"id":16924},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16923":{"this":{"__isSmartRef__":true,"id":60}},"16924":{"timestamp":{"__isSmartRef__":true,"id":16925},"user":"soergel","tags":[]},"16925":{"isSerializedDate":true,"string":"Tue May 08 2012 17:43:25 GMT+0200 (CEST)"},"16926":{"varMapping":{"__isSmartRef__":true,"id":16927},"source":"function gameIsOver() {\n this.gameOverIndicator.gameOver();\n}","funcProperties":{"__isSmartRef__":true,"id":16928},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16927":{"this":{"__isSmartRef__":true,"id":60}},"16928":{"timestamp":{"__isSmartRef__":true,"id":16929},"user":"jan.sandbrink","tags":[]},"16929":{"isSerializedDate":true,"string":"Mon May 14 2012 11:43:18 GMT+0200 (CEST)"},"16930":{"submorphs":[{"__isSmartRef__":true,"id":16931},{"__isSmartRef__":true,"id":18637},{"__isSmartRef__":true,"id":18677}],"scripts":[],"shape":{"__isSmartRef__":true,"id":18828},"id":"CC4A87F2-A8C5-4E2D-890E-0FBAD4796461","renderContextTable":{"__isSmartRef__":true,"id":18833},"eventHandler":{"__isSmartRef__":true,"id":18834},"droppingEnabled":true,"halosEnabled":true,"__layered_draggingEnabled__":true,"layout":{"__isSmartRef__":true,"id":18835},"LK2":true,"priorExtent":{"__isSmartRef__":true,"id":18836},"targetMorph":{"__isSmartRef__":true,"id":16931},"titleBar":{"__isSmartRef__":true,"id":18677},"contentOffset":{"__isSmartRef__":true,"id":18837},"collapsedTransform":{"__isSmartRef__":true,"id":18838},"collapsedExtent":{"__isSmartRef__":true,"id":18839},"expandedTransform":{"__isSmartRef__":true,"id":18840},"expandedExtent":{"__isSmartRef__":true,"id":18841},"ignoreEventsOnExpand":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":18842},"name":"ObjectEditor","prevDragPos":{"__isSmartRef__":true,"id":18943},"highlighted":true,"cameForward":false,"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","expandedPosition":{"__isSmartRef__":true,"id":18944},"state":"expanded","collapsedPosition":{"__isSmartRef__":true,"id":18945},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"isBeingDragged":false,"prevScroll":[0,0],"minSize":{"__isSmartRef__":true,"id":18946},"minExtent":{"__isSmartRef__":true,"id":18947},"isCopyMorphRef":true,"morphRefId":16,"derivationIds":[205,"2951753B-EB95-4093-A0DD-249E83AC2204","A32DE788-E06D-492C-B2E6-19C3710B5AE0","96D56291-98FB-42C4-A247-0A20B4183B14","1E6BCC46-3FE3-4950-AE50-9751458F7E18","22248328-5B04-4E39-ADDE-460C107C790F","2F4F6161-9F4C-469E-AF56-24765FF03B72","88EF08D5-C1E7-4B5B-B393-FFF5921009D7","FF731ED6-5217-4053-9B85-77F1BF344BF3","496332F8-A328-4625-A7D5-0DCE90C3D2AE","E57F1D4E-AE08-4CAA-A62D-4E69FC0BFF47"],"_Position":{"__isSmartRef__":true,"id":18948},"moved":true,"_ClipMode":"visible","_Rotation":0,"_Scale":1.008036120330794,"owner":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18949},"__LivelyClassName__":"lively.morphic.Window","withoutLayers":["Global.lively.morphic.GrabbingLayer"]},"16931":{"submorphs":[{"__isSmartRef__":true,"id":16932},{"__isSmartRef__":true,"id":17822},{"__isSmartRef__":true,"id":17604},{"__isSmartRef__":true,"id":17837},{"__isSmartRef__":true,"id":17853},{"__isSmartRef__":true,"id":17904},{"__isSmartRef__":true,"id":17954},{"__isSmartRef__":true,"id":18010},{"__isSmartRef__":true,"id":17427},{"__isSmartRef__":true,"id":17481},{"__isSmartRef__":true,"id":18065},{"__isSmartRef__":true,"id":18184},{"__isSmartRef__":true,"id":18199},{"__isSmartRef__":true,"id":18214},{"__isSmartRef__":true,"id":18298},{"__isSmartRef__":true,"id":18382},{"__isSmartRef__":true,"id":18466}],"scripts":[{"__isSmartRef__":true,"id":18514}],"id":"ECB671D4-776B-4415-A205-53B89F9B4DA8","shape":{"__isSmartRef__":true,"id":18515},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"ObjectEditorPane","partsBinMetaInfo":{"__isSmartRef__":true,"id":18522},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":18525},"eventHandler":{"__isSmartRef__":true,"id":18526},"priorExtent":{"__isSmartRef__":true,"id":18527},"layout":{"__isSmartRef__":true,"id":18528},"target":{"__isSmartRef__":true,"id":60},"scriptPane":{"__isSmartRef__":true,"id":17427},"scriptList":{"__isSmartRef__":true,"id":16932},"connectionList":{"__isSmartRef__":true,"id":17604},"morphSelector":{"__isSmartRef__":true,"id":18065},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"changeIndicator":{"__isSmartRef__":true,"id":17481},"isBeingDragged":false,"prevScroll":[0,0],"grabbingEnabled":false,"draggingEnabled":false,"currentCategory":null,"distanceToDragEvent":{"__isSmartRef__":true,"id":18529},"tagChooser":{"__isSmartRef__":true,"id":18214},"currentTag":null,"derivationIds":[206,"3BDE080D-3D60-4BB9-A690-E6001350F596","00E28CBF-E803-4BC0-93CC-651AC21008A5","1B7E7936-0145-47E4-8433-DFE58134E74B","422B98E3-E52B-4057-9C28-865873682DE1","BCDE8D30-ECC2-4883-9587-2518B6822233","BA6D5198-5AC2-4A63-9597-D4CF98A99CA9","17E22972-5EBC-4511-9779-05E9E665D899","C6F34039-F423-4223-8D6A-85611A138372","7EC3BECE-1BDA-471D-B14C-C4FB822AA55C","88F702A6-6067-4160-8561-54FAD27ADB17"],"_Position":{"__isSmartRef__":true,"id":18530},"owner":{"__isSmartRef__":true,"id":16930},"partTests":{"__isSmartRef__":true,"id":18531},"_ClipMode":"visible","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18532},"__LivelyClassName__":"lively.morphic.Box"},"16932":{"submorphs":[],"scripts":[],"id":"1633B846-C086-4A4F-A938-5F86337DDDC1","shape":{"__isSmartRef__":true,"id":16933},"droppingEnabled":true,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":16940},"itemList":["-- ALL --","clear","gameIsOver","getGemFrame","getPrototype","newGame","updateScore"],"selectedLineNo":1,"showsHalos":false,"name":"ObjectEditorScriptList","partsBinMetaInfo":{"__isSmartRef__":true,"id":16941},"__SourceModuleName__":"Global.lively.morphic.Core","_ClipMode":"auto","owner":{"__isSmartRef__":true,"id":16931},"priorExtent":{"__isSmartRef__":true,"id":16942},"prevScroll":[0,0],"attributeConnections":[{"__isSmartRef__":true,"id":16943}],"doNotSerialize":["$$selection"],"doNotCopyProperties":["$$selection"],"layout":{"__isSmartRef__":true,"id":16948},"doitContext":{"__isSmartRef__":true,"id":16949},"renderContextTable":{"__isSmartRef__":true,"id":17811},"eventHandler":{"__isSmartRef__":true,"id":17812},"_FontSize":10,"distanceToDragEvent":{"__isSmartRef__":true,"id":17813},"isBeingDragged":false,"grabbingEnabled":false,"draggingEnabled":false,"isCopyMorphRef":true,"morphRefId":17,"currentCategory":null,"derivationIds":[207,"D87334B5-DFB8-438D-8038-D2C55A798E3B","4242A24B-D284-4130-BB19-C1AB8C7E96CB","1F2230C1-4745-4EED-8827-5D3FC0EA8D8A","1260A8AA-AD41-451A-A761-BE75A33282E8","11AABB24-1595-4EDC-95DF-8BC66785F47A","CA99FFE7-13DD-4721-8DE2-6A587B0C65D9","E01A3DAA-0001-4C7C-A6A7-449C3945A3E6","8C3C70BF-E1CE-4FB9-8407-24EA990D4E49","D70897C1-82FA-42AD-9D81-A0698E9072CC","69BB0838-2830-4831-A681-185E03308396"],"selection":"clear","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17814},"__LivelyClassName__":"lively.morphic.List"},"16933":{"position":{"__isSmartRef__":true,"id":16934},"_Extent":{"__isSmartRef__":true,"id":16935},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":16936},"_Fill":{"__isSmartRef__":true,"id":16937},"__SourceModuleName__":"Global.lively.morphic.Shapes","_BorderRadius":0,"renderContextTable":{"__isSmartRef__":true,"id":16938},"_Opacity":1,"_BorderStyle":"solid","_Padding":{"__isSmartRef__":true,"id":16939},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16934":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16935":{"x":180,"y":337.61253261443596,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16936":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16937":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"16938":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16939":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16940":{"x":10,"y":63.027958027992966,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16941":{"partsSpaceName":"PartsBin/NewWorld","migrationLevel":2,"__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"16942":{"x":180,"y":338.61253261443596,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16943":{"sourceObj":{"__isSmartRef__":true,"id":16932},"sourceAttrName":"selection","targetObj":{"__isSmartRef__":true,"id":16931},"targetMethodName":"displaySourceForScript","converterString":"function (value) {\n return (value === '-- ALL --') ? null : value;\n}","updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":16944},"__SourceModuleName__":"Global.lively.bindings","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":16945},"__LivelyClassName__":"AttributeConnection"},"16944":{"source":{"__isSmartRef__":true,"id":16932},"target":{"__isSmartRef__":true,"id":16931}},"16945":{"converter":{"__isSmartRef__":true,"id":16946}},"16946":{"originalFunc":null,"varMapping":{"__isSmartRef__":true,"id":16944},"source":"function (value) {\n return (value === '-- ALL --') ? null : value;\n}","funcProperties":{"__isSmartRef__":true,"id":16947},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"16947":{},"16948":{"resizeHeight":true},"16949":{"submorphs":[],"scripts":[],"id":836,"shape":{"__isSmartRef__":true,"id":16950},"droppingEnabled":true,"halosEnabled":true,"__layered_draggingEnabled__":true,"layout":{"__isSmartRef__":true,"id":16955},"priorExtent":{"__isSmartRef__":true,"id":16956},"titleBar":{"__isSmartRef__":true,"id":16957},"contentOffset":{"__isSmartRef__":true,"id":17098},"collapsedTransform":null,"collapsedExtent":null,"expandedTransform":{"__isSmartRef__":true,"id":17099},"expandedExtent":{"__isSmartRef__":true,"id":17100},"highlighted":true,"_Rotation":0,"_Scale":1,"prevDragPos":{"__isSmartRef__":true,"id":17101},"showsHalos":false,"name":"ObjectEditor","__SourceModuleName__":"Global.lively.morphic.Widgets","target":{"__isSmartRef__":true,"id":17102},"expandedPosition":{"__isSmartRef__":true,"id":17425},"partsBinMetaInfo":{"__isSmartRef__":true,"id":17426},"scriptList":{"__isSmartRef__":true,"id":16932},"scriptPane":{"__isSmartRef__":true,"id":17427},"classButton":{"__isSmartRef__":true,"id":17559},"connectionList":{"__isSmartRef__":true,"id":17604},"targetButton":{"__isSmartRef__":true,"id":17629},"renderContextTable":{"__isSmartRef__":true,"id":17672},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_Position":{"__isSmartRef__":true,"id":17673},"morphSelector":{"__isSmartRef__":true,"id":17674},"eventHandler":{"__isSmartRef__":true,"id":17758},"cameForward":false,"isCopyMorphRef":true,"morphRefId":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17759},"__LivelyClassName__":"lively.morphic.Window","withoutLayers":["Global.lively.morphic.GrabbingLayer"]},"16950":{"_BorderWidth":1,"_Fill":{"__isSmartRef__":true,"id":16951},"_StrokeOpacity":0,"_BorderRadius":9.25,"_Extent":{"__isSmartRef__":true,"id":16952},"__SourceModuleName__":"Global.lively.morphic.Shapes","_BorderColor":{"__isSmartRef__":true,"id":16953},"renderContextTable":{"__isSmartRef__":true,"id":16954},"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16951":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16952":{"x":981,"y":585.2,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16953":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16954":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16955":{"adjustForNewBounds":true},"16956":{"x":981,"y":585.2,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16957":{"submorphs":[{"__isSmartRef__":true,"id":16958},{"__isSmartRef__":true,"id":16971},{"__isSmartRef__":true,"id":17015},{"__isSmartRef__":true,"id":17047}],"scripts":[],"id":837,"shape":{"__isSmartRef__":true,"id":17080},"droppingEnabled":true,"halosEnabled":true,"layout":{"__isSmartRef__":true,"id":17093},"_Position":{"__isSmartRef__":true,"id":17094},"eventsAreIgnored":true,"windowMorph":{"__isSmartRef__":true,"id":16949},"label":{"__isSmartRef__":true,"id":16958},"closeButton":{"__isSmartRef__":true,"id":16971},"menuButton":{"__isSmartRef__":true,"id":17015},"collapseButton":{"__isSmartRef__":true,"id":17047},"priorExtent":{"__isSmartRef__":true,"id":17095},"owner":null,"__SourceModuleName__":"Global.lively.morphic.Widgets","name":"ObjectEditorTitleBar","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17096},"eventHandler":{"__isSmartRef__":true,"id":17097},"__LivelyClassName__":"lively.morphic.TitleBar"},"16958":{"submorphs":[],"scripts":[],"id":838,"shape":{"__isSmartRef__":true,"id":16959},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":16964},"_ClipMode":"hidden","fixedWidth":false,"_WhiteSpaceHandling":"pre","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":16965},"priorExtent":{"__isSmartRef__":true,"id":16966},"_MaxTextWidth":null,"_MaxTextHeight":17,"textChunks":[{"__isSmartRef__":true,"id":16967}],"evalEnabled":false,"isLabel":true,"eventsAreIgnored":true,"_FontSize":10,"_Align":"center","owner":{"__isSmartRef__":true,"id":16957},"__SourceModuleName__":"Global.lively.morphic.TextCore","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":16969},"eventHandler":{"__isSmartRef__":true,"id":16970},"_HandStyle":"default","_PointerEvents":"none","__LivelyClassName__":"lively.morphic.Text"},"16959":{"_Position":{"__isSmartRef__":true,"id":16960},"_Extent":{"__isSmartRef__":true,"id":16961},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16962},"_Fill":null,"_BorderRadius":0,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16963},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16960":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16961":{"x":921.9776803724167,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16962":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16963":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16964":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16965":{"x":20,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16966":{"x":921.9776803724167,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16967":{"style":{"__isSmartRef__":true,"id":16968},"chunkOwner":{"__isSmartRef__":true,"id":16958},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"16968":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16969":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16970":{"morph":{"__isSmartRef__":true,"id":16958},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16971":{"submorphs":[{"__isSmartRef__":true,"id":16972}],"scripts":[],"id":839,"shape":{"__isSmartRef__":true,"id":16984},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":16999},"priorExtent":{"__isSmartRef__":true,"id":17000},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":16988},"lighterFill":{"__isSmartRef__":true,"id":17001},"label":{"__isSmartRef__":true,"id":16972},"owner":{"__isSmartRef__":true,"id":16957},"layout":{"__isSmartRef__":true,"id":17010},"attributeConnections":[{"__isSmartRef__":true,"id":17011},{"__isSmartRef__":true,"id":17012}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17013},"eventHandler":{"__isSmartRef__":true,"id":17014},"__LivelyClassName__":"lively.morphic.WindowControl"},"16972":{"submorphs":[],"scripts":[],"id":840,"shape":{"__isSmartRef__":true,"id":16973},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":16977},"_ClipMode":"hidden","fixedWidth":false,"_WhiteSpaceHandling":"pre","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":16978},"priorExtent":{"__isSmartRef__":true,"id":16979},"_MaxTextWidth":null,"_MaxTextHeight":17,"textChunks":[{"__isSmartRef__":true,"id":16980}],"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":16971},"isLabel":true,"eventsAreIgnored":true,"_FontSize":8,"__SourceModuleName__":"Global.lively.morphic.TextCore","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":16982},"eventHandler":{"__isSmartRef__":true,"id":16983},"_HandStyle":"default","_PointerEvents":"none","__LivelyClassName__":"lively.morphic.Text"},"16973":{"_Position":{"__isSmartRef__":true,"id":16974},"_Extent":{"__isSmartRef__":true,"id":16975},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16962},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16976},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16974":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16975":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16976":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16977":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16978":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16979":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16980":{"style":{"__isSmartRef__":true,"id":16981},"chunkOwner":{"__isSmartRef__":true,"id":16972},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"16981":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"16982":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"16983":{"morph":{"__isSmartRef__":true,"id":16972},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"16984":{"_Position":{"__isSmartRef__":true,"id":16985},"_Extent":{"__isSmartRef__":true,"id":16986},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16987},"_Fill":{"__isSmartRef__":true,"id":16988},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":16998},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"16985":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16986":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"16987":{"r":0.7411764705882353,"g":0.7450980392156863,"b":0.7529411764705882,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16988":{"stops":[{"__isSmartRef__":true,"id":16989},{"__isSmartRef__":true,"id":16991},{"__isSmartRef__":true,"id":16993},{"__isSmartRef__":true,"id":16995}],"vector":{"__isSmartRef__":true,"id":16997},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"16989":{"offset":0,"color":{"__isSmartRef__":true,"id":16990}},"16990":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16991":{"offset":0.4,"color":{"__isSmartRef__":true,"id":16992}},"16992":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16993":{"offset":0.6,"color":{"__isSmartRef__":true,"id":16994}},"16994":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16995":{"offset":1,"color":{"__isSmartRef__":true,"id":16996}},"16996":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"16997":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"16998":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"16999":{"x":960.9776803724167,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17000":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17001":{"stops":[{"__isSmartRef__":true,"id":17002},{"__isSmartRef__":true,"id":17004},{"__isSmartRef__":true,"id":17006},{"__isSmartRef__":true,"id":17008}],"vector":{"__isSmartRef__":true,"id":16997},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17002":{"offset":0,"color":{"__isSmartRef__":true,"id":17003}},"17003":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17004":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17005}},"17005":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17006":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17007}},"17007":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17008":{"offset":1,"color":{"__isSmartRef__":true,"id":17009}},"17009":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17010":{"moveHorizontal":true},"17011":{"sourceObj":{"__isSmartRef__":true,"id":16971},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"getCloseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17012":{"sourceObj":{"__isSmartRef__":true,"id":16971},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"initiateShutdown","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17013":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17014":{"morph":{"__isSmartRef__":true,"id":16971},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17015":{"submorphs":[{"__isSmartRef__":true,"id":17016}],"scripts":[],"id":841,"shape":{"__isSmartRef__":true,"id":17028},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17032},"priorExtent":{"__isSmartRef__":true,"id":17033},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":16988},"lighterFill":{"__isSmartRef__":true,"id":17034},"label":{"__isSmartRef__":true,"id":17016},"owner":{"__isSmartRef__":true,"id":16957},"attributeConnections":[{"__isSmartRef__":true,"id":17043},{"__isSmartRef__":true,"id":17044}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","showsHalos":false,"_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17045},"eventHandler":{"__isSmartRef__":true,"id":17046},"__LivelyClassName__":"lively.morphic.WindowControl"},"17016":{"submorphs":[],"scripts":[],"id":842,"shape":{"__isSmartRef__":true,"id":17017},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17021},"_ClipMode":"hidden","fixedWidth":false,"_WhiteSpaceHandling":"pre","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17022},"priorExtent":{"__isSmartRef__":true,"id":17023},"_MaxTextWidth":null,"_MaxTextHeight":17,"textChunks":[{"__isSmartRef__":true,"id":17024}],"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17015},"isLabel":true,"eventsAreIgnored":true,"_FontSize":8,"__SourceModuleName__":"Global.lively.morphic.TextCore","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17026},"eventHandler":{"__isSmartRef__":true,"id":17027},"_HandStyle":"default","_PointerEvents":"none","__LivelyClassName__":"lively.morphic.Text"},"17017":{"_Position":{"__isSmartRef__":true,"id":17018},"_Extent":{"__isSmartRef__":true,"id":17019},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16962},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17020},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17018":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17019":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17020":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17021":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17022":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17023":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17024":{"style":{"__isSmartRef__":true,"id":17025},"chunkOwner":{"__isSmartRef__":true,"id":17016},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17025":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17026":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17027":{"morph":{"__isSmartRef__":true,"id":17016},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17028":{"_Position":{"__isSmartRef__":true,"id":17029},"_Extent":{"__isSmartRef__":true,"id":17030},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16987},"_Fill":{"__isSmartRef__":true,"id":16988},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17031},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17029":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17030":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17031":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17032":{"x":3,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17033":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17034":{"stops":[{"__isSmartRef__":true,"id":17035},{"__isSmartRef__":true,"id":17037},{"__isSmartRef__":true,"id":17039},{"__isSmartRef__":true,"id":17041}],"vector":{"__isSmartRef__":true,"id":16997},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17035":{"offset":0,"color":{"__isSmartRef__":true,"id":17036}},"17036":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17037":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17038}},"17038":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17039":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17040}},"17040":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17041":{"offset":1,"color":{"__isSmartRef__":true,"id":17042}},"17042":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17043":{"sourceObj":{"__isSmartRef__":true,"id":17015},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"getMenuHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17044":{"sourceObj":{"__isSmartRef__":true,"id":17015},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"showTargetMorphMenu","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17045":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17046":{"morph":{"__isSmartRef__":true,"id":17015},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17047":{"submorphs":[{"__isSmartRef__":true,"id":17048}],"scripts":[],"id":843,"shape":{"__isSmartRef__":true,"id":17060},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17064},"priorExtent":{"__isSmartRef__":true,"id":17065},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":16988},"lighterFill":{"__isSmartRef__":true,"id":17066},"label":{"__isSmartRef__":true,"id":17048},"owner":{"__isSmartRef__":true,"id":16957},"layout":{"__isSmartRef__":true,"id":17075},"attributeConnections":[{"__isSmartRef__":true,"id":17076},{"__isSmartRef__":true,"id":17077}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17078},"eventHandler":{"__isSmartRef__":true,"id":17079},"__LivelyClassName__":"lively.morphic.WindowControl"},"17048":{"submorphs":[],"scripts":[],"id":844,"shape":{"__isSmartRef__":true,"id":17049},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17053},"_ClipMode":"hidden","fixedWidth":false,"_WhiteSpaceHandling":"pre","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17054},"priorExtent":{"__isSmartRef__":true,"id":17055},"_MaxTextWidth":null,"_MaxTextHeight":17,"textChunks":[{"__isSmartRef__":true,"id":17056}],"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17047},"isLabel":true,"eventsAreIgnored":true,"_FontSize":8,"__SourceModuleName__":"Global.lively.morphic.TextCore","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17058},"eventHandler":{"__isSmartRef__":true,"id":17059},"_HandStyle":"default","_PointerEvents":"none","__LivelyClassName__":"lively.morphic.Text"},"17049":{"_Position":{"__isSmartRef__":true,"id":17050},"_Extent":{"__isSmartRef__":true,"id":17051},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16962},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17052},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17050":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17051":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17052":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17053":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17054":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17055":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17056":{"style":{"__isSmartRef__":true,"id":17057},"chunkOwner":{"__isSmartRef__":true,"id":17048},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17057":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17058":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17059":{"morph":{"__isSmartRef__":true,"id":17048},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17060":{"_Position":{"__isSmartRef__":true,"id":17061},"_Extent":{"__isSmartRef__":true,"id":17062},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":16987},"_Fill":{"__isSmartRef__":true,"id":16988},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17063},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17061":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17062":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17063":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17064":{"x":941.9776803724167,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17065":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17066":{"stops":[{"__isSmartRef__":true,"id":17067},{"__isSmartRef__":true,"id":17069},{"__isSmartRef__":true,"id":17071},{"__isSmartRef__":true,"id":17073}],"vector":{"__isSmartRef__":true,"id":16997},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17067":{"offset":0,"color":{"__isSmartRef__":true,"id":17068}},"17068":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17069":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17070}},"17070":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17071":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17072}},"17072":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17073":{"offset":1,"color":{"__isSmartRef__":true,"id":17074}},"17074":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17075":{"moveHorizontal":true},"17076":{"sourceObj":{"__isSmartRef__":true,"id":17047},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"getCollapseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17077":{"sourceObj":{"__isSmartRef__":true,"id":17047},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"toggleCollapse","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17078":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17079":{"morph":{"__isSmartRef__":true,"id":17047},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17080":{"_Position":{"__isSmartRef__":true,"id":17081},"_Extent":{"__isSmartRef__":true,"id":17082},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":17083},"_Fill":{"__isSmartRef__":true,"id":17084},"_StrokeOpacity":1,"_BorderRadius":"8px 8px 0px 0px","__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17092},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17081":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17082":{"x":980.9776803724167,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17083":{"r":0.4,"g":0.4,"b":0.4,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17084":{"stops":[{"__isSmartRef__":true,"id":17085},{"__isSmartRef__":true,"id":17087},{"__isSmartRef__":true,"id":17089}],"vector":{"__isSmartRef__":true,"id":17091},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17085":{"offset":0,"color":{"__isSmartRef__":true,"id":17086}},"17086":{"r":0.7200000000000001,"g":0.7200000000000001,"b":0.7200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17087":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17088}},"17088":{"r":0.9,"g":0.9,"b":0.9,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17089":{"offset":1,"color":{"__isSmartRef__":true,"id":17090}},"17090":{"r":0.7200000000000001,"g":0.7200000000000001,"b":0.7200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17091":{"x":0,"y":1,"width":0,"height":-1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17092":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17093":{"resizeWidth":true,"adjustForNewBounds":true},"17094":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17095":{"x":980.9776803724167,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17096":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17097":{"morph":{"__isSmartRef__":true,"id":16957},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17098":{"x":0,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17099":{"a":1,"b":0,"c":0,"d":1,"e":377.6609726943286,"f":419.5142810783999,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"lively.morphic.Similitude"},"17100":{"x":861.5223196275833,"y":575.166499196892,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17101":{"x":613,"y":129,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17102":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17103},"id":394,"renderContextTable":{"__isSmartRef__":true,"id":17109},"textChunks":[{"__isSmartRef__":true,"id":17110}],"eventHandler":{"__isSmartRef__":true,"id":17112},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17113},"_ClipMode":"auto","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":true,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17114},"priorExtent":{"__isSmartRef__":true,"id":17115},"_MaxTextWidth":500,"_MaxTextHeight":200,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17116},"layout":{"__isSmartRef__":true,"id":17263},"doitContext":{"__isSmartRef__":true,"id":17264},"priorSelectionRange":[0,36],"charsReplaced":"","lastFindLoc":20,"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17103":{"_Position":{"__isSmartRef__":true,"id":17104},"renderContextTable":{"__isSmartRef__":true,"id":17105},"_Extent":{"__isSmartRef__":true,"id":17106},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":{"__isSmartRef__":true,"id":17108},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17104":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17105":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17106":{"x":500,"y":200,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17107":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17108":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17109":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17110":{"style":{"__isSmartRef__":true,"id":17111},"chunkOwner":{"__isSmartRef__":true,"id":17102},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17111":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17112":{"morph":{"__isSmartRef__":true,"id":17102},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17113":{"x":2,"y":1,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17114":{"x":0,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17115":{"x":500,"y":200,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17116":{"submorphs":[{"__isSmartRef__":true,"id":17102},{"__isSmartRef__":true,"id":17117}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17254},"id":395,"renderContextTable":{"__isSmartRef__":true,"id":17257},"eventHandler":{"__isSmartRef__":true,"id":17258},"droppingEnabled":true,"halosEnabled":true,"__layered_draggingEnabled__":true,"layout":{"__isSmartRef__":true,"id":17259},"LK2":true,"_Position":{"__isSmartRef__":true,"id":17260},"priorExtent":{"__isSmartRef__":true,"id":17261},"targetMorph":{"__isSmartRef__":true,"id":17102},"titleBar":{"__isSmartRef__":true,"id":17117},"contentOffset":{"__isSmartRef__":true,"id":17114},"collapsedTransform":null,"collapsedExtent":null,"expandedTransform":null,"expandedExtent":null,"ignoreEventsOnExpand":false,"highlighted":true,"_Rotation":0,"_Scale":1,"prevDragPos":{"__isSmartRef__":true,"id":17262},"cameForward":false,"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.Window","withoutLayers":["Global.lively.morphic.GrabbingLayer"]},"17117":{"submorphs":[{"__isSmartRef__":true,"id":17118},{"__isSmartRef__":true,"id":17131},{"__isSmartRef__":true,"id":17177},{"__isSmartRef__":true,"id":17210}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17244},"id":396,"renderContextTable":{"__isSmartRef__":true,"id":17249},"eventHandler":{"__isSmartRef__":true,"id":17250},"droppingEnabled":true,"halosEnabled":true,"layout":{"__isSmartRef__":true,"id":17251},"_Position":{"__isSmartRef__":true,"id":17252},"windowMorph":{"__isSmartRef__":true,"id":17116},"label":{"__isSmartRef__":true,"id":17118},"closeButton":{"__isSmartRef__":true,"id":17131},"menuButton":{"__isSmartRef__":true,"id":17177},"collapseButton":{"__isSmartRef__":true,"id":17210},"priorExtent":{"__isSmartRef__":true,"id":17253},"owner":{"__isSmartRef__":true,"id":17116},"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.TitleBar"},"17118":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17119},"id":397,"renderContextTable":{"__isSmartRef__":true,"id":17123},"textChunks":[{"__isSmartRef__":true,"id":17124}],"eventHandler":{"__isSmartRef__":true,"id":17126},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17127},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","evalEnabled":false,"isLabel":true,"_HandStyle":"default","layout":{"__isSmartRef__":true,"id":17128},"_FontSize":10,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","owner":{"__isSmartRef__":true,"id":17117},"priorExtent":{"__isSmartRef__":true,"id":17129},"_MaxTextWidth":441,"_MaxTextHeight":17,"_Position":{"__isSmartRef__":true,"id":17130},"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17119":{"_Position":{"__isSmartRef__":true,"id":17120},"renderContextTable":{"__isSmartRef__":true,"id":17121},"_Extent":{"__isSmartRef__":true,"id":17122},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"_BorderRadius":0,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17120":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17121":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17122":{"x":441,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17123":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17124":{"style":{"__isSmartRef__":true,"id":17125},"chunkOwner":{"__isSmartRef__":true,"id":17118},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17125":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17126":{"morph":{"__isSmartRef__":true,"id":17118},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17127":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17128":{"resizeWidth":true},"17129":{"x":0,"y":14,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17130":{"x":20,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17131":{"submorphs":[{"__isSmartRef__":true,"id":17132}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17144},"id":398,"renderContextTable":{"__isSmartRef__":true,"id":17159},"eventHandler":{"__isSmartRef__":true,"id":17160},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17161},"priorExtent":{"__isSmartRef__":true,"id":17162},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17163},"label":{"__isSmartRef__":true,"id":17132},"owner":{"__isSmartRef__":true,"id":17117},"layout":{"__isSmartRef__":true,"id":17172},"attributeConnections":[{"__isSmartRef__":true,"id":17173},{"__isSmartRef__":true,"id":17175}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17132":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17133},"id":399,"renderContextTable":{"__isSmartRef__":true,"id":17137},"textChunks":[{"__isSmartRef__":true,"id":17138}],"eventHandler":{"__isSmartRef__":true,"id":17140},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17142},"priorExtent":{"__isSmartRef__":true,"id":17143},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17131},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17133":{"_Position":{"__isSmartRef__":true,"id":17134},"renderContextTable":{"__isSmartRef__":true,"id":17135},"_Extent":{"__isSmartRef__":true,"id":17136},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17134":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17135":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17136":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17137":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17138":{"style":{"__isSmartRef__":true,"id":17139},"chunkOwner":{"__isSmartRef__":true,"id":17132},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17139":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17140":{"morph":{"__isSmartRef__":true,"id":17132},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17141":{"x":0,"y":3,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17142":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17143":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17144":{"_Position":{"__isSmartRef__":true,"id":17145},"renderContextTable":{"__isSmartRef__":true,"id":17146},"_Extent":{"__isSmartRef__":true,"id":17147},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17145":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17146":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17147":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17148":{"r":0.7411764705882353,"g":0.7450980392156863,"b":0.7529411764705882,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17149":{"stops":[{"__isSmartRef__":true,"id":17150},{"__isSmartRef__":true,"id":17152},{"__isSmartRef__":true,"id":17154},{"__isSmartRef__":true,"id":17156}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17150":{"offset":0,"color":{"__isSmartRef__":true,"id":17151}},"17151":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17152":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17153}},"17153":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17154":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17155}},"17155":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17156":{"offset":1,"color":{"__isSmartRef__":true,"id":17157}},"17157":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17158":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17159":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17160":{"morph":{"__isSmartRef__":true,"id":17131},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17161":{"x":480,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17162":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17163":{"stops":[{"__isSmartRef__":true,"id":17164},{"__isSmartRef__":true,"id":17166},{"__isSmartRef__":true,"id":17168},{"__isSmartRef__":true,"id":17170}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17164":{"offset":0,"color":{"__isSmartRef__":true,"id":17165}},"17165":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17166":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17167}},"17167":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17168":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17169}},"17169":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17170":{"offset":1,"color":{"__isSmartRef__":true,"id":17171}},"17171":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17172":{"moveHorizontal":true},"17173":{"sourceObj":{"__isSmartRef__":true,"id":17131},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"getCloseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17174},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17174":{"source":{"__isSmartRef__":true,"id":17131},"target":{"__isSmartRef__":true,"id":17116}},"17175":{"sourceObj":{"__isSmartRef__":true,"id":17131},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"initiateShutdown","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17176},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17176":{"source":{"__isSmartRef__":true,"id":17131},"target":{"__isSmartRef__":true,"id":17116}},"17177":{"submorphs":[{"__isSmartRef__":true,"id":17178}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17189},"id":400,"renderContextTable":{"__isSmartRef__":true,"id":17193},"eventHandler":{"__isSmartRef__":true,"id":17194},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17195},"priorExtent":{"__isSmartRef__":true,"id":17196},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17197},"label":{"__isSmartRef__":true,"id":17178},"owner":{"__isSmartRef__":true,"id":17117},"attributeConnections":[{"__isSmartRef__":true,"id":17206},{"__isSmartRef__":true,"id":17208}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17178":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17179},"id":401,"renderContextTable":{"__isSmartRef__":true,"id":17183},"textChunks":[{"__isSmartRef__":true,"id":17184}],"eventHandler":{"__isSmartRef__":true,"id":17186},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17187},"priorExtent":{"__isSmartRef__":true,"id":17188},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17177},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17179":{"_Position":{"__isSmartRef__":true,"id":17180},"renderContextTable":{"__isSmartRef__":true,"id":17181},"_Extent":{"__isSmartRef__":true,"id":17182},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17180":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17181":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17182":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17183":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17184":{"style":{"__isSmartRef__":true,"id":17185},"chunkOwner":{"__isSmartRef__":true,"id":17178},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17185":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17186":{"morph":{"__isSmartRef__":true,"id":17178},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17187":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17188":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17189":{"_Position":{"__isSmartRef__":true,"id":17190},"renderContextTable":{"__isSmartRef__":true,"id":17191},"_Extent":{"__isSmartRef__":true,"id":17192},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17190":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17191":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17192":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17193":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17194":{"morph":{"__isSmartRef__":true,"id":17177},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17195":{"x":3,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17196":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17197":{"stops":[{"__isSmartRef__":true,"id":17198},{"__isSmartRef__":true,"id":17200},{"__isSmartRef__":true,"id":17202},{"__isSmartRef__":true,"id":17204}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17198":{"offset":0,"color":{"__isSmartRef__":true,"id":17199}},"17199":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17200":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17201}},"17201":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17202":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17203}},"17203":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17204":{"offset":1,"color":{"__isSmartRef__":true,"id":17205}},"17205":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17206":{"sourceObj":{"__isSmartRef__":true,"id":17177},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"getMenuHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17207},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17207":{"source":{"__isSmartRef__":true,"id":17177},"target":{"__isSmartRef__":true,"id":17116}},"17208":{"sourceObj":{"__isSmartRef__":true,"id":17177},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"showTargetMorphMenu","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17209},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17209":{"source":{"__isSmartRef__":true,"id":17177},"target":{"__isSmartRef__":true,"id":17116}},"17210":{"submorphs":[{"__isSmartRef__":true,"id":17211}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17222},"id":402,"renderContextTable":{"__isSmartRef__":true,"id":17226},"eventHandler":{"__isSmartRef__":true,"id":17227},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17228},"priorExtent":{"__isSmartRef__":true,"id":17229},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17230},"label":{"__isSmartRef__":true,"id":17211},"owner":{"__isSmartRef__":true,"id":17117},"layout":{"__isSmartRef__":true,"id":17239},"attributeConnections":[{"__isSmartRef__":true,"id":17240},{"__isSmartRef__":true,"id":17242}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17211":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17212},"id":403,"renderContextTable":{"__isSmartRef__":true,"id":17216},"textChunks":[{"__isSmartRef__":true,"id":17217}],"eventHandler":{"__isSmartRef__":true,"id":17219},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17220},"priorExtent":{"__isSmartRef__":true,"id":17221},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17210},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17212":{"_Position":{"__isSmartRef__":true,"id":17213},"renderContextTable":{"__isSmartRef__":true,"id":17214},"_Extent":{"__isSmartRef__":true,"id":17215},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17213":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17214":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17215":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17216":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17217":{"style":{"__isSmartRef__":true,"id":17218},"chunkOwner":{"__isSmartRef__":true,"id":17211},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17218":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17219":{"morph":{"__isSmartRef__":true,"id":17211},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17220":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17221":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17222":{"_Position":{"__isSmartRef__":true,"id":17223},"renderContextTable":{"__isSmartRef__":true,"id":17224},"_Extent":{"__isSmartRef__":true,"id":17225},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17223":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17224":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17225":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17226":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17227":{"morph":{"__isSmartRef__":true,"id":17210},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17228":{"x":461,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17229":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17230":{"stops":[{"__isSmartRef__":true,"id":17231},{"__isSmartRef__":true,"id":17233},{"__isSmartRef__":true,"id":17235},{"__isSmartRef__":true,"id":17237}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17231":{"offset":0,"color":{"__isSmartRef__":true,"id":17232}},"17232":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17233":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17234}},"17234":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17235":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17236}},"17236":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17237":{"offset":1,"color":{"__isSmartRef__":true,"id":17238}},"17238":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17239":{"moveHorizontal":true},"17240":{"sourceObj":{"__isSmartRef__":true,"id":17210},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"getCollapseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17241},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17241":{"source":{"__isSmartRef__":true,"id":17210},"target":{"__isSmartRef__":true,"id":17116}},"17242":{"sourceObj":{"__isSmartRef__":true,"id":17210},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17116},"targetMethodName":"toggleCollapse","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17243},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17243":{"source":{"__isSmartRef__":true,"id":17210},"target":{"__isSmartRef__":true,"id":17116}},"17244":{"_Position":{"__isSmartRef__":true,"id":17245},"renderContextTable":{"__isSmartRef__":true,"id":17246},"_Extent":{"__isSmartRef__":true,"id":17247},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17248},"_Fill":{"__isSmartRef__":true,"id":17084},"_StrokeOpacity":1,"_BorderRadius":"8px 8px 0px 0px","__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17245":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17246":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17247":{"x":500,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17248":{"r":0.4,"g":0.4,"b":0.4,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17249":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17250":{"morph":{"__isSmartRef__":true,"id":17117},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17251":{"resizeWidth":true,"adjustForNewBounds":true},"17252":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17253":{"x":500,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17254":{"renderContextTable":{"__isSmartRef__":true,"id":17255},"_BorderWidth":0,"_Fill":null,"_StrokeOpacity":0,"_BorderRadius":0,"_Extent":{"__isSmartRef__":true,"id":17256},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17255":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17256":{"x":500,"y":222,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17257":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17258":{"morph":{"__isSmartRef__":true,"id":17116},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17259":{"adjustForNewBounds":true},"17260":{"x":1234,"y":448,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17261":{"x":500,"y":222,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17262":{"x":1478,"y":453,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17263":{"resizeWidth":true,"resizeHeight":true},"17264":{"submorphs":[{"__isSmartRef__":true,"id":17265},{"__isSmartRef__":true,"id":17279}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17409},"id":361,"renderContextTable":{"__isSmartRef__":true,"id":17413},"eventHandler":{"__isSmartRef__":true,"id":17414},"droppingEnabled":true,"halosEnabled":true,"__layered_draggingEnabled__":true,"layout":{"__isSmartRef__":true,"id":17415},"LK2":true,"_Position":{"__isSmartRef__":true,"id":17416},"priorExtent":{"__isSmartRef__":true,"id":17417},"targetMorph":{"__isSmartRef__":true,"id":17265},"titleBar":{"__isSmartRef__":true,"id":17279},"contentOffset":{"__isSmartRef__":true,"id":17275},"collapsedTransform":{"__isSmartRef__":true,"id":17418},"collapsedExtent":{"__isSmartRef__":true,"id":17419},"expandedTransform":{"__isSmartRef__":true,"id":17420},"expandedExtent":{"__isSmartRef__":true,"id":17421},"ignoreEventsOnExpand":false,"owner":null,"showsHalos":false,"highlighted":true,"_Rotation":0,"_Scale":1,"prevDragPos":{"__isSmartRef__":true,"id":17422},"expandedPosition":{"__isSmartRef__":true,"id":17423},"state":"shutdown","collapsedPosition":{"__isSmartRef__":true,"id":17424},"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.Window","withoutLayers":["Global.lively.morphic.GrabbingLayer"]},"17265":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17266},"id":360,"renderContextTable":{"__isSmartRef__":true,"id":17271},"textChunks":[{"__isSmartRef__":true,"id":17272}],"eventHandler":{"__isSmartRef__":true,"id":17274},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17113},"_ClipMode":"auto","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":true,"_FontFamily":"Monaco,monospace","_Position":{"__isSmartRef__":true,"id":17275},"priorExtent":{"__isSmartRef__":true,"id":17276},"_MaxTextWidth":500,"_MaxTextHeight":0,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17264},"layout":{"__isSmartRef__":true,"id":17277},"syntaxHighlightingWhileTyping":true,"attributeConnections":[{"__isSmartRef__":true,"id":17278}],"doNotSerialize":["$$textString"],"doNotCopyProperties":["$$textString"],"lastSyntaxHighlightTime":1307282796737,"accessibleInInactiveWindow":true,"eventsAreIgnored":false,"_HandStyle":"default","_PointerEvents":"auto","_Visible":true,"priorSelectionRange":[0,22],"charsReplaced":"","lastFindLoc":15,"__SourceModuleName__":"Global.lively.morphic.TextCore","textString":"undefined","__LivelyClassName__":"lively.morphic.Text"},"17266":{"_Position":{"__isSmartRef__":true,"id":17267},"renderContextTable":{"__isSmartRef__":true,"id":17268},"_Extent":{"__isSmartRef__":true,"id":17269},"_BorderWidth":2,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":{"__isSmartRef__":true,"id":17270},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17267":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17268":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17269":{"x":500,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17270":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17271":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17272":{"style":{"__isSmartRef__":true,"id":17273},"chunkOwner":{"__isSmartRef__":true,"id":17265},"storedString":"undefined","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17273":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17274":{"morph":{"__isSmartRef__":true,"id":17265},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17275":{"x":0,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17276":{"x":500,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17277":{"resizeWidth":true,"resizeHeight":true},"17278":{"sourceObj":{"__isSmartRef__":true,"id":17265},"sourceAttrName":"textString","targetObj":{"__isSmartRef__":true,"id":17265},"targetMethodName":"highlightJavaScriptSyntax","__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17279":{"submorphs":[{"__isSmartRef__":true,"id":17280},{"__isSmartRef__":true,"id":17292},{"__isSmartRef__":true,"id":17326},{"__isSmartRef__":true,"id":17359}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17393},"id":362,"renderContextTable":{"__isSmartRef__":true,"id":17404},"eventHandler":{"__isSmartRef__":true,"id":17405},"droppingEnabled":true,"halosEnabled":true,"layout":{"__isSmartRef__":true,"id":17406},"_Position":{"__isSmartRef__":true,"id":17407},"windowMorph":{"__isSmartRef__":true,"id":17264},"label":{"__isSmartRef__":true,"id":17280},"closeButton":{"__isSmartRef__":true,"id":17292},"menuButton":{"__isSmartRef__":true,"id":17326},"collapseButton":{"__isSmartRef__":true,"id":17359},"priorExtent":{"__isSmartRef__":true,"id":17408},"owner":{"__isSmartRef__":true,"id":17264},"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.TitleBar"},"17280":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17281},"id":363,"renderContextTable":{"__isSmartRef__":true,"id":17285},"textChunks":[{"__isSmartRef__":true,"id":17286}],"eventHandler":{"__isSmartRef__":true,"id":17288},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17127},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","evalEnabled":false,"isLabel":true,"_HandStyle":"default","layout":{"__isSmartRef__":true,"id":17289},"_FontSize":10,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","owner":{"__isSmartRef__":true,"id":17279},"priorExtent":{"__isSmartRef__":true,"id":17290},"_MaxTextWidth":441,"_MaxTextHeight":17,"_Position":{"__isSmartRef__":true,"id":17291},"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17281":{"_Position":{"__isSmartRef__":true,"id":17282},"renderContextTable":{"__isSmartRef__":true,"id":17283},"_Extent":{"__isSmartRef__":true,"id":17284},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"_BorderRadius":0,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17282":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17283":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17284":{"x":441,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17285":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17286":{"style":{"__isSmartRef__":true,"id":17287},"chunkOwner":{"__isSmartRef__":true,"id":17280},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17287":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17288":{"morph":{"__isSmartRef__":true,"id":17280},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17289":{"resizeWidth":true},"17290":{"x":0,"y":14,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17291":{"x":20,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17292":{"submorphs":[{"__isSmartRef__":true,"id":17293}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17304},"id":364,"renderContextTable":{"__isSmartRef__":true,"id":17308},"eventHandler":{"__isSmartRef__":true,"id":17309},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17310},"priorExtent":{"__isSmartRef__":true,"id":17311},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17312},"label":{"__isSmartRef__":true,"id":17293},"owner":{"__isSmartRef__":true,"id":17279},"layout":{"__isSmartRef__":true,"id":17321},"attributeConnections":[{"__isSmartRef__":true,"id":17322},{"__isSmartRef__":true,"id":17324}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17293":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17294},"id":365,"renderContextTable":{"__isSmartRef__":true,"id":17298},"textChunks":[{"__isSmartRef__":true,"id":17299}],"eventHandler":{"__isSmartRef__":true,"id":17301},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17302},"priorExtent":{"__isSmartRef__":true,"id":17303},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17292},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17294":{"_Position":{"__isSmartRef__":true,"id":17295},"renderContextTable":{"__isSmartRef__":true,"id":17296},"_Extent":{"__isSmartRef__":true,"id":17297},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17295":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17296":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17297":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17298":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17299":{"style":{"__isSmartRef__":true,"id":17300},"chunkOwner":{"__isSmartRef__":true,"id":17293},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17300":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17301":{"morph":{"__isSmartRef__":true,"id":17293},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17302":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17303":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17304":{"_Position":{"__isSmartRef__":true,"id":17305},"renderContextTable":{"__isSmartRef__":true,"id":17306},"_Extent":{"__isSmartRef__":true,"id":17307},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17305":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17306":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17307":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17308":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17309":{"morph":{"__isSmartRef__":true,"id":17292},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17310":{"x":480,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17311":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17312":{"stops":[{"__isSmartRef__":true,"id":17313},{"__isSmartRef__":true,"id":17315},{"__isSmartRef__":true,"id":17317},{"__isSmartRef__":true,"id":17319}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17313":{"offset":0,"color":{"__isSmartRef__":true,"id":17314}},"17314":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17315":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17316}},"17316":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17317":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17318}},"17318":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17319":{"offset":1,"color":{"__isSmartRef__":true,"id":17320}},"17320":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17321":{"moveHorizontal":true},"17322":{"sourceObj":{"__isSmartRef__":true,"id":17292},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"getCloseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17323},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17323":{"source":{"__isSmartRef__":true,"id":17292},"target":{"__isSmartRef__":true,"id":17264}},"17324":{"sourceObj":{"__isSmartRef__":true,"id":17292},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"initiateShutdown","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17325},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17325":{"source":{"__isSmartRef__":true,"id":17292},"target":{"__isSmartRef__":true,"id":17264}},"17326":{"submorphs":[{"__isSmartRef__":true,"id":17327}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17338},"id":366,"renderContextTable":{"__isSmartRef__":true,"id":17342},"eventHandler":{"__isSmartRef__":true,"id":17343},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17344},"priorExtent":{"__isSmartRef__":true,"id":17345},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17346},"label":{"__isSmartRef__":true,"id":17327},"owner":{"__isSmartRef__":true,"id":17279},"attributeConnections":[{"__isSmartRef__":true,"id":17355},{"__isSmartRef__":true,"id":17357}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17327":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17328},"id":367,"renderContextTable":{"__isSmartRef__":true,"id":17332},"textChunks":[{"__isSmartRef__":true,"id":17333}],"eventHandler":{"__isSmartRef__":true,"id":17335},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17336},"priorExtent":{"__isSmartRef__":true,"id":17337},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17326},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17328":{"_Position":{"__isSmartRef__":true,"id":17329},"renderContextTable":{"__isSmartRef__":true,"id":17330},"_Extent":{"__isSmartRef__":true,"id":17331},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17329":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17330":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17331":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17332":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17333":{"style":{"__isSmartRef__":true,"id":17334},"chunkOwner":{"__isSmartRef__":true,"id":17327},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17334":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17335":{"morph":{"__isSmartRef__":true,"id":17327},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17336":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17337":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17338":{"_Position":{"__isSmartRef__":true,"id":17339},"renderContextTable":{"__isSmartRef__":true,"id":17340},"_Extent":{"__isSmartRef__":true,"id":17341},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17339":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17340":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17341":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17342":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17343":{"morph":{"__isSmartRef__":true,"id":17326},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17344":{"x":3,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17345":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17346":{"stops":[{"__isSmartRef__":true,"id":17347},{"__isSmartRef__":true,"id":17349},{"__isSmartRef__":true,"id":17351},{"__isSmartRef__":true,"id":17353}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17347":{"offset":0,"color":{"__isSmartRef__":true,"id":17348}},"17348":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17349":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17350}},"17350":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17351":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17352}},"17352":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17353":{"offset":1,"color":{"__isSmartRef__":true,"id":17354}},"17354":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17355":{"sourceObj":{"__isSmartRef__":true,"id":17326},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"getMenuHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17356},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17356":{"source":{"__isSmartRef__":true,"id":17326},"target":{"__isSmartRef__":true,"id":17264}},"17357":{"sourceObj":{"__isSmartRef__":true,"id":17326},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"showTargetMorphMenu","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17358},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17358":{"source":{"__isSmartRef__":true,"id":17326},"target":{"__isSmartRef__":true,"id":17264}},"17359":{"submorphs":[{"__isSmartRef__":true,"id":17360}],"scripts":[],"shape":{"__isSmartRef__":true,"id":17371},"id":368,"renderContextTable":{"__isSmartRef__":true,"id":17375},"eventHandler":{"__isSmartRef__":true,"id":17376},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17377},"priorExtent":{"__isSmartRef__":true,"id":17378},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17149},"lighterFill":{"__isSmartRef__":true,"id":17379},"label":{"__isSmartRef__":true,"id":17360},"owner":{"__isSmartRef__":true,"id":17279},"layout":{"__isSmartRef__":true,"id":17388},"attributeConnections":[{"__isSmartRef__":true,"id":17389},{"__isSmartRef__":true,"id":17391}],"doNotSerialize":["$$getHelpText","$$fire"],"doNotCopyProperties":["$$getHelpText","$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","__LivelyClassName__":"lively.morphic.WindowControl"},"17360":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17361},"id":369,"renderContextTable":{"__isSmartRef__":true,"id":17365},"textChunks":[{"__isSmartRef__":true,"id":17366}],"eventHandler":{"__isSmartRef__":true,"id":17368},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17141},"_ClipMode":"hidden","fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","_Position":{"__isSmartRef__":true,"id":17369},"priorExtent":{"__isSmartRef__":true,"id":17370},"_MaxTextWidth":17,"_MaxTextHeight":17,"evalEnabled":false,"owner":{"__isSmartRef__":true,"id":17359},"isLabel":true,"_HandStyle":"default","_FontSize":8,"_Align":"center","eventsAreIgnored":true,"_PointerEvents":"none","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17361":{"_Position":{"__isSmartRef__":true,"id":17362},"renderContextTable":{"__isSmartRef__":true,"id":17363},"_Extent":{"__isSmartRef__":true,"id":17364},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17107},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17362":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17363":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17364":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17365":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17366":{"style":{"__isSmartRef__":true,"id":17367},"chunkOwner":{"__isSmartRef__":true,"id":17360},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17367":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17368":{"morph":{"__isSmartRef__":true,"id":17360},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17369":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17370":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17371":{"_Position":{"__isSmartRef__":true,"id":17372},"renderContextTable":{"__isSmartRef__":true,"id":17373},"_Extent":{"__isSmartRef__":true,"id":17374},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":17148},"_Fill":{"__isSmartRef__":true,"id":17149},"_StrokeOpacity":0,"_BorderRadius":5,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17372":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17373":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17374":{"x":17,"y":17,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17375":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17376":{"morph":{"__isSmartRef__":true,"id":17359},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17377":{"x":461,"y":3,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17378":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17379":{"stops":[{"__isSmartRef__":true,"id":17380},{"__isSmartRef__":true,"id":17382},{"__isSmartRef__":true,"id":17384},{"__isSmartRef__":true,"id":17386}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17380":{"offset":0,"color":{"__isSmartRef__":true,"id":17381}},"17381":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17382":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17383}},"17383":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17384":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17385}},"17385":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17386":{"offset":1,"color":{"__isSmartRef__":true,"id":17387}},"17387":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17388":{"moveHorizontal":true},"17389":{"sourceObj":{"__isSmartRef__":true,"id":17359},"sourceAttrName":"getHelpText","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"getCollapseHelp","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17390},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17390":{"source":{"__isSmartRef__":true,"id":17359},"target":{"__isSmartRef__":true,"id":17264}},"17391":{"sourceObj":{"__isSmartRef__":true,"id":17359},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17264},"targetMethodName":"toggleCollapse","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17392},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17392":{"source":{"__isSmartRef__":true,"id":17359},"target":{"__isSmartRef__":true,"id":17264}},"17393":{"_Position":{"__isSmartRef__":true,"id":17394},"renderContextTable":{"__isSmartRef__":true,"id":17395},"_Extent":{"__isSmartRef__":true,"id":17396},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17248},"_Fill":{"__isSmartRef__":true,"id":17397},"_StrokeOpacity":1,"_BorderRadius":"8px 8px 0px 0px","__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17394":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17395":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17396":{"x":500,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17397":{"stops":[{"__isSmartRef__":true,"id":17398},{"__isSmartRef__":true,"id":17400},{"__isSmartRef__":true,"id":17402}],"vector":{"__isSmartRef__":true,"id":17158},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17398":{"offset":0,"color":{"__isSmartRef__":true,"id":17399}},"17399":{"r":0.8600000000000001,"g":0.8600000000000001,"b":0.8600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17400":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17401}},"17401":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17402":{"offset":1,"color":{"__isSmartRef__":true,"id":17403}},"17403":{"r":0.8600000000000001,"g":0.8600000000000001,"b":0.8600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17404":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17405":{"morph":{"__isSmartRef__":true,"id":17279},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17406":{"resizeWidth":true,"adjustForNewBounds":true},"17407":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17408":{"x":500,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17409":{"renderContextTable":{"__isSmartRef__":true,"id":17410},"_BorderWidth":0,"_Fill":null,"_StrokeOpacity":0,"_BorderRadius":0,"_Extent":{"__isSmartRef__":true,"id":17411},"_Position":{"__isSmartRef__":true,"id":17412},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17410":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17411":{"x":500,"y":222,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17412":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17413":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17414":{"morph":{"__isSmartRef__":true,"id":17264},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17415":{"adjustForNewBounds":true},"17416":{"x":1131,"y":79,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17417":{"x":500,"y":222,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17418":{"a":1,"b":0,"c":0,"d":1,"e":1131,"f":79,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"lively.morphic.Similitude"},"17419":{"x":500,"y":22,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17420":{"a":1,"b":0,"c":0,"d":1,"e":1131,"f":79,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"lively.morphic.Similitude"},"17421":{"x":500,"y":222,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17422":{"x":1507,"y":76,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17423":{"x":1131,"y":79,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17424":{"x":1131,"y":79,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17425":{"x":377.6609726943286,"y":419.5142810783999,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17426":{"requiredModules":[],"migrationLevel":2,"partsSpaceName":"PartsBin/Tools","__SourceModuleName__":"Global.lively.PartsBin","comment":"Edit scripts and connections of a specific morph. Early version.","partName":"ObjectEditor","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17427":{"submorphs":[],"scripts":[],"id":"39CDE415-FF3B-4A1B-A12C-11ED2E20AB8F","shape":{"__isSmartRef__":true,"id":17428},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_Padding":{"__isSmartRef__":true,"id":17435},"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":true,"_FontFamily":"Monaco,courier","_MaxTextWidth":689.0285365288845,"_MaxTextHeight":null,"textChunks":[{"__isSmartRef__":true,"id":17436},{"__isSmartRef__":true,"id":17439},{"__isSmartRef__":true,"id":17441},{"__isSmartRef__":true,"id":17444},{"__isSmartRef__":true,"id":17446},{"__isSmartRef__":true,"id":17448},{"__isSmartRef__":true,"id":17450},{"__isSmartRef__":true,"id":17452},{"__isSmartRef__":true,"id":17454},{"__isSmartRef__":true,"id":17456},{"__isSmartRef__":true,"id":17458},{"__isSmartRef__":true,"id":17460},{"__isSmartRef__":true,"id":17462},{"__isSmartRef__":true,"id":17464},{"__isSmartRef__":true,"id":17466},{"__isSmartRef__":true,"id":17469},{"__isSmartRef__":true,"id":17471},{"__isSmartRef__":true,"id":17473}],"layout":{"__isSmartRef__":true,"id":17475},"showsHalos":false,"prevScroll":[0,0],"priorSelectionRange":[156,156],"name":"ObjectEditorScriptPane","charsReplaced":"","lastFindLoc":152,"partsBinMetaInfo":{"__isSmartRef__":true,"id":17476},"__SourceModuleName__":"Global.lively.morphic.TextCore","priorExtent":{"__isSmartRef__":true,"id":17477},"_ClipMode":"auto","_FontSize":9,"lastSyntaxHighlightTime":1337026937870,"doitContext":{"__isSmartRef__":true,"id":60},"savedTextString":"// changed at Thu Feb 02 2012 14:37:57 GMT+0100 (CET) by conradcalmez \nthis.addScript(function createMenuItems(items) {\n alertOK(\"creating menu items ... like a boss\");\n}).tag([]);","_Align":"left","renderContextTable":{"__isSmartRef__":true,"id":17478},"lastSearchString":"stringsformat","eventHandler":{"__isSmartRef__":true,"id":17479},"attributeConnections":[{"__isSmartRef__":true,"id":17480}],"doNotSerialize":["$$textString"],"doNotCopyProperties":["$$textString"],"distanceToDragEvent":{"__isSmartRef__":true,"id":17505},"_MinTextWidth":689.0285365288845,"_MinTextHeight":null,"previousSelection":[120,120],"lastSaveSource":"// changed at Mon May 14 2012 11:43:46 GMT+0200 (CEST) by jan.sandbrink \nthis.addScript(function clear() {\n this.getGemFrame().clear();\n this.gameOverIndicator.gameStarted();\n this.updateScore(0);\n}).tag([]);","isBeingDragged":false,"draggingEnabled":false,"objectEditorPane":{"__isSmartRef__":true,"id":16931},"isCopyMorphRef":true,"morphRefId":1,"statusMorph":{"__isSmartRef__":true,"id":17506},"derivationIds":[219,"DD5046D0-C1D6-412A-83C9-CD7EE63D40E0","4D92BDFD-A599-4154-A197-A4B1292C1619","98551F68-B128-4262-9BC2-6B8AC7C8D7C0","47731662-FF8E-4C0F-A170-FD5C56A06021","3FC7FDE6-156F-4056-BB04-B76D8B6C5472","C1E8D5BB-56F9-47B3-A520-BEEFEF791823","115FC149-EEF9-415A-A5B7-AB0B9D0170A4","0D66FA39-01E7-4F16-840C-4FA0FA14DD10","B0A74693-DE3F-4867-8DC0-61B098A8F0D1","3547765B-E224-48EC-B58F-278C1DC7422E"],"_Position":{"__isSmartRef__":true,"id":17521},"owner":{"__isSmartRef__":true,"id":16931},"_Rotation":0,"_Scale":1,"textString":"// changed at Mon May 14 2012 11:43:46 GMT+0200 (CEST) by jan.sandbrink \nthis.addScript(function clear() {\n this.getGemFrame().clear();\n this.gameOverIndicator.gameStarted();\n this.updateScore(0);\n}).tag([]);","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17522},"__LivelyClassName__":"lively.morphic.Text"},"17428":{"_Position":{"__isSmartRef__":true,"id":17429},"_Extent":{"__isSmartRef__":true,"id":17430},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17431},"_Fill":{"__isSmartRef__":true,"id":17432},"__SourceModuleName__":"Global.lively.morphic.Shapes","_BorderRadius":0,"renderContextTable":{"__isSmartRef__":true,"id":17433},"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"auto","_Padding":{"__isSmartRef__":true,"id":17434},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17429":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17430":{"x":691.0285365288845,"y":475.61253261443596,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17431":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17432":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17433":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17434":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17435":{"x":2,"y":1,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17436":{"style":{"__isSmartRef__":true,"id":17437},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"// changed at Mon May 14 2012 11:43:46 GMT+0200 (CEST) by jan.sandbrink ","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17437":{"color":{"__isSmartRef__":true,"id":17438},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17438":{"r":0,"g":0.5019607843137255,"b":0,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17439":{"style":{"__isSmartRef__":true,"id":17440},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"\n","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17440":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17441":{"style":{"__isSmartRef__":true,"id":17442},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"this","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17442":{"color":{"__isSmartRef__":true,"id":17443},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17443":{"r":0,"g":0,"b":0.5450980392156862,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17444":{"style":{"__isSmartRef__":true,"id":17445},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":".addScript(","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17445":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17446":{"style":{"__isSmartRef__":true,"id":17447},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"function","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17447":{"color":{"__isSmartRef__":true,"id":17443},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17448":{"style":{"__isSmartRef__":true,"id":17449},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":" clear() ","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17449":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17450":{"style":{"__isSmartRef__":true,"id":17451},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"{","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17451":{"color":{"__isSmartRef__":true,"id":17438},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17452":{"style":{"__isSmartRef__":true,"id":17453},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"\n ","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17453":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17454":{"style":{"__isSmartRef__":true,"id":17455},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"this","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17455":{"color":{"__isSmartRef__":true,"id":17443},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17456":{"style":{"__isSmartRef__":true,"id":17457},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":".getGemFrame().clear();\n ","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17457":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17458":{"style":{"__isSmartRef__":true,"id":17459},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"this","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17459":{"color":{"__isSmartRef__":true,"id":17443},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17460":{"style":{"__isSmartRef__":true,"id":17461},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":".gameOverIndicator.gameStarted();\n ","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17461":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17462":{"style":{"__isSmartRef__":true,"id":17463},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"this","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17463":{"color":{"__isSmartRef__":true,"id":17443},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17464":{"style":{"__isSmartRef__":true,"id":17465},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":".updateScore(","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17465":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17466":{"style":{"__isSmartRef__":true,"id":17467},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"0","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17467":{"color":{"__isSmartRef__":true,"id":17468},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17468":{"r":0,"g":0,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17469":{"style":{"__isSmartRef__":true,"id":17470},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":");\n","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17470":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17471":{"style":{"__isSmartRef__":true,"id":17472},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":"}","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17472":{"color":{"__isSmartRef__":true,"id":17438},"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17473":{"style":{"__isSmartRef__":true,"id":17474},"chunkOwner":{"__isSmartRef__":true,"id":17427},"storedString":").tag([]);","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17474":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"17475":{"resizeWidth":true,"resizeHeight":true},"17476":{"requiredModules":[],"partsSpaceName":"PartsBin/Widgets/","migrationLevel":2,"__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17477":{"x":691.0285365288845,"y":475.61253261443596,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17478":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17479":{"morph":{"__isSmartRef__":true,"id":17427},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17480":{"sourceObj":{"__isSmartRef__":true,"id":17427},"sourceAttrName":"textString","targetObj":{"__isSmartRef__":true,"id":17481},"targetMethodName":"indicateUnsavedChanges","__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17481":{"submorphs":[],"scripts":[],"id":"7CA954DA-5394-4545-A3F7-6C1BF84FD553","shape":{"__isSmartRef__":true,"id":17482},"droppingEnabled":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17488},"showsHalos":false,"name":"ChangeIndicator","partsBinMetaInfo":{"__isSmartRef__":true,"id":17489},"__SourceModuleName__":"Global.lively.morphic.Core","renderContextTable":{"__isSmartRef__":true,"id":17490},"eventHandler":{"__isSmartRef__":true,"id":17491},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"owner":{"__isSmartRef__":true,"id":16931},"priorExtent":{"__isSmartRef__":true,"id":17492},"layout":{"__isSmartRef__":true,"id":17493},"isBeingDragged":false,"savedColor":{"__isSmartRef__":true,"id":17485},"alarmColor":{"__isSmartRef__":true,"id":17494},"grabbingEnabled":false,"draggingEnabled":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":17495},"isCopyMorphRef":true,"morphRefId":26,"derivationIds":[220,"EE491D24-F056-4AFE-A669-7B7048C6C3D1","3FA4A8C3-0FC0-43A0-8C00-00A96F9022E2","62DAD3C6-A81D-450F-B32F-601EA7E619D8","EEDB0C58-5990-481A-A7FF-ACB1A2DF08DD","16F708CB-1259-4A75-BAEF-1A5216C6CB19","97CA61D3-E09B-43CD-9880-D8B36FA303F3","0AF6BEEC-8A57-44FF-9D8D-40BA6CC6A0CD","AF2BEE76-C34F-457E-8699-9896327A4C07","5EC39FF0-602F-44A2-BE3A-04FCA127E5D1","44CEBF61-9A92-4E36-9576-425D5054B471"],"_ClipMode":"visible","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17496},"__LivelyClassName__":"lively.morphic.Box"},"17482":{"position":{"__isSmartRef__":true,"id":17483},"_Extent":{"__isSmartRef__":true,"id":17484},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17485},"_Fill":{"__isSmartRef__":true,"id":17485},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":17486},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":17487},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17483":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17484":{"x":8.637782619743348,"y":9.712632235981744,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17485":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17486":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17487":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17488":{"x":883.0245425248855,"y":39.999999999999986,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17489":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","comment":"A simple box morph. A really blue one. Its amazing what you can build out of simple boxes.... Who needs stars when you got blue rectangles!","migrationLevel":2,"partName":"Rectangle","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17490":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"17491":{"morph":{"__isSmartRef__":true,"id":17481},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17492":{"x":8.637782619743348,"y":10.787481852220026,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17493":{"moveHorizontal":true,"adjustForNewBounds":true},"17494":{"r":0.9411764705882353,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17495":{"x":37.328206296760186,"y":-17.53316489131697,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17496":{"indicateUnsavedChanges":{"__isSmartRef__":true,"id":17497},"setColors":{"__isSmartRef__":true,"id":17501}},"17497":{"varMapping":{"__isSmartRef__":true,"id":17498},"source":"function indicateUnsavedChanges() {\n if (this.owner.scriptPane.hasChanged()) {\n this.setColors(this.alarmColor);\n } else {\n this.setColors(this.savedColor);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17499},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17498":{"this":{"__isSmartRef__":true,"id":17481}},"17499":{"user":"lauritz","timestamp":{"__isSmartRef__":true,"id":17500}},"17500":{"isSerializedDate":true,"string":"Tue Sep 27 2011 20:09:19 GMT+0200 (CEST)"},"17501":{"varMapping":{"__isSmartRef__":true,"id":17502},"source":"function setColors(color) {\n this.setFill(color);\n this.setBorderColor(color);\n}","funcProperties":{"__isSmartRef__":true,"id":17503},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17502":{"this":{"__isSmartRef__":true,"id":17481}},"17503":{"user":"lauritz","timestamp":{"__isSmartRef__":true,"id":17504}},"17504":{"isSerializedDate":true,"string":"Tue Sep 27 2011 19:06:09 GMT+0200 (CEST)"},"17505":{"x":341.1979959929888,"y":-18.288721442524036,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17506":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":17507},"id":553,"renderContextTable":{"__isSmartRef__":true,"id":17514},"_WhiteSpaceHandling":"pre-wrap","textChunks":[{"__isSmartRef__":true,"id":17515}],"eventHandler":{"__isSmartRef__":true,"id":17517},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"_ClipMode":"visible","fixedWidth":true,"fixedHeight":true,"allowInput":true,"_FontFamily":"Helvetica","_FontSize":11,"_Position":{"__isSmartRef__":true,"id":17518},"priorExtent":{"__isSmartRef__":true,"id":17519},"_MaxTextWidth":90,"_MinTextWidth":90,"_MaxTextHeight":null,"_MinTextHeight":null,"evalEnabled":false,"_Align":"center","_VerticalAlign":"center","_TextColor":{"__isSmartRef__":true,"id":17520},"owner":null,"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.Text"},"17507":{"_Position":{"__isSmartRef__":true,"id":17508},"renderContextTable":{"__isSmartRef__":true,"id":17509},"_Extent":{"__isSmartRef__":true,"id":17510},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":17511},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17512},"_Fill":{"__isSmartRef__":true,"id":17513},"_StrokeOpacity":0,"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17508":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17509":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"17510":{"x":100,"y":25,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17511":{"x":4,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17512":{"r":0.8,"g":0.8,"b":0.8,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17513":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17514":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17515":{"style":{"__isSmartRef__":true,"id":17516},"chunkOwner":{"__isSmartRef__":true,"id":17506},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17516":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17517":{"morph":{"__isSmartRef__":true,"id":17506},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17518":{"x":313.51426826444225,"y":228.80626630721798,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17519":{"x":100,"y":25,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17520":{"r":0,"g":0.8,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17521":{"x":200,"y":40,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17522":{"doSave":{"__isSmartRef__":true,"id":17523},"boundEval":{"__isSmartRef__":true,"id":17531},"reset":{"__isSmartRef__":true,"id":17539},"display":{"__isSmartRef__":true,"id":17543},"hasChanged":{"__isSmartRef__":true,"id":17547},"setTarget":{"__isSmartRef__":true,"id":17551},"displayStatus":{"__isSmartRef__":true,"id":17555}},"17523":{"varMapping":{"__isSmartRef__":true,"id":17524},"source":"function doSave() {\n $super();\n var saved = this.boundEval(this.getTextString());\n if (saved) {\n this.lastSaveSource = this.textString;\n this.owner.changeIndicator.indicateUnsavedChanges();\n this.owner.updateLists();\n this.owner.selectChangedContent(this.getTextString());\n this.displayStatus(\"saved source\", Color.green);\n } else {\n this.displayStatus(\"not saved\", Color.red);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17529},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17524":{"this":{"__isSmartRef__":true,"id":17427},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17525}},"17525":{"$super":{"__isSmartRef__":true,"id":17526}},"17526":{"varMapping":{"__isSmartRef__":true,"id":17527},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":17528},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17527":{"obj":{"__isSmartRef__":true,"id":17427},"name":"doSave"},"17528":{},"17529":{"timestamp":{"__isSmartRef__":true,"id":17530},"user":"lauritz"},"17530":{"isSerializedDate":true,"string":"Thu Nov 17 2011 23:15:19 GMT+0100 (CET)"},"17531":{"varMapping":{"__isSmartRef__":true,"id":17532},"source":"function boundEval(str) {\n var result;\n\n this.objectEditorPane.ensureAnnotationLayer();\n withLayers([ScriptAnnotationLayer], function() {\n result = $super(str);\n })\n \n return result\n}","funcProperties":{"__isSmartRef__":true,"id":17537},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17532":{"this":{"__isSmartRef__":true,"id":17427},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17533}},"17533":{"$super":{"__isSmartRef__":true,"id":17534}},"17534":{"varMapping":{"__isSmartRef__":true,"id":17535},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":17536},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17535":{"obj":{"__isSmartRef__":true,"id":17427},"name":"boundEval"},"17536":{},"17537":{"timestamp":{"__isSmartRef__":true,"id":17538},"user":"lauritz","categories":[]},"17538":{"isSerializedDate":true,"string":"Wed Nov 16 2011 05:41:53 GMT+0100 (CET)"},"17539":{"varMapping":{"__isSmartRef__":true,"id":17540},"source":"function reset() {\n this.doitContext = null;\n this.lastSaveSource = \"\";\n this.textString = \"\";\n this.lastSaveSource = this.textString;\n}","funcProperties":{"__isSmartRef__":true,"id":17541},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17540":{"this":{"__isSmartRef__":true,"id":17427}},"17541":{"timestamp":{"__isSmartRef__":true,"id":17542},"user":"lauritz","categories":[]},"17542":{"isSerializedDate":true,"string":"Tue Sep 27 2011 20:14:35 GMT+0200 (CEST)"},"17543":{"varMapping":{"__isSmartRef__":true,"id":17544},"source":"function display(jsCode) {\n this.lastSaveSource = jsCode;\n this.setTextString(jsCode);\n this.highlightJavaScriptSyntax();\n this.applyStyle({align: 'left'});\n}","funcProperties":{"__isSmartRef__":true,"id":17545},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17544":{"this":{"__isSmartRef__":true,"id":17427}},"17545":{"timestamp":{"__isSmartRef__":true,"id":17546},"user":"lauritz","categories":[]},"17546":{"isSerializedDate":true,"string":"Tue Sep 27 2011 19:47:57 GMT+0200 (CEST)"},"17547":{"varMapping":{"__isSmartRef__":true,"id":17548},"source":"function hasChanged() {\n var cleanText = function (string) {\n var source = string.trim();\n if (source.substring(0,2) === \"//\") {\n // removes annotation line\n source = source.substring(source.indexOf(\"\\n\"), source.length);\n source = source.trim();\n }\n if (source === 'undefined' || source === 'null') source = '';\n return source;\n }\n var cleanedTextString = cleanText(this.textString);\n var cleanedLastSource = cleanText(this.lastSaveSource);\n return cleanedTextString !== cleanedLastSource;\n}","funcProperties":{"__isSmartRef__":true,"id":17549},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17548":{"this":{"__isSmartRef__":true,"id":17427}},"17549":{"timestamp":{"__isSmartRef__":true,"id":17550},"user":"lauritz","categories":[]},"17550":{"isSerializedDate":true,"string":"Mon Oct 03 2011 18:29:45 GMT+0200 (CEST)"},"17551":{"varMapping":{"__isSmartRef__":true,"id":17552},"source":"function setTarget(target) {\n module('lively.ide.SyntaxHighlighting').load(true);\n this.doitContext = target;\n}","funcProperties":{"__isSmartRef__":true,"id":17553},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17552":{"this":{"__isSmartRef__":true,"id":17427}},"17553":{"timestamp":{"__isSmartRef__":true,"id":17554},"user":"lauritz","categories":[]},"17554":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:30:39 GMT+0100 (CET)"},"17555":{"varMapping":{"__isSmartRef__":true,"id":17556},"source":"function displayStatus(msg, color, delay) {\n if (!this.statusMorph) {\n this.statusMorph = new TextMorph(pt(100,25).extentAsRectangle());\n this.statusMorph.applyStyle({borderWidth: 1, strokeOpacity: 0, borderColor: Color.gray});\n this.statusMorph.setFill(this.owner.getFill());\n this.statusMorph.setFontSize(11);\n this.statusMorph.setAlign('center');\n this.statusMorph.setVerticalAlign('center');\n }\n this.statusMorph.setTextString(msg);\n this.statusMorph.centerAt(this.innerBounds().center());\n this.statusMorph.setTextColor(color || Color.black);\n this.addMorph(this.statusMorph);\n (function() { this.statusMorph.remove() }).bind(this).delay(delay || 2); \n}","funcProperties":{"__isSmartRef__":true,"id":17557},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17556":{"this":{"__isSmartRef__":true,"id":17427}},"17557":{"timestamp":{"__isSmartRef__":true,"id":17558},"user":"lauritz","categories":[]},"17558":{"isSerializedDate":true,"string":"Wed Nov 23 2011 18:23:05 GMT+0100 (CET)"},"17559":{"submorphs":[{"__isSmartRef__":true,"id":17560}],"scripts":[],"id":847,"shape":{"__isSmartRef__":true,"id":17574},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17589},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17577},"lighterFill":{"__isSmartRef__":true,"id":17590},"label":{"__isSmartRef__":true,"id":17560},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","_Rotation":0,"padding":{"__isSmartRef__":true,"id":17599},"name":"ObjectEditorClassButton","partsBinMetaInfo":{"__isSmartRef__":true,"id":17600},"_Scale":1,"owner":null,"layout":{"__isSmartRef__":true,"id":17601},"renderContextTable":{"__isSmartRef__":true,"id":17602},"eventHandler":{"__isSmartRef__":true,"id":17603},"__LivelyClassName__":"lively.morphic.Button"},"17560":{"submorphs":[],"scripts":[],"id":848,"shape":{"__isSmartRef__":true,"id":17561},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":false,"halosEnabled":true,"fixedWidth":true,"_MaxTextWidth":116,"_MaxTextHeight":18,"fixedHeight":true,"allowsInput":false,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17566},"textColor":{"__isSmartRef__":true,"id":17564},"owner":{"__isSmartRef__":true,"id":17559},"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":17567}],"padding":{"__isSmartRef__":true,"id":17569},"_Padding":{"__isSmartRef__":true,"id":17570},"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":17571},"_FontFamily":"Helvetica, Sans-Serif","_ClipMode":"visible","_WhiteSpaceHandling":"pre-wrap","_Align":"center","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17572},"eventHandler":{"__isSmartRef__":true,"id":17573},"_HandStyle":"default","_PointerEvents":"none","__LivelyClassName__":"lively.morphic.Text"},"17561":{"borderWidth":0,"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":17562},"_Extent":{"__isSmartRef__":true,"id":17563},"_BorderColor":{"__isSmartRef__":true,"id":17564},"renderContextTable":{"__isSmartRef__":true,"id":17565},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17562":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17563":{"x":116,"y":18,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17564":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17565":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17566":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17567":{"style":{"__isSmartRef__":true,"id":17568},"chunkOwner":{"__isSmartRef__":true,"id":17560},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17568":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17569":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17570":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17571":{"x":116,"y":18,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17572":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17573":{"morph":{"__isSmartRef__":true,"id":17560},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17574":{"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":17575},"_Extent":{"__isSmartRef__":true,"id":17576},"_Fill":{"__isSmartRef__":true,"id":17577},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17587},"_BorderRadius":5,"renderContextTable":{"__isSmartRef__":true,"id":17588},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17575":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17576":{"x":116,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17577":{"stops":[{"__isSmartRef__":true,"id":17578},{"__isSmartRef__":true,"id":17580},{"__isSmartRef__":true,"id":17582},{"__isSmartRef__":true,"id":17584}],"vector":{"__isSmartRef__":true,"id":17586},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17578":{"offset":0,"color":{"__isSmartRef__":true,"id":17579}},"17579":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17580":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17581}},"17581":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17582":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17583}},"17583":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17584":{"offset":1,"color":{"__isSmartRef__":true,"id":17585}},"17585":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17586":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17587":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17588":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17589":{"x":820,"y":8.999999999999972,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17590":{"stops":[{"__isSmartRef__":true,"id":17591},{"__isSmartRef__":true,"id":17593},{"__isSmartRef__":true,"id":17595},{"__isSmartRef__":true,"id":17597}],"vector":{"__isSmartRef__":true,"id":17586},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17591":{"offset":0,"color":{"__isSmartRef__":true,"id":17592}},"17592":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17593":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17594}},"17594":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17595":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17596}},"17596":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17597":{"offset":1,"color":{"__isSmartRef__":true,"id":17598}},"17598":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17599":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17600":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"comment":"Simple button. Connect to 'fire' to trigger actions when the button is pressed.","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17601":{"moveHorizontal":true},"17602":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17603":{"morph":{"__isSmartRef__":true,"id":17559},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17604":{"submorphs":[],"scripts":[],"id":"DF3DC290-EA83-4091-AB24-0A59D09E3BA5","shape":{"__isSmartRef__":true,"id":17605},"droppingEnabled":true,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":17612},"itemList":["-- ALL --"],"selectedLineNo":1,"showsHalos":false,"name":"ObjectEditorConnectionList","partsBinMetaInfo":{"__isSmartRef__":true,"id":17613},"__SourceModuleName__":"Global.lively.morphic.Core","_ClipMode":"auto","owner":{"__isSmartRef__":true,"id":16931},"priorExtent":{"__isSmartRef__":true,"id":17614},"attributeConnections":[{"__isSmartRef__":true,"id":17615}],"doNotSerialize":["$$selection"],"doNotCopyProperties":["$$selection"],"prevScroll":[0,0],"layout":{"__isSmartRef__":true,"id":17620},"renderContextTable":{"__isSmartRef__":true,"id":17621},"eventHandler":{"__isSmartRef__":true,"id":17622},"_FontSize":10,"distanceToDragEvent":{"__isSmartRef__":true,"id":17623},"grabbingEnabled":false,"draggingEnabled":false,"isCopyMorphRef":true,"morphRefId":19,"derivationIds":[209,"3900F5DF-0FF7-4C94-8BDB-44AAE12B4A3E","35301083-B60D-4A43-8566-23860EEB4C04","9CC401CC-5A35-4643-935B-FD049C284E16","C9879D40-5E79-4C56-AA79-562ED82BF052","9F6F9261-EB76-4B58-B77D-7D70813A1ED7","8B59E237-F372-4F70-9768-7E9C1A7A021D","FC85F1B9-1978-42D2-850C-BD249981E8B4","D2B607C6-A89B-4B3F-91BB-720451EAB98D","CC361093-FF73-479B-9431-C645CB48F518","307D3B7C-C0E1-484F-8D7E-39FBA9D8EDA5"],"selection":null,"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17624},"__LivelyClassName__":"lively.morphic.List"},"17605":{"position":{"__isSmartRef__":true,"id":17606},"_Extent":{"__isSmartRef__":true,"id":17607},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17608},"_Fill":{"__isSmartRef__":true,"id":17609},"__SourceModuleName__":"Global.lively.morphic.Shapes","_BorderRadius":0,"renderContextTable":{"__isSmartRef__":true,"id":17610},"_Opacity":1,"_BorderStyle":"solid","_Padding":{"__isSmartRef__":true,"id":17611},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17606":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17607":{"x":180,"y":74,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17608":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17609":{"r":0.95,"g":0.95,"b":0.95,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"17610":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"17611":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17612":{"x":10,"y":441.5965565984398,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17613":{"partsSpaceName":"PartsBin/NewWorld","migrationLevel":2,"__SourceModuleName__":"Global.lively.PartsBin","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17614":{"x":180,"y":75,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17615":{"sourceObj":{"__isSmartRef__":true,"id":17604},"sourceAttrName":"selection","targetObj":{"__isSmartRef__":true,"id":16931},"targetMethodName":"displaySourceForConnection","converterString":"function (value) {\n if (!value) return;\n return (value === '-- ALL --') ? null : value[1];\n}","updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17616},"__SourceModuleName__":"Global.lively.bindings","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17617},"__LivelyClassName__":"AttributeConnection"},"17616":{"source":{"__isSmartRef__":true,"id":17604},"target":{"__isSmartRef__":true,"id":16931}},"17617":{"converter":{"__isSmartRef__":true,"id":17618}},"17618":{"originalFunc":null,"varMapping":{"__isSmartRef__":true,"id":17616},"source":"function (value) {\n if (!value) return;\n return (value === '-- ALL --') ? null : value[1];\n}","funcProperties":{"__isSmartRef__":true,"id":17619},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17619":{},"17620":{"resizeHeight":false,"moveVertical":true},"17621":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateListContent":"updateListContentHTML","resizeList":"resizeListHTML","getItemIndexFromEvent":"getItemIndexFromEventHTML","getListExtent":"getListExtentHTML","setSize":"setSizeHTML","renderAsDropDownList":"renderAsDropDownListHTML","setFontSize":"setFontSizeHTML","setFontFamily":"setFontFamilyHTML","getSelectedIndexes":"getSelectedIndexesHTML","enableMultipleSelections":"enableMultipleSelectionsHTML","selectAllAt":"selectAllAtHTML","clearSelections":"clearSelectionsHTML","deselectAt":"deselectAtHTML"},"17622":{"morph":{"__isSmartRef__":true,"id":17604},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17623":{"x":124.95989979964943,"y":-17.076643708895745,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17624":{"preselectItem":{"__isSmartRef__":true,"id":17625}},"17625":{"varMapping":{"__isSmartRef__":true,"id":17626},"source":"function preselectItem() {\n if (this.getList().size() === 2) {\n this.selectAt(1);\n } else {\n this.selectAt(0);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17627},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17626":{"this":{"__isSmartRef__":true,"id":17604}},"17627":{"timestamp":{"__isSmartRef__":true,"id":17628},"user":"lauritz"},"17628":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:12:58 GMT+0100 (CET)"},"17629":{"submorphs":[{"__isSmartRef__":true,"id":17630}],"scripts":[],"id":47,"shape":{"__isSmartRef__":true,"id":17643},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17658},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":17646},"lighterFill":{"__isSmartRef__":true,"id":17659},"label":{"__isSmartRef__":true,"id":17630},"attributeConnections":[{"__isSmartRef__":true,"id":17668}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","_Rotation":0,"padding":{"__isSmartRef__":true,"id":17669},"name":"ObjectEditorTargetButton","partsBinMetaInfo":{"__isSmartRef__":true,"id":17670},"_Scale":1,"owner":null,"renderContextTable":{"__isSmartRef__":true,"id":17671},"isCopyMorphRef":true,"morphRefId":1,"__LivelyClassName__":"lively.morphic.Button"},"17630":{"submorphs":[],"scripts":[],"id":48,"shape":{"__isSmartRef__":true,"id":17631},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":false,"halosEnabled":true,"fixedWidth":true,"_MaxTextWidth":116,"_MaxTextHeight":20,"fixedHeight":true,"allowsInput":false,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17636},"textColor":{"__isSmartRef__":true,"id":17634},"owner":{"__isSmartRef__":true,"id":17629},"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":17637}],"padding":{"__isSmartRef__":true,"id":17639},"_Padding":{"__isSmartRef__":true,"id":17640},"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":17641},"_FontFamily":"Helvetica, Sans-Serif","_ClipMode":"visible","_WhiteSpaceHandling":"pre-wrap","_Align":"center","_Scale":1,"renderContextTable":{"__isSmartRef__":true,"id":17642},"__LivelyClassName__":"lively.morphic.Text"},"17631":{"borderWidth":0,"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":17632},"_Extent":{"__isSmartRef__":true,"id":17633},"_BorderColor":{"__isSmartRef__":true,"id":17634},"renderContextTable":{"__isSmartRef__":true,"id":17635},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17632":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17633":{"x":116,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17634":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17635":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setOpacity":"setOpacityHTML"},"17636":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17637":{"style":{"__isSmartRef__":true,"id":17638},"chunkOwner":{"__isSmartRef__":true,"id":17630},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17638":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17639":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17640":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17641":{"x":116,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17642":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17643":{"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":17644},"_Extent":{"__isSmartRef__":true,"id":17645},"_Fill":{"__isSmartRef__":true,"id":17646},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17656},"_BorderRadius":5,"renderContextTable":{"__isSmartRef__":true,"id":17657},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17644":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17645":{"x":116,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17646":{"stops":[{"__isSmartRef__":true,"id":17647},{"__isSmartRef__":true,"id":17649},{"__isSmartRef__":true,"id":17651},{"__isSmartRef__":true,"id":17653}],"vector":{"__isSmartRef__":true,"id":17655},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17647":{"offset":0,"color":{"__isSmartRef__":true,"id":17648}},"17648":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17649":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17650}},"17650":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17651":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17652}},"17652":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17653":{"offset":1,"color":{"__isSmartRef__":true,"id":17654}},"17654":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17655":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17656":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17657":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setOpacity":"setOpacityHTML"},"17658":{"x":215,"y":35,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17659":{"stops":[{"__isSmartRef__":true,"id":17660},{"__isSmartRef__":true,"id":17662},{"__isSmartRef__":true,"id":17664},{"__isSmartRef__":true,"id":17666}],"vector":{"__isSmartRef__":true,"id":17655},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"17660":{"offset":0,"color":{"__isSmartRef__":true,"id":17661}},"17661":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17662":{"offset":0.4,"color":{"__isSmartRef__":true,"id":17663}},"17663":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17664":{"offset":0.6,"color":{"__isSmartRef__":true,"id":17665}},"17665":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17666":{"offset":1,"color":{"__isSmartRef__":true,"id":17667}},"17667":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17668":{"sourceObj":{"__isSmartRef__":true,"id":17629},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16949},"targetMethodName":"chooseTargetMorphMenu","__SourceModuleName__":"Global.lively.bindings","converter":null,"converterString":null,"updater":null,"updaterString":null,"__LivelyClassName__":"AttributeConnection"},"17669":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17670":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"comment":"Simple button. Connect to 'fire' to trigger actions when the button is pressed.","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17671":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML"},"17672":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","setOrigin":"setOriginHTML","setClipMode":"setClipModeHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML"},"17673":{"x":715.5,"y":73.89999999999998,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17674":{"submorphs":[],"scripts":[],"id":435,"shape":{"__isSmartRef__":true,"id":17675},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":true,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":17682},"_MaxTextWidth":218,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":17683},"showsHalos":false,"_FontSize":12,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"ObjectEditorMorphSelector","partsBinMetaInfo":{"__isSmartRef__":true,"id":17684},"textChunks":[{"__isSmartRef__":true,"id":17685}],"charsReplaced":"","lastFindLoc":5,"priorSelectionRange":[15,15],"prevScroll":[0,0],"_ClipMode":"visible","list":[],"attributeConnections":[{"__isSmartRef__":true,"id":17687}],"doNotSerialize":["$$savedTextString"],"doNotCopyProperties":["$$savedTextString"],"listMorph":null,"_WhiteSpaceHandling":"pre-wrap","owner":null,"priorExtent":{"__isSmartRef__":true,"id":17689},"_Align":"left","renderContextTable":{"__isSmartRef__":true,"id":17690},"eventHandler":{"__isSmartRef__":true,"id":17691},"_MinTextWidth":218,"_MinTextHeight":null,"scriptAnnotations":{"__isSmartRef__":true,"id":17692},"selection":{"__isSmartRef__":true,"id":16930},"previousSelection":[0,13],"isCopyMorphRef":true,"morphRefId":1,"isBeingDragged":false,"draggingEnabled":false,"layout":{"__isSmartRef__":true,"id":17711},"_Rotation":0,"_Scale":1,"distanceToDragEvent":{"__isSmartRef__":true,"id":17712},"savedTextString":"100","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17713},"__LivelyClassName__":"lively.morphic.Text"},"17675":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":17676},"_Extent":{"__isSmartRef__":true,"id":17677},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":17678},"renderContextTable":{"__isSmartRef__":true,"id":17679},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":17680},"_BorderRadius":3.7000000000000006,"_Opacity":1,"_BorderStyle":"solid","_Fill":{"__isSmartRef__":true,"id":17681},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"17676":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17677":{"x":220,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17678":{"r":0.753,"g":0.753,"b":0.753,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17679":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"17680":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"17681":{"r":0.9548430751559654,"g":0.9548430751559654,"b":0.9548430751559654,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17682":{"x":200,"y":10,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17683":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"17684":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"17685":{"style":{"__isSmartRef__":true,"id":17686},"chunkOwner":{"__isSmartRef__":true,"id":17674},"storedString":"","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"17686":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"17687":{"sourceObj":{"__isSmartRef__":true,"id":17674},"sourceAttrName":"savedTextString","targetObj":{"__isSmartRef__":true,"id":16931},"targetMethodName":"setTarget","converter":null,"converterString":"function (name) { return $world.get(name)}","updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":17688},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"17688":{"source":{"__isSmartRef__":true,"id":17674},"target":{"__isSmartRef__":true,"id":16931}},"17689":{"x":220,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17690":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"17691":{"morph":{"__isSmartRef__":true,"id":17674},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17692":{"createListMorph":{"__isSmartRef__":true,"id":17693},"displayTopLevelMorphs":{"__isSmartRef__":true,"id":17695},"onMouseUp":{"__isSmartRef__":true,"id":17697},"resetConnections":{"__isSmartRef__":true,"id":17699},"setTargetToListSelection":{"__isSmartRef__":true,"id":17701},"setTargetOfPane":{"__isSmartRef__":true,"id":17703},"onBlur":{"__isSmartRef__":true,"id":17705},"reset":{"__isSmartRef__":true,"id":17707},"onMouseDown":{"__isSmartRef__":true,"id":17709}},"17693":{"time":{"__isSmartRef__":true,"id":17694},"user":"lauritz"},"17694":{"isSerializedDate":true,"string":"Fri Oct 28 2011 05:27:29 GMT+0200 (CEST)"},"17695":{"time":{"__isSmartRef__":true,"id":17696},"user":"lauritz"},"17696":{"isSerializedDate":true,"string":"Fri Oct 14 2011 23:48:37 GMT+0200 (CEST)"},"17697":{"time":{"__isSmartRef__":true,"id":17698},"user":"lauritz"},"17698":{"isSerializedDate":true,"string":"Mon Oct 03 2011 18:51:14 GMT+0200 (CEST)"},"17699":{"time":{"__isSmartRef__":true,"id":17700},"user":"lauritz"},"17700":{"isSerializedDate":true,"string":"Wed Sep 28 2011 01:03:17 GMT+0200 (CEST)"},"17701":{"time":{"__isSmartRef__":true,"id":17702},"user":"lauritz"},"17702":{"isSerializedDate":true,"string":"Sat Oct 15 2011 00:00:58 GMT+0200 (CEST)"},"17703":{"time":{"__isSmartRef__":true,"id":17704},"user":"lauritz"},"17704":{"isSerializedDate":true,"string":"Mon Oct 03 2011 18:34:37 GMT+0200 (CEST)"},"17705":{"time":{"__isSmartRef__":true,"id":17706},"user":"lauritz"},"17706":{"isSerializedDate":true,"string":"Fri Oct 07 2011 19:24:18 GMT+0200 (CEST)"},"17707":{"time":{"__isSmartRef__":true,"id":17708},"user":"lauritz"},"17708":{"isSerializedDate":true,"string":"Fri Oct 07 2011 19:26:15 GMT+0200 (CEST)"},"17709":{"time":{"__isSmartRef__":true,"id":17710},"user":"lauritz"},"17710":{"isSerializedDate":true,"string":"Mon Oct 17 2011 19:49:00 GMT+0200 (CEST)"},"17711":{},"17712":{"x":153.8540395186758,"y":-23.74126935194758,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"17713":{"getList":{"__isSmartRef__":true,"id":17714},"setList":{"__isSmartRef__":true,"id":17717},"reset":{"__isSmartRef__":true,"id":17720},"example":{"__isSmartRef__":true,"id":17723},"removeList":{"__isSmartRef__":true,"id":17726},"onBlur":{"__isSmartRef__":true,"id":17729},"createListMorph":{"__isSmartRef__":true,"id":17736},"resetConnections":{"__isSmartRef__":true,"id":17739},"displayTopLevelMorphs":{"__isSmartRef__":true,"id":17742},"setTargetToListSelection":{"__isSmartRef__":true,"id":17745},"setTargetOfPane":{"__isSmartRef__":true,"id":17748},"onMouseDown":{"__isSmartRef__":true,"id":17751}},"17714":{"varMapping":{"__isSmartRef__":true,"id":17715},"source":"function getList() {\n return this.world().indentedListItemsOfMorphNames();\n}","funcProperties":{"__isSmartRef__":true,"id":17716},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17715":{"this":{"__isSmartRef__":true,"id":17674}},"17716":{},"17717":{"varMapping":{"__isSmartRef__":true,"id":17718},"source":"function setList(list) {\n return this.list = list;\n}","funcProperties":{"__isSmartRef__":true,"id":17719},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17718":{"this":{"__isSmartRef__":true,"id":17674}},"17719":{},"17720":{"varMapping":{"__isSmartRef__":true,"id":17721},"source":"function reset() {\n this.list = [];\n this.textString = 'empty';\n this.removeList();\n this.resetConnections();\n this.applyStyle({fixedWidth: true, fixedHeight: true, borderWidth: 1, overflow: 'visible'})\n}","funcProperties":{"__isSmartRef__":true,"id":17722},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17721":{"this":{"__isSmartRef__":true,"id":17674}},"17722":{},"17723":{"varMapping":{"__isSmartRef__":true,"id":17724},"source":"function example() {\n/*\nthis.example()\nthis.getList()\n*/\n this.setList(Array.range(0,100));\n this.textString = 'empty';\n}","funcProperties":{"__isSmartRef__":true,"id":17725},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17724":{"this":{"__isSmartRef__":true,"id":17674}},"17725":{},"17726":{"varMapping":{"__isSmartRef__":true,"id":17727},"source":"function removeList() {\n this.listMorph && this.listMorph.remove()\n this.listMorph = null;\n}","funcProperties":{"__isSmartRef__":true,"id":17728},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17727":{"this":{"__isSmartRef__":true,"id":17674}},"17728":{},"17729":{"varMapping":{"__isSmartRef__":true,"id":17730},"source":"function onBlur() {\n $super();\n this.removeList();\n}","funcProperties":{"__isSmartRef__":true,"id":17735},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17730":{"this":{"__isSmartRef__":true,"id":17674},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17731}},"17731":{"$super":{"__isSmartRef__":true,"id":17732}},"17732":{"varMapping":{"__isSmartRef__":true,"id":17733},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":17734},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17733":{"obj":{"__isSmartRef__":true,"id":17674},"name":"onBlur"},"17734":{},"17735":{},"17736":{"varMapping":{"__isSmartRef__":true,"id":17737},"source":"function createListMorph() {\n var list = new lively.morphic.List(new Rectangle(0,0, this.getExtent().x, 520));\n list.setList(this.getList());\n list.setFontSize(12);\n\n list.disableGrabbing();\n list.disableDragging();\n \n this.addMorph(list);\n list.setPosition(pt(0,0));\n\n connect(list, 'selection', this, 'setTargetToListSelection');\n \n return list;\n}","funcProperties":{"__isSmartRef__":true,"id":17738},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17737":{"this":{"__isSmartRef__":true,"id":17674}},"17738":{},"17739":{"varMapping":{"__isSmartRef__":true,"id":17740},"source":"function resetConnections() {\n disconnectAll(this);\n connect(this, 'savedTextString', this.owner, 'setTarget', {converter: \n\tfunction (name) { return $world.get(name)}});\n}","funcProperties":{"__isSmartRef__":true,"id":17741},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17740":{"this":{"__isSmartRef__":true,"id":17674}},"17741":{},"17742":{"varMapping":{"__isSmartRef__":true,"id":17743},"source":"function displayTopLevelMorphs() {\n if (this.listMorph) { this.removeList(); return true }\n var list = this.createListMorph(); \n this.addMorph(list);\n this.listMorph = list;\n}","funcProperties":{"__isSmartRef__":true,"id":17744},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17743":{"this":{"__isSmartRef__":true,"id":17674}},"17744":{},"17745":{"varMapping":{"__isSmartRef__":true,"id":17746},"source":"function setTargetToListSelection(selection) { \n this.removeList();\n if (!selection) return;\n if (this.owner.scriptPane.hasChanged()) {\n var that = this;\n var callback = function (confirmed) {\n if (confirmed) that.setTargetOfPane(selection);\n }\n this.owner.confirmUnsavedChanges(callback);\n } else {\n this.setTargetOfPane(selection);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17747},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17746":{"this":{"__isSmartRef__":true,"id":17674}},"17747":{},"17748":{"varMapping":{"__isSmartRef__":true,"id":17749},"source":"function setTargetOfPane(selection) {\n this.owner.setTarget(selection);\n this.setTextString(selection.getName());\n this.removeList();\n}","funcProperties":{"__isSmartRef__":true,"id":17750},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17749":{"this":{"__isSmartRef__":true,"id":17674}},"17750":{},"17751":{"varMapping":{"__isSmartRef__":true,"id":17752},"source":"function onMouseDown(evt) {\n if (evt.isCommandKey() || evt.isRightMouseButtonDown()) return $super(evt);\n if (this.listMorph) {\n return false;\n } else {\n this.displayTopLevelMorphs();\n return true;\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17757},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17752":{"this":{"__isSmartRef__":true,"id":17674},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":17753}},"17753":{"$super":{"__isSmartRef__":true,"id":17754}},"17754":{"varMapping":{"__isSmartRef__":true,"id":17755},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":17756},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17755":{"obj":{"__isSmartRef__":true,"id":17674},"name":"onMouseDown"},"17756":{},"17757":{},"17758":{"morph":{"__isSmartRef__":true,"id":16949},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"17759":{"sortedScriptNamesOfObj":{"__isSmartRef__":true,"id":17760},"setTarget":{"__isSmartRef__":true,"id":17763},"generateSourceForScript":{"__isSmartRef__":true,"id":17766},"generateSourceForConnection":{"__isSmartRef__":true,"id":17769},"generateTargetCode":{"__isSmartRef__":true,"id":17772},"sortedConnectionNamesOfObj":{"__isSmartRef__":true,"id":17775},"displayJavaScriptSource":{"__isSmartRef__":true,"id":17778},"displaySourceForScript":{"__isSmartRef__":true,"id":17781},"displaySourceForConnection":{"__isSmartRef__":true,"id":17784},"newScript":{"__isSmartRef__":true,"id":17787},"newConnection":{"__isSmartRef__":true,"id":17790},"deleteSelectedScript":{"__isSmartRef__":true,"id":17793},"disconnectConnection":{"__isSmartRef__":true,"id":17796},"updateLists":{"__isSmartRef__":true,"id":17799},"displayInitialScript":{"__isSmartRef__":true,"id":17802},"reset":{"__isSmartRef__":true,"id":17805},"selectChangedContent":{"__isSmartRef__":true,"id":17808}},"17760":{"varMapping":{"__isSmartRef__":true,"id":17761},"source":"function sortedScriptNamesOfObj(obj) {\n if (!Functions.own(obj) || Functions.own(obj).size() == 0) return [];\n return Functions.own(obj)\n\t.select(function(name) { return obj[name].hasLivelyClosure })\n\t.sortBy(function(name) { return name.toLowerCase() });\n}","funcProperties":{"__isSmartRef__":true,"id":17762},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17761":{"this":{"__isSmartRef__":true,"id":16949}},"17762":{},"17763":{"varMapping":{"__isSmartRef__":true,"id":17764},"source":"function setTarget(morph) {\n this.reset();\n module('lively.ide.SyntaxHighlighting').load(true);\n this.target = morph;\n this.morphSelector.textString = (this.target.getName() || this.target.toString());\n this.scriptPane.doitContext = this.target;\n this.updateLists();\n this.displayInitialScript();\n}","funcProperties":{"__isSmartRef__":true,"id":17765},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17764":{"this":{"__isSmartRef__":true,"id":16949}},"17765":{},"17766":{"varMapping":{"__isSmartRef__":true,"id":17767},"source":"function generateSourceForScript(scriptName) {\n var script = this.target[scriptName].getOriginal();\n return Strings.format('this.addScript(%s);' ,script)\n}","funcProperties":{"__isSmartRef__":true,"id":17768},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17767":{"this":{"__isSmartRef__":true,"id":16949}},"17768":{},"17769":{"varMapping":{"__isSmartRef__":true,"id":17770},"source":"function generateSourceForConnection(connection) {\n var c = connection, targetObject = this.target;\n\tif (!c.getTargetObj() || !c.getTargetObj().name || \n\t\t!c.getSourceObj() || !c.getSourceObj().name) return String(c);\n\n\tvar optConfig = []\n\tif (c.converterString)\n\t\toptConfig.push(\"converter: \\n\\t\" + c.converterString)\n\tif (c.updaterString)\n\t\toptConfig.push(\"updater: \\n\\t\" + c.updaterString)\n\treturn Strings.format('connect(%s, \"%s\", %s, \"%s\", {%s});', \n\t\t\tthis.generateTargetCode(targetObject, c.getSourceObj()),\n\t\t\tc.getSourceAttrName(),\n\t\t\tthis.generateTargetCode(targetObject, c.getTargetObj()),\n\t\t\tc.getTargetMethodName(),\n\t\t\toptConfig.join(','));\n\n}","funcProperties":{"__isSmartRef__":true,"id":17771},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17770":{"this":{"__isSmartRef__":true,"id":16949}},"17771":{},"17772":{"varMapping":{"__isSmartRef__":true,"id":17773},"source":"function generateTargetCode(baseObject, targetObject) {\n\tvar name = targetObject.name;\n\tif (baseObject === targetObject) \n\t\treturn \"this\";\n\telse if (baseObject[name] === targetObject) \n\t\treturn \"this.\" + name;\n\telse if (baseObject.testObject === targetObject) \n\t\treturn \"this.testObject\";\n\telse if (baseObject.get(name) === targetObject) \n\t\treturn 'this.get(\"' + name + '\")';\n\telse if (targetObject instanceof Morph) \n\t\treturn '$morph(\"' + name + '\")';\n\telse \n\t\treturn \"????\";\n}","funcProperties":{"__isSmartRef__":true,"id":17774},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17773":{"this":{"__isSmartRef__":true,"id":16949}},"17774":{},"17775":{"varMapping":{"__isSmartRef__":true,"id":17776},"source":"function sortedConnectionNamesOfObj(obj) {\n if (\"attributeConnections\" in obj) {\n return obj.attributeConnections\n .sortBy(function(each) {return name.toLowerCase() })\n .collect(function(each) {return [each.getSourceAttrName(), each]});\n } else {\n return [];\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17777},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17776":{"this":{"__isSmartRef__":true,"id":16949}},"17777":{},"17778":{"varMapping":{"__isSmartRef__":true,"id":17779},"source":"function displayJavaScriptSource(jsCode) {\n this.scriptPane.setTextString(jsCode);\n this.scriptPane.highlightJavaScriptSyntax();\n}","funcProperties":{"__isSmartRef__":true,"id":17780},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17779":{"this":{"__isSmartRef__":true,"id":16949}},"17780":{},"17781":{"varMapping":{"__isSmartRef__":true,"id":17782},"source":"function displaySourceForScript(scriptName) {\n if (!scriptName) return;\n var code = \"\", that = this;\n if (scriptName === \"-- ALL --\") {\n this.sortedScriptNamesOfObj(this.target).forEach(function(each) {\n code = code.concat(that.generateSourceForScript(each)).concat(\"\\n\\n\");\n });\n } else {\n code = this.generateSourceForScript(scriptName); \n }\n this.displayJavaScriptSource(code);\n}","funcProperties":{"__isSmartRef__":true,"id":17783},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17782":{"this":{"__isSmartRef__":true,"id":16949}},"17783":{},"17784":{"varMapping":{"__isSmartRef__":true,"id":17785},"source":"function displaySourceForConnection(connection) {\n if (!connection) return;\n var code = \"\", that = this;\n if ((typeof connection === \"string\") && connection === \"-- ALL --\") {\n this.sortedConnectionNamesOfObj(this.target).forEach(function(each) {\n code = code.concat(that.generateSourceForConnection(each[1])).concat(\"\\n\\n\");\n })\n } else {\n code = this.generateSourceForConnection(connection);\n }\n this.displayJavaScriptSource(code);\n}","funcProperties":{"__isSmartRef__":true,"id":17786},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17785":{"this":{"__isSmartRef__":true,"id":16949}},"17786":{},"17787":{"varMapping":{"__isSmartRef__":true,"id":17788},"source":"function newScript() {\n if (this.target) {\n var code = \"this.addScript(function SCRIPTNAME() {\\n\\t\\n});\";\n this.displayJavaScriptSource(code);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17789},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17788":{"this":{"__isSmartRef__":true,"id":16949}},"17789":{},"17790":{"varMapping":{"__isSmartRef__":true,"id":17791},"source":"function newConnection() {\n if (this.target) {\n var code = \"connect(SOURCE, SOURCE_PROPERTY, TARGET, TARGET_PROPERTY);\";\n this.displayJavaScriptSource(code);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17792},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17791":{"this":{"__isSmartRef__":true,"id":16949}},"17792":{},"17793":{"varMapping":{"__isSmartRef__":true,"id":17794},"source":"function deleteSelectedScript() {\n if (this.scriptList.selection && this.target) {\n if (!this.target.hasOwnProperty(this.scriptList.selection)) return;\n delete this.target[this.scriptList.selection];\n this.updateLists();\n this.displayInitialScript();\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17795},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17794":{"this":{"__isSmartRef__":true,"id":16949}},"17795":{},"17796":{"varMapping":{"__isSmartRef__":true,"id":17797},"source":"function disconnectConnection() {\n var selection = this.connectionList.selection;\n if (selection && \n (typeof selection !== \"string\") &&\n this.target.attributeConnections.indexOf(selection[1]) > -1) {\n var c = this.connectionList.selection[1];\n disconnect(c.sourceObj, c.sourceAttrName, c.targetObj, c.targetMethodName);\n this.updateLists();\n this.displayInitialScript();\n } \n}","funcProperties":{"__isSmartRef__":true,"id":17798},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17797":{"this":{"__isSmartRef__":true,"id":16949}},"17798":{},"17799":{"varMapping":{"__isSmartRef__":true,"id":17800},"source":"function updateLists() {\n this.scriptList.setList(this.sortedScriptNamesOfObj(this.target));\n var scriptListItems = this.scriptList.getList();\n scriptListItems.unshift(\"-- ALL --\");\n this.scriptList.setList(scriptListItems);\n\n this.connectionList.setList(this.sortedConnectionNamesOfObj(this.target));\n var connectionListItems = this.connectionList.getList();\n connectionListItems.unshift(\"-- ALL --\");\n this.connectionList.setList(connectionListItems);\n}","funcProperties":{"__isSmartRef__":true,"id":17801},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17800":{"this":{"__isSmartRef__":true,"id":16949}},"17801":{},"17802":{"varMapping":{"__isSmartRef__":true,"id":17803},"source":"function displayInitialScript() {\n if (this.scriptList.getList().size() > 1) {\n this.scriptList.selectAt(0);\n } else if (this.connectionList.getList().size() > 1) {\n this.connectionList.selectAt(0);\n } else {\n this.scriptList.selectAt(0);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":17804},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17803":{"this":{"__isSmartRef__":true,"id":16949}},"17804":{},"17805":{"varMapping":{"__isSmartRef__":true,"id":17806},"source":"function reset() {\n this.target = null;\n this.scriptPane.doitContext = null;\n this.scriptList.setList();\n this.connectionList.setList();\n this.scriptPane.setTextString(\"\");\n this.morphSelector.reset();\n}","funcProperties":{"__isSmartRef__":true,"id":17807},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"17806":{"this":{"__isSmartRef__":true,"id":16949}},"17807":{},"17808":{"varMapping":{"__isSmartRef__":true,"id":17809},"source":"function selectChangedContent(source) {\n\n var addScriptRegex = /this\\.addScript\\s*\\(\\s*function\\s*([^\\(]*)/g;\n var addScriptMatches = [];\n var addScriptMatch = addScriptRegex.exec(source);\n while (addScriptMatch) {\n addScriptMatches.push(addScriptMatch[1]);\n addScriptMatch = addScriptRegex.exec(source);\n }\n \n // if scripts were added, select either a specific one or all\n if (addScriptMatches.length > 0) { \n if (addScriptMatches.length === 1) {\n var index = this.scriptList.getList().indexOf(addScriptMatches[0]);\n if (index > -1) { \n return this.scriptList.selectAt(index);\n }\n }\n return this.scriptList.selectAt(0);\n }\n\n var connectionRegex = \n /connect\\(\\s*([^,]*)\\s*,\\s*\"([^,]*)\"\\s*,\\s*([^,]*)\\s*,\\s*\"([^,]*)\"/g;\n var connectionMatches = [];\n var connectionMatch = connectionRegex.exec(source);\n while (connectionMatch) {\n connectionMatches.push(connectionMatch);\n connectionMatch = connectionRegex.exec(source);\n }\n\n // if connections were made, select either a specific one or all\n if (connectionMatches.length > 0) {\n if (connectionMatches.length === 1) {\n var match = connectionMatches[0];\n for (var i=0; i -1) {\n var c = selection[1];\n disconnect(c.sourceObj, c.sourceAttrName, c.targetObj, c.targetMethodName);\n editor.updateLists();\n editor.displayInitialScript();\n } \n }\n\n var message = 'Disconnect \"' + selection[0] +'\" connection?';\n var callback = disconnectConnection;\n\n var dialog = new lively.morphic.ConfirmDialog(message, callback);\n\n return this.world().openDialog(dialog);\n}","funcProperties":{"__isSmartRef__":true,"id":18008},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18007":{"this":{"__isSmartRef__":true,"id":17954}},"18008":{"timestamp":{"__isSmartRef__":true,"id":18009},"user":"lauritz","categories":[]},"18009":{"isSerializedDate":true,"string":"Fri Nov 11 2011 01:46:54 GMT+0100 (CET)"},"18010":{"submorphs":[{"__isSmartRef__":true,"id":18011}],"scripts":[],"id":"37E036C8-18E8-43E4-A45F-26A583DF88FF","shape":{"__isSmartRef__":true,"id":18026},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18042},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18029},"lighterFill":{"__isSmartRef__":true,"id":18043},"label":{"__isSmartRef__":true,"id":18011},"attributeConnections":[{"__isSmartRef__":true,"id":18052}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","padding":{"__isSmartRef__":true,"id":18054},"name":"ObjectEditorRemoveScriptButton","partsBinMetaInfo":{"__isSmartRef__":true,"id":18055},"renderContextTable":{"__isSmartRef__":true,"id":18056},"priorExtent":{"__isSmartRef__":true,"id":18057},"owner":{"__isSmartRef__":true,"id":16931},"eventHandler":{"__isSmartRef__":true,"id":18058},"isCopyMorphRef":true,"morphRefId":24,"draggingEnabled":false,"objectEditorPane":{"__isSmartRef__":true,"id":16931},"distanceToDragEvent":{"__isSmartRef__":true,"id":18059},"derivationIds":[217,"FDC10087-12CF-4570-9211-8309CB6A9AA3","E18FC530-4B1F-4F08-8DA6-3866A3519E56","04A2AAC3-6A9E-40BB-9408-EBB2567EE63B","8C1A42CE-840C-4AAE-BD79-C93A445B9EBF","61FC11FA-B87E-4EFE-BD15-564D3178B68B","ED34F9B5-9E00-41B3-8313-D9C3D6B3B231","A7481F4B-D444-4B4F-BDA2-4F9F03AEC24D","7DDF7175-34FC-4521-A7C3-580A8BE63351","DEA39C05-FAD7-4882-AB3D-0EE12C3408F9","99186A50-1411-4B6F-B1CB-FF0742C20D7D"],"_ClipMode":"visible","_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18060},"__LivelyClassName__":"lively.morphic.Button"},"18011":{"submorphs":[],"scripts":[],"id":"A5A58451-6AF8-4689-94D3-ECFC87BFBC32","shape":{"__isSmartRef__":true,"id":18012},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":false,"halosEnabled":true,"fixedWidth":true,"_MaxTextWidth":21,"_MaxTextHeight":null,"fixedHeight":true,"allowsInput":false,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18018},"textColor":{"__isSmartRef__":true,"id":18015},"owner":{"__isSmartRef__":true,"id":18010},"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":18019}],"padding":{"__isSmartRef__":true,"id":18021},"_Padding":{"__isSmartRef__":true,"id":18022},"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":18023},"_FontFamily":"Helvetica, Sans-Serif","renderContextTable":{"__isSmartRef__":true,"id":18024},"_ClipMode":"hidden","_WhiteSpaceHandling":"pre-wrap","_Align":"center","eventHandler":{"__isSmartRef__":true,"id":18025},"_HandStyle":"default","_PointerEvents":"none","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_MinTextWidth":21,"_MinTextHeight":null,"draggingEnabled":false,"derivationIds":[218,"852A7BD9-52EE-4708-A2D5-1BDECF33C958","7B4F173E-9726-472A-9B30-530D4AA92AD9","CBA217F6-2832-4213-9ABE-47753C1A4180","E6B97D1D-95D5-4644-9359-1D08D42A51F4","4391A57E-70C2-4628-9828-DD668CCE546E","F0C6C298-3B8B-42B2-B5E9-E5B82F607B01","DF0CAF75-4247-4797-B1A0-AD7444391E2A","B4C4F09B-F663-47A1-B85F-461D5452F5F8","FD966AB1-4685-4151-9A38-B1B21B0237EF","CA91FC2C-D7CC-4123-AFD2-108F8F0C2E97"],"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"18012":{"borderWidth":0,"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18013},"_Extent":{"__isSmartRef__":true,"id":18014},"_BorderColor":{"__isSmartRef__":true,"id":18015},"renderContextTable":{"__isSmartRef__":true,"id":18016},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18017},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18013":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18014":{"x":25,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18015":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18016":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18017":{"x":2,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18018":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18019":{"style":{"__isSmartRef__":true,"id":18020},"chunkOwner":{"__isSmartRef__":true,"id":18011},"storedString":"-","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"18020":{"__SourceModuleName__":"Global.lively.morphic.TextCore","textShadow":"0px 1px 0 rgba(255,255,255,1)","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18021":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18022":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18023":{"x":25,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18024":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18025":{"morph":{"__isSmartRef__":true,"id":18011},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18026":{"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18027},"_Extent":{"__isSmartRef__":true,"id":18028},"_Fill":{"__isSmartRef__":true,"id":18029},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18039},"_BorderRadius":5,"renderContextTable":{"__isSmartRef__":true,"id":18040},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18041},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18027":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18028":{"x":25,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18029":{"stops":[{"__isSmartRef__":true,"id":18030},{"__isSmartRef__":true,"id":18032},{"__isSmartRef__":true,"id":18034},{"__isSmartRef__":true,"id":18036}],"vector":{"__isSmartRef__":true,"id":18038},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18030":{"offset":0,"color":{"__isSmartRef__":true,"id":18031}},"18031":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18032":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18033}},"18033":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18034":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18035}},"18035":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18036":{"offset":1,"color":{"__isSmartRef__":true,"id":18037}},"18037":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18038":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18039":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18040":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18041":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18042":{"x":160,"y":40,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18043":{"stops":[{"__isSmartRef__":true,"id":18044},{"__isSmartRef__":true,"id":18046},{"__isSmartRef__":true,"id":18048},{"__isSmartRef__":true,"id":18050}],"vector":{"__isSmartRef__":true,"id":18038},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18044":{"offset":0,"color":{"__isSmartRef__":true,"id":18045}},"18045":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18046":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18047}},"18047":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18048":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18049}},"18049":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18050":{"offset":1,"color":{"__isSmartRef__":true,"id":18051}},"18051":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18052":{"sourceObj":{"__isSmartRef__":true,"id":18010},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":18010},"targetMethodName":"deleteSelectedScript","converter":null,"converterString":null,"updater":null,"updaterString":null,"varMapping":{"__isSmartRef__":true,"id":18053},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18053":{"source":{"__isSmartRef__":true,"id":18010},"target":{"__isSmartRef__":true,"id":18010}},"18054":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18055":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"comment":"Simple button. Connect to 'fire' to trigger actions when the button is pressed.","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18056":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18057":{"x":30,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18058":{"morph":{"__isSmartRef__":true,"id":18010},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18059":{"x":33.35839679439101,"y":-21.324811622839547,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18060":{"deleteSelectedScript":{"__isSmartRef__":true,"id":18061}},"18061":{"varMapping":{"__isSmartRef__":true,"id":18062},"source":"function deleteSelectedScript() {\n\n var editor = this.objectEditorPane;\n var selection = editor.scriptList.selection;\n\n if (!editor.target || editor.scriptList.getList().size() < 2) \n return; \n\n var deleteScript = function (confirmed) {\n if (!confirmed) return;\n \n if (selection && editor.target) {\n if (!editor.target.hasOwnProperty(selection)) \n return;\n delete editor.target[selection];\n editor.updateLists();\n editor.displayInitialScript();\n }\n }\n\n var message = 'Delete \"' + selection + '\" script?';\n var callback = deleteScript;\n\n var dialog = new lively.morphic.ConfirmDialog(message, callback);\n\n return this.world().openDialog(dialog);\n}","funcProperties":{"__isSmartRef__":true,"id":18063},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18062":{"this":{"__isSmartRef__":true,"id":18010}},"18063":{"timestamp":{"__isSmartRef__":true,"id":18064},"user":"lauritz"},"18064":{"isSerializedDate":true,"string":"Thu Nov 17 2011 18:12:21 GMT+0100 (CET)"},"18065":{"submorphs":[{"__isSmartRef__":true,"id":18066}],"scripts":[],"id":"2DCA661C-32A5-4B85-AA06-669EE11035B1","shape":{"__isSmartRef__":true,"id":18082},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18098},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18085},"lighterFill":{"__isSmartRef__":true,"id":18099},"label":{"__isSmartRef__":true,"id":18066},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","padding":{"__isSmartRef__":true,"id":18108},"name":"ObjectEditorMorphSelector","partsBinMetaInfo":{"__isSmartRef__":true,"id":18109},"list":[],"renderContextTable":{"__isSmartRef__":true,"id":18110},"eventHandler":{"__isSmartRef__":true,"id":18111},"distanceToDragEvent":{"__isSmartRef__":true,"id":18112},"priorExtent":{"__isSmartRef__":true,"id":18113},"owner":{"__isSmartRef__":true,"id":16931},"textString":"","selection":{"__isSmartRef__":true,"id":18114},"_ClipMode":"visible","prevScroll":[0,0],"listMorph":null,"derivationIds":[221,"4AC64FBA-95AC-42B2-A078-B6DA97889093","E26ED0E6-C4CE-4C82-94D5-175270E8459E","D292F2FC-C2B6-48AE-B779-8CC5868FFA49","53A862EB-032C-4BF0-9B21-58C7E0C0A9B2","CC4D188B-510F-48DE-A0E1-EC8D2CD63F9F","0CD057F2-3517-4849-A69E-1EF79B05ACE8","66EBBB7D-8FA7-4D43-AE78-A18DA3B970BA","A50C1893-4138-4E29-865B-92F53F76D08A","1EC5D2B9-3539-419A-8DD6-CE82DEABB02C","95DC06D5-F4C7-49E2-8A01-110D1B0AFBD0"],"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18131},"__LivelyClassName__":"lively.morphic.Button"},"18066":{"submorphs":[],"scripts":[],"id":"2B08A5EB-7C15-4DAA-A367-25A6B78A7016","shape":{"__isSmartRef__":true,"id":18067},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":false,"halosEnabled":true,"fixedWidth":true,"_MaxTextWidth":220,"_MaxTextHeight":null,"fixedHeight":true,"allowsInput":false,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18073},"textColor":{"__isSmartRef__":true,"id":18070},"owner":{"__isSmartRef__":true,"id":18065},"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":18074}],"padding":{"__isSmartRef__":true,"id":18076},"_Padding":{"__isSmartRef__":true,"id":18076},"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":18077},"attributeConnections":[{"__isSmartRef__":true,"id":18078}],"doNotSerialize":["$$savedTextString"],"doNotCopyProperties":["$$savedTextString"],"renderContextTable":{"__isSmartRef__":true,"id":18079},"eventHandler":{"__isSmartRef__":true,"id":18080},"_HandStyle":"default","_PointerEvents":"none","_ClipMode":"hidden","_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":220,"_MinTextHeight":null,"_Align":"left","_FontFamily":"Arial","_FontSize":10,"derivationIds":[222,"30F054A3-7658-405B-8098-B7D87AA8A9ED","556D6E07-45B7-42EC-A486-DE275EF0B034","06B0B080-467A-46CC-8B0D-9C0A9B9A71F1","5E2D96C9-BB9B-4735-8673-A79847435197","B48AA022-2022-4A2A-9090-4D884FB3DFD3","8B2F743A-98C5-45E1-B03C-5019114EAC47","D09C56C3-A2DC-4BDF-B8A1-6365138ECD01","74158C3D-B79E-43E7-B111-48701B10ACE2","B19E117B-E40F-4B9F-86AC-BFB2AAFD5336","4E3B3D72-E52C-44ED-AE32-78939BA1ECFD"],"_TextColor":{"__isSmartRef__":true,"id":18081},"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"18067":{"borderWidth":0,"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18068},"_Extent":{"__isSmartRef__":true,"id":18069},"_BorderColor":{"__isSmartRef__":true,"id":18070},"renderContextTable":{"__isSmartRef__":true,"id":18071},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18072},"_BorderWidth":0,"_Fill":null,"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18068":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18069":{"x":220,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18070":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18071":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18072":{"x":0,"y":3,"width":0,"height":0,"__LivelyClassName__":"Rectangle","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18073":{"x":2,"y":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18074":{"style":{"__isSmartRef__":true,"id":18075},"chunkOwner":{"__isSmartRef__":true,"id":18066},"storedString":"GemBoard","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"18075":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"18076":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18077":{"x":220,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18078":{"sourceObj":{"__isSmartRef__":true,"id":18066},"sourceAttrName":"savedTextString","targetObj":{"__isSmartRef__":true,"id":18065},"targetMethodName":"selection","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18079":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18080":{"morph":{"__isSmartRef__":true,"id":18066},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18081":{"r":0,"g":0,"b":0,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18082":{"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18083},"_Extent":{"__isSmartRef__":true,"id":18084},"_Fill":{"__isSmartRef__":true,"id":18085},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18095},"_BorderRadius":5,"renderContextTable":{"__isSmartRef__":true,"id":18096},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18097},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18083":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18084":{"x":220,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18085":{"stops":[{"__isSmartRef__":true,"id":18086},{"__isSmartRef__":true,"id":18088},{"__isSmartRef__":true,"id":18090},{"__isSmartRef__":true,"id":18092}],"vector":{"__isSmartRef__":true,"id":18094},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18086":{"offset":0,"color":{"__isSmartRef__":true,"id":18087}},"18087":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18088":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18089}},"18089":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18090":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18091}},"18091":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18092":{"offset":1,"color":{"__isSmartRef__":true,"id":18093}},"18093":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18094":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18095":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18096":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18097":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18098":{"x":240.1308656788165,"y":10,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18099":{"stops":[{"__isSmartRef__":true,"id":18100},{"__isSmartRef__":true,"id":18102},{"__isSmartRef__":true,"id":18104},{"__isSmartRef__":true,"id":18106}],"vector":{"__isSmartRef__":true,"id":18094},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18100":{"offset":0,"color":{"__isSmartRef__":true,"id":18101}},"18101":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18102":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18103}},"18103":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18104":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18105}},"18105":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18106":{"offset":1,"color":{"__isSmartRef__":true,"id":18107}},"18107":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18108":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18109":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"partName":"ChoiceButton","comment":"Click on it and you get a list of things to choose from.","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18110":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18111":{"morph":{"__isSmartRef__":true,"id":18065},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18112":{"x":122.93118375058827,"y":-11.582832083333244,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18113":{"x":220,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18114":{"submorphs":[],"scripts":[],"id":181,"shape":{"__isSmartRef__":true,"id":18115},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":true,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18121},"_MaxTextWidth":580,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":18122},"showsHalos":false,"_FontSize":28,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"Title","partsBinMetaInfo":{"__isSmartRef__":true,"id":18123},"_TextColor":{"__isSmartRef__":true,"id":18124},"renderContextTable":{"__isSmartRef__":true,"id":18125},"textChunks":[{"__isSmartRef__":true,"id":18126}],"eventHandler":{"__isSmartRef__":true,"id":18128},"priorExtent":{"__isSmartRef__":true,"id":18129},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_MinTextWidth":580,"_MinTextHeight":null,"_Rotation":0,"_Scale":1.002003004005006,"previousSelection":[35,35],"priorSelectionRange":[23,23],"charsReplaced":"WIP / Proof of Concept","lastFindLoc":22,"distanceToDragEvent":{"__isSmartRef__":true,"id":18130},"_ClipMode":"visible","_WhiteSpaceHandling":"pre-wrap","isCopyMorphRef":true,"morphRefId":2,"prevScroll":[0,0],"__LivelyClassName__":"lively.morphic.Text"},"18115":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18116},"_Extent":{"__isSmartRef__":true,"id":18117},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18118},"renderContextTable":{"__isSmartRef__":true,"id":18119},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18120},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18116":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18117":{"x":580,"y":43,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18118":{"r":1,"g":1,"b":1,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18119":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML"},"18120":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18121":{"x":37,"y":23,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18122":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18123":{"partsSpaceName":"PartsBin/Worlds/","__SourceModuleName__":"Global.lively.PartsBin","comment":"For example a world title.","partName":"Title","migrationLevel":2,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18124":{"r":0,"g":0.309,"b":0.595,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18125":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18126":{"style":{"__isSmartRef__":true,"id":18127},"chunkOwner":{"__isSmartRef__":true,"id":18114},"__SourceModuleName__":"Global.lively.morphic.TextCore","storedString":"","__LivelyClassName__":"lively.morphic.TextChunk"},"18127":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18128":{"morph":{"__isSmartRef__":true,"id":18114},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18129":{"x":580,"y":43,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18130":{"x":221,"y":-12,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18131":{"createListMorph":{"__isSmartRef__":true,"id":18132},"getList":{"__isSmartRef__":true,"id":18136},"removeList":{"__isSmartRef__":true,"id":18140},"reset":{"__isSmartRef__":true,"id":18144},"displayTopLevelMorphs":{"__isSmartRef__":true,"id":18148},"onMouseDown":{"__isSmartRef__":true,"id":18152},"setTargetOfPane":{"__isSmartRef__":true,"id":18160},"setTargetToListSelection":{"__isSmartRef__":true,"id":18164},"onBlur":{"__isSmartRef__":true,"id":18168},"setTarget":{"__isSmartRef__":true,"id":18176},"setTargetOnSelection":{"__isSmartRef__":true,"id":18180}},"18132":{"varMapping":{"__isSmartRef__":true,"id":18133},"source":"function createListMorph() {\n var items = this.getList();\n \n var height = Math.min(this.owner.getExtent().y, items.length * 17);\n var extent = new Rectangle(0, this.getExtent().y, this.getExtent().x, height);\n\n var listMorph = new lively.morphic.List(extent);\n listMorph.setList(items);\n listMorph.setFontSize(10);\n\n listMorph.disableGrabbing();\n listMorph.disableDragging();\n\n connect(listMorph, 'selection', this, 'setTargetToListSelection');\n \n return listMorph;\n}","funcProperties":{"__isSmartRef__":true,"id":18134},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18133":{"this":{"__isSmartRef__":true,"id":18065}},"18134":{"timestamp":{"__isSmartRef__":true,"id":18135},"user":"lauritz","tags":[]},"18135":{"isSerializedDate":true,"string":"Tue Dec 13 2011 18:55:41 GMT+0100 (CET)"},"18136":{"varMapping":{"__isSmartRef__":true,"id":18137},"source":"function getList() {\n var worldEntry = {\n isListItem: true,\n selectionString: 'World',\n string: 'World',\n value: this.world()\n };\n var list = this.world().indentedListItemsOfMorphNames();\n list.unshift(worldEntry);\n return list;\n}","funcProperties":{"__isSmartRef__":true,"id":18138},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18137":{"this":{"__isSmartRef__":true,"id":18065}},"18138":{"timestamp":{"__isSmartRef__":true,"id":18139},"user":"lauritz","tags":[]},"18139":{"isSerializedDate":true,"string":"Mon Nov 21 2011 23:12:23 GMT+0100 (CET)"},"18140":{"varMapping":{"__isSmartRef__":true,"id":18141},"source":"function removeList() {\n this.listMorph && this.listMorph.remove();\n this.listMorph = null;\n}","funcProperties":{"__isSmartRef__":true,"id":18142},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18141":{"this":{"__isSmartRef__":true,"id":18065}},"18142":{"timestamp":{"__isSmartRef__":true,"id":18143},"user":"lauritz","tags":[]},"18143":{"isSerializedDate":true,"string":"Wed Dec 07 2011 05:51:07 GMT+0100 (CET)"},"18144":{"varMapping":{"__isSmartRef__":true,"id":18145},"source":"function reset() {\n this.list = [];\n this.setLabel('empty');\n this.label.setAlign('left');\n this.removeList();\n this.applyStyle({fixedWidth: true, fixedHeight: true, borderWidth: 1, overflow: 'visible'});\n}","funcProperties":{"__isSmartRef__":true,"id":18146},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18145":{"this":{"__isSmartRef__":true,"id":18065}},"18146":{"timestamp":{"__isSmartRef__":true,"id":18147},"user":"lauritz","tags":[]},"18147":{"isSerializedDate":true,"string":"Wed Dec 07 2011 05:34:06 GMT+0100 (CET)"},"18148":{"varMapping":{"__isSmartRef__":true,"id":18149},"source":"function displayTopLevelMorphs() {\n var list = this.createListMorph(); \n if (this.getList().length === 0) return;\n this.addMorph(list);\n this.listMorph = list;\n}","funcProperties":{"__isSmartRef__":true,"id":18150},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18149":{"this":{"__isSmartRef__":true,"id":18065}},"18150":{"timestamp":{"__isSmartRef__":true,"id":18151},"user":"lauritz","tags":[]},"18151":{"isSerializedDate":true,"string":"Tue Dec 13 2011 18:53:20 GMT+0100 (CET)"},"18152":{"varMapping":{"__isSmartRef__":true,"id":18153},"source":"function onMouseDown(evt) {\n if (evt.isCommandKey() || evt.isRightMouseButtonDown()) return $super(evt);\n if (this.listMorph) {\n // clicked on morph, not the list, not the list's scrollbar\n if (evt.target === this.renderContext().shapeNode)\n this.removeList();\n } else {\n this.displayTopLevelMorphs();\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18158},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18153":{"this":{"__isSmartRef__":true,"id":18065},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18154}},"18154":{"$super":{"__isSmartRef__":true,"id":18155}},"18155":{"varMapping":{"__isSmartRef__":true,"id":18156},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18157},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18156":{"obj":{"__isSmartRef__":true,"id":18065},"name":"onMouseDown"},"18157":{},"18158":{"timestamp":{"__isSmartRef__":true,"id":18159},"user":"lauritz","tags":[]},"18159":{"isSerializedDate":true,"string":"Wed Dec 07 2011 05:30:39 GMT+0100 (CET)"},"18160":{"varMapping":{"__isSmartRef__":true,"id":18161},"source":"function setTargetOfPane(selection) {\n this.owner.setTarget(selection);\n this.label.setAlign('left');\n}","funcProperties":{"__isSmartRef__":true,"id":18162},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18161":{"this":{"__isSmartRef__":true,"id":18065}},"18162":{"timestamp":{"__isSmartRef__":true,"id":18163},"user":"lauritz","tags":[]},"18163":{"isSerializedDate":true,"string":"Wed Dec 07 2011 04:30:42 GMT+0100 (CET)"},"18164":{"varMapping":{"__isSmartRef__":true,"id":18165},"source":"function setTargetToListSelection() { \n var selection = this.listMorph.selection;\n this.removeList();\n if (!selection) return;\n if (this.owner.scriptPane.hasChanged()) {\n var that = this;\n var callback = function (confirmed) {\n if (confirmed) that.setTargetOfPane(selection);\n }\n this.owner.confirmUnsavedChanges(callback);\n } else {\n this.setTargetOfPane(selection);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18166},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18165":{"this":{"__isSmartRef__":true,"id":18065}},"18166":{"timestamp":{"__isSmartRef__":true,"id":18167},"user":"lauritz","tags":[]},"18167":{"isSerializedDate":true,"string":"Wed Dec 07 2011 06:06:48 GMT+0100 (CET)"},"18168":{"varMapping":{"__isSmartRef__":true,"id":18169},"source":"function onBlur(evt) {\n $super(evt);\n \n // workaround - otherwise other morphs get this event\n var clickedMorph = evt && evt.world && evt.world.clickedOnMorph;\n if (clickedMorph && (clickedMorph !== this && clickedMorph !== this.listMorph)) {\n this.removeList();\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18174},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18169":{"this":{"__isSmartRef__":true,"id":18065},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18170}},"18170":{"$super":{"__isSmartRef__":true,"id":18171}},"18171":{"varMapping":{"__isSmartRef__":true,"id":18172},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18173},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18172":{"obj":{"__isSmartRef__":true,"id":18065},"name":"onBlur"},"18173":{},"18174":{"timestamp":{"__isSmartRef__":true,"id":18175},"user":"lauritz","tags":[]},"18175":{"isSerializedDate":true,"string":"Wed Dec 07 2011 05:30:08 GMT+0100 (CET)"},"18176":{"varMapping":{"__isSmartRef__":true,"id":18177},"source":"function setTarget(target) {\n this.label.setTextString(target.getName() || target.toString());\n}","funcProperties":{"__isSmartRef__":true,"id":18178},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18177":{"this":{"__isSmartRef__":true,"id":18065}},"18178":{"timestamp":{"__isSmartRef__":true,"id":18179},"user":"lauritz","tags":[]},"18179":{"isSerializedDate":true,"string":"Wed Dec 07 2011 04:29:39 GMT+0100 (CET)"},"18180":{"varMapping":{"__isSmartRef__":true,"id":18181},"source":"function setTargetOnSelection() {\n if (this.listMorph && this.listMorph.renderContext() && this.listMorph.renderContext().listNode.value) {\n this.setTargetToListSelection();\n this.stopStepping();\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18182},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18181":{"this":{"__isSmartRef__":true,"id":18065}},"18182":{"timestamp":{"__isSmartRef__":true,"id":18183},"user":"lauritz","tags":[]},"18183":{"isSerializedDate":true,"string":"Wed Dec 07 2011 06:12:06 GMT+0100 (CET)"},"18184":{"submorphs":[],"scripts":[],"id":"496D19C8-254E-4905-8FEE-658DA87622CB","shape":{"__isSmartRef__":true,"id":18185},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":false,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18191},"_MaxTextWidth":64.8979476392384,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":18188},"showsHalos":false,"_FontSize":9,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"ObjectEditorScriptsText1","partsBinMetaInfo":{"__isSmartRef__":true,"id":18192},"textChunks":[{"__isSmartRef__":true,"id":18193}],"charsReplaced":"Scripts","lastFindLoc":-7,"priorSelectionRange":[0,7],"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":18195},"renderContextTable":{"__isSmartRef__":true,"id":18196},"eventHandler":{"__isSmartRef__":true,"id":18197},"_WhiteSpaceHandling":"pre-wrap","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_MinTextWidth":64.8979476392384,"_MinTextHeight":null,"_ClipMode":"visible","draggingEnabled":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":18198},"eventsAreIgnored":true,"owner":{"__isSmartRef__":true,"id":16931},"isCopyMorphRef":true,"morphRefId":27,"derivationIds":[223,"5E3A69EF-26C1-4D0D-B04C-8C3894017F56","14AB1B91-3ED6-49AE-AA58-47D18B6C569F","991D4A54-1FC4-4BC7-AA82-F814AC52CDE3","DB9B19F7-4390-4CE5-9B1D-62177CB8D605","8F7B2EE9-9538-4044-B75B-6A12F3108B70","4B9F9B4B-C7D3-418D-9AC9-10503A4EBF8E","324EE422-8C94-43CE-B964-A3150830C25F","36D1ECF9-591F-426B-A4F6-B337D7DB053B","CB52849C-BE64-4053-8D07-758F969F84EB","F1C241D4-A689-4DB7-942F-ADB5F39D9CAA"],"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"18185":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18186},"_Extent":{"__isSmartRef__":true,"id":18187},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18188},"renderContextTable":{"__isSmartRef__":true,"id":18189},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18190},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18186":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18187":{"x":64.8979476392384,"y":14,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18188":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18189":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18190":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18191":{"x":198.16434648623274,"y":12.911539589748486,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18192":{"partsSpaceName":"PartsBin/NewWorld","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":1,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18193":{"style":{"__isSmartRef__":true,"id":18194},"chunkOwner":{"__isSmartRef__":true,"id":18184},"__SourceModuleName__":"Global.lively.morphic.TextCore","storedString":"Target:","__LivelyClassName__":"lively.morphic.TextChunk"},"18194":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18195":{"x":64.8979476392384,"y":14,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18196":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18197":{"morph":{"__isSmartRef__":true,"id":18184},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18198":{"x":41.065989525935834,"y":-10.506047005169194,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18199":{"submorphs":[],"scripts":[],"id":"3C1C2EC6-AEB3-449A-AB46-ED6A742C8B66","shape":{"__isSmartRef__":true,"id":18200},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":false,"allowsInput":false,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18206},"_MaxTextWidth":64.8979476392384,"_MaxTextHeight":null,"textColor":{"__isSmartRef__":true,"id":18203},"showsHalos":false,"_FontSize":9,"__SourceModuleName__":"Global.lively.morphic.TextCore","name":"ObjectEditorScriptsText2","partsBinMetaInfo":{"__isSmartRef__":true,"id":18207},"textChunks":[{"__isSmartRef__":true,"id":18208}],"charsReplaced":"Scripts","lastFindLoc":-7,"priorSelectionRange":[0,7],"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":18210},"renderContextTable":{"__isSmartRef__":true,"id":18211},"eventHandler":{"__isSmartRef__":true,"id":18212},"_WhiteSpaceHandling":"pre-wrap","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"_MinTextWidth":64.8979476392384,"_MinTextHeight":null,"_ClipMode":"visible","draggingEnabled":false,"distanceToDragEvent":{"__isSmartRef__":true,"id":18213},"eventsAreIgnored":true,"isCopyMorphRef":true,"morphRefId":27,"owner":{"__isSmartRef__":true,"id":16931},"derivationIds":[224,"35EF8FE5-067D-45B6-AF21-77040F11D340","80DC09DD-22D4-4089-B5C3-857B32C9BE9B","EF080074-E6B9-47F3-A87F-26313B40C430","F6977801-C1A7-445C-9BF1-8A1019E202FB","8C9157AE-0343-4CFB-8186-1D5E05D2ECBE","DD3C23F8-6463-4EAE-959B-C486E27D9BDA","1E8D3752-D212-41F8-BC63-B094E0C80707","75C07D11-AE5D-4A36-B2D0-F2A6EA414E72","494AB1C0-2C09-49DE-B4AA-1F24DC7495FF","25199967-E3BA-4763-A704-37BD3152A5F7"],"_Rotation":0,"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"18200":{"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18201},"_Extent":{"__isSmartRef__":true,"id":18202},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18203},"renderContextTable":{"__isSmartRef__":true,"id":18204},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18205},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18201":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18202":{"x":64.8979476392384,"y":14,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18203":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18204":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18205":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18206":{"x":10,"y":12.911539589749026,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18207":{"partsSpaceName":"PartsBin/NewWorld","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":1,"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18208":{"style":{"__isSmartRef__":true,"id":18209},"chunkOwner":{"__isSmartRef__":true,"id":18199},"__SourceModuleName__":"Global.lively.morphic.TextCore","storedString":"Tag:","__LivelyClassName__":"lively.morphic.TextChunk"},"18209":{"__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18210":{"x":64.8979476392384,"y":14,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18211":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18212":{"morph":{"__isSmartRef__":true,"id":18199},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18213":{"x":45.76052154281416,"y":-27.783027415339603,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18214":{"submorphs":[{"__isSmartRef__":true,"id":18215}],"scripts":[],"id":"C16161F5-3FAC-4C95-94E9-08DAB67B23B9","shape":{"__isSmartRef__":true,"id":18229},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":true,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18245},"value":true,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18246},"lighterFill":{"__isSmartRef__":true,"id":18232},"label":{"__isSmartRef__":true,"id":18215},"attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.Widgets","padding":{"__isSmartRef__":true,"id":18255},"name":"ObjectEditorTagChooser","partsBinMetaInfo":{"__isSmartRef__":true,"id":18256},"listMorph":null,"list":[],"renderContextTable":{"__isSmartRef__":true,"id":18257},"eventHandler":{"__isSmartRef__":true,"id":18258},"distanceToDragEvent":{"__isSmartRef__":true,"id":18259},"priorExtent":{"__isSmartRef__":true,"id":18260},"textString":"PartsBinBrowser","selection":"","_ClipMode":"visible","prevScroll":[0,0],"owner":{"__isSmartRef__":true,"id":16931},"setTargetToListSelection":"all","savedTextString":"all","derivationIds":[225,"7F83847B-D0B1-4A31-8601-43424B97C858","E08FC110-71D7-4FFD-B4A8-08F8147B95BA","5534107D-C5C9-48DD-A1ED-B87E9D9B672C","0B89FA7A-768C-4062-98AE-C455E8DAFF19","799320C6-CFBA-40E7-B03D-64BFE9B78248","9B650AA3-271B-4E72-B230-51C6F64B7462","C95D3672-724C-4C2C-9CDD-EF308062F627","C66EBEEC-B7CE-4DD9-8BDF-905F071F965D","D68B143A-A712-4FD0-8803-62CCB4C7F763","ED802271-AE5C-4BE9-AC4E-7CED44BC864B"],"_Rotation":0,"_Scale":1,"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18261},"__LivelyClassName__":"lively.morphic.Button"},"18215":{"submorphs":[],"scripts":[],"id":"CF6DBBB3-1AC0-4A2E-8031-B521FDE231AE","shape":{"__isSmartRef__":true,"id":18216},"grabbingEnabled":false,"droppingEnabled":false,"showsMorphMenu":false,"halosEnabled":true,"fixedWidth":true,"_MaxTextWidth":130,"_MaxTextHeight":null,"fixedHeight":true,"allowsInput":false,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18221},"textColor":{"__isSmartRef__":true,"id":18219},"owner":{"__isSmartRef__":true,"id":18214},"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","textChunks":[{"__isSmartRef__":true,"id":18222}],"padding":{"__isSmartRef__":true,"id":18224},"_Padding":{"__isSmartRef__":true,"id":18224},"prevScroll":[0,0],"priorExtent":{"__isSmartRef__":true,"id":18225},"attributeConnections":[{"__isSmartRef__":true,"id":18226}],"doNotSerialize":["$$savedTextString"],"doNotCopyProperties":["$$savedTextString"],"renderContextTable":{"__isSmartRef__":true,"id":18227},"eventHandler":{"__isSmartRef__":true,"id":18228},"_HandStyle":"default","_PointerEvents":"none","_ClipMode":"hidden","_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":130,"_MinTextHeight":null,"_Align":"left","_FontFamily":"Arial","_FontSize":10,"derivationIds":[226,"03DBF3F8-8EA2-4426-BA64-C4297DDAB015","B8F87302-BEC3-48CD-9BBA-6C7DBB6287E1","4AA6AE51-338B-4E3E-814B-9F99C693A2D5","08F6CE56-AD91-4C27-9429-C3DEA313696C","D39C963C-FD24-4498-A6D8-71E5102CE58A","132C2A9E-3466-4051-AAEA-6E485A91F408","DB8BC4A1-ED41-446B-AB6C-7E73DD857B5D","567FC668-A57C-41CB-8252-8912826B3144","D0B0775F-C8E7-49EB-BBB2-C7BB7DD464BF","AABED87D-D7C0-494A-8803-26F4601E35FF"],"_TextColor":{"__isSmartRef__":true,"id":18081},"_Scale":1,"__LivelyClassName__":"lively.morphic.Text"},"18216":{"borderWidth":0,"fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18217},"_Extent":{"__isSmartRef__":true,"id":18218},"_BorderColor":{"__isSmartRef__":true,"id":18219},"renderContextTable":{"__isSmartRef__":true,"id":18220},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18072},"_BorderWidth":0,"_Fill":null,"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18217":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18218":{"x":130,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18219":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18220":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18221":{"x":2,"y":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18222":{"style":{"__isSmartRef__":true,"id":18223},"chunkOwner":{"__isSmartRef__":true,"id":18215},"storedString":"all","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"18223":{"textShadow":"0px 1px 0 rgba(255,255,255,1)","__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"18224":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18225":{"x":130,"y":20,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18226":{"sourceObj":{"__isSmartRef__":true,"id":18215},"sourceAttrName":"savedTextString","targetObj":{"__isSmartRef__":true,"id":18214},"targetMethodName":"selection","converter":null,"converterString":null,"updater":null,"updaterString":null,"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18227":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18228":{"morph":{"__isSmartRef__":true,"id":18215},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18229":{"__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":{"__isSmartRef__":true,"id":18230},"_Extent":{"__isSmartRef__":true,"id":18231},"_Fill":{"__isSmartRef__":true,"id":18232},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18242},"_BorderRadius":5,"renderContextTable":{"__isSmartRef__":true,"id":18243},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18244},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18230":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18231":{"x":130,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18232":{"stops":[{"__isSmartRef__":true,"id":18233},{"__isSmartRef__":true,"id":18235},{"__isSmartRef__":true,"id":18237},{"__isSmartRef__":true,"id":18239}],"vector":{"__isSmartRef__":true,"id":18241},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18233":{"offset":0,"color":{"__isSmartRef__":true,"id":18234}},"18234":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18235":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18236}},"18236":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18237":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18238}},"18238":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18239":{"offset":1,"color":{"__isSmartRef__":true,"id":18240}},"18240":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18241":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18242":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18243":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18244":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18245":{"x":39.12381412396891,"y":10.000000000000057,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18246":{"stops":[{"__isSmartRef__":true,"id":18247},{"__isSmartRef__":true,"id":18249},{"__isSmartRef__":true,"id":18251},{"__isSmartRef__":true,"id":18253}],"vector":{"__isSmartRef__":true,"id":18241},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18247":{"offset":0,"color":{"__isSmartRef__":true,"id":18248}},"18248":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18249":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18250}},"18250":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18251":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18252}},"18252":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18253":{"offset":1,"color":{"__isSmartRef__":true,"id":18254}},"18254":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18255":{"x":5,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18256":{"partsSpaceName":"PartsBin/Inputs/","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":2,"partName":"ChoiceButton","comment":"Click on it and you get a list of things to choose from.","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18257":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18258":{"morph":{"__isSmartRef__":true,"id":18214},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18259":{"x":85.7442776093583,"y":-11.582832083333244,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18260":{"x":130,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18261":{"createListMorph":{"__isSmartRef__":true,"id":18262},"getList":{"__isSmartRef__":true,"id":18266},"removeList":{"__isSmartRef__":true,"id":18270},"reset":{"__isSmartRef__":true,"id":18274},"onMouseUp":{"__isSmartRef__":true,"id":18278},"onBlur":{"__isSmartRef__":true,"id":18286},"setTag":{"__isSmartRef__":true,"id":18294}},"18262":{"varMapping":{"__isSmartRef__":true,"id":18263},"source":"function createListMorph() {\n var items = this.getList();\n\n var height = Math.min(this.owner.getExtent().y, items.length * 17);\n var extent = new Rectangle(0, this.getExtent().y, this.getExtent().x, height);\n\n var listMorph = new lively.morphic.List(extent);\n listMorph.setList(items);\n listMorph.setFontSize(10);\n\n listMorph.disableGrabbing();\n listMorph.disableDragging();\n \n connect(listMorph, 'selection', this, 'setTag');\n \n return listMorph;\n}","funcProperties":{"__isSmartRef__":true,"id":18264},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18263":{"this":{"__isSmartRef__":true,"id":18214}},"18264":{"timestamp":{"__isSmartRef__":true,"id":18265},"user":"lauritz","categories":[]},"18265":{"isSerializedDate":true,"string":"Tue Nov 29 2011 04:35:59 GMT+0100 (CET)"},"18266":{"varMapping":{"__isSmartRef__":true,"id":18267},"source":"function getList() {\n if (!this.owner.target) return [''];\n\n var target = this.owner.target;\n\n var tags = Functions.own(target).collect(function (each) {\n return target[each].tags || [];\n }).flatten().uniq();\n\n var sortedTags = tags.sortBy(function(name) { \n return name.toLowerCase() \n });\n \n sortedTags.unshift('all'); \n return sortedTags;\n}","funcProperties":{"__isSmartRef__":true,"id":18268},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18267":{"this":{"__isSmartRef__":true,"id":18214}},"18268":{"timestamp":{"__isSmartRef__":true,"id":18269},"user":"lauritz","tags":[]},"18269":{"isSerializedDate":true,"string":"Fri Dec 16 2011 20:27:25 GMT+0100 (CET)"},"18270":{"varMapping":{"__isSmartRef__":true,"id":18271},"source":"function removeList() {\n this.listMorph && this.listMorph.remove()\n this.listMorph = null;\n}","funcProperties":{"__isSmartRef__":true,"id":18272},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18271":{"this":{"__isSmartRef__":true,"id":18214}},"18272":{"timestamp":{"__isSmartRef__":true,"id":18273},"user":"lauritz","categories":[]},"18273":{"isSerializedDate":true,"string":"Thu Nov 17 2011 19:06:51 GMT+0100 (CET)"},"18274":{"varMapping":{"__isSmartRef__":true,"id":18275},"source":"function reset() {\n this.list = [];\n this.setLabel('all');\n this.label.setAlign('left');\n this.removeList();\n this.applyStyle({fixedWidth: true, fixedHeight: true, borderWidth: 1, overflow: 'visible'})\n}","funcProperties":{"__isSmartRef__":true,"id":18276},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18275":{"this":{"__isSmartRef__":true,"id":18214}},"18276":{"timestamp":{"__isSmartRef__":true,"id":18277},"user":"lauritz","tags":[]},"18277":{"isSerializedDate":true,"string":"Fri Dec 16 2011 20:27:53 GMT+0100 (CET)"},"18278":{"varMapping":{"__isSmartRef__":true,"id":18279},"source":"function onMouseUp(evt) {\n if (evt.isCommandKey() || evt.isRightMouseButtonDown()) return $super(evt);\n if (this.listMorph) {\n this.removeList();\n return true;\n } \n if (this.getList().size() < 2) return;\n var list = this.createListMorph();\n this.addMorph(list);\n this.listMorph = list;\n return true;\n}","funcProperties":{"__isSmartRef__":true,"id":18284},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18279":{"this":{"__isSmartRef__":true,"id":18214},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18280}},"18280":{"$super":{"__isSmartRef__":true,"id":18281}},"18281":{"varMapping":{"__isSmartRef__":true,"id":18282},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18283},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18282":{"obj":{"__isSmartRef__":true,"id":18214},"name":"onMouseUp"},"18283":{},"18284":{"timestamp":{"__isSmartRef__":true,"id":18285},"user":"lauritz","categories":[]},"18285":{"isSerializedDate":true,"string":"Thu Nov 17 2011 18:59:16 GMT+0100 (CET)"},"18286":{"varMapping":{"__isSmartRef__":true,"id":18287},"source":"function onBlur(evt) {\n $super(evt);\n \n // workaround - otherwise other morphs get this event\n var clickedMorph = evt && evt.world && evt.world.clickedOnMorph;\n if (clickedMorph && (clickedMorph !== this && clickedMorph !== this.listMorph)) {\n this.removeList();\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18292},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18287":{"this":{"__isSmartRef__":true,"id":18214},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18288}},"18288":{"$super":{"__isSmartRef__":true,"id":18289}},"18289":{"varMapping":{"__isSmartRef__":true,"id":18290},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18291},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18290":{"obj":{"__isSmartRef__":true,"id":18214},"name":"onBlur"},"18291":{},"18292":{"timestamp":{"__isSmartRef__":true,"id":18293},"user":"lauritz","categories":[]},"18293":{"isSerializedDate":true,"string":"Mon Nov 21 2011 23:10:03 GMT+0100 (CET)"},"18294":{"varMapping":{"__isSmartRef__":true,"id":18295},"source":"function setTag(tag) {\n this.setLabel(tag || '');\n this.label.setAlign('left');\n this.owner.setTag(tag);\n}","funcProperties":{"__isSmartRef__":true,"id":18296},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18295":{"this":{"__isSmartRef__":true,"id":18214}},"18296":{"timestamp":{"__isSmartRef__":true,"id":18297},"user":"lauritz","categories":[]},"18297":{"isSerializedDate":true,"string":"Tue Nov 29 2011 04:36:12 GMT+0100 (CET)"},"18298":{"submorphs":[{"__isSmartRef__":true,"id":18299}],"scripts":[],"id":"8FF885E7-9AC5-49B5-895C-0FDD358DAF5D","shape":{"__isSmartRef__":true,"id":18314},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18318},"lighterFill":{"__isSmartRef__":true,"id":18330},"label":{"__isSmartRef__":true,"id":18299},"name":"Button","showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":18339},"attributeConnections":[{"__isSmartRef__":true,"id":18340}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","priorExtent":{"__isSmartRef__":true,"id":18376},"renderContextTable":{"__isSmartRef__":true,"id":18377},"eventHandler":{"__isSmartRef__":true,"id":18378},"distanceToDragEvent":{"__isSmartRef__":true,"id":18379},"derivationIds":[7251,"BE69DA70-C9C3-4495-A6B5-413BD2FFA0D1","79FE3D3F-77C4-4B39-8243-D672185B416D","A4D2FEDF-2654-4381-AB43-8F89B9CA2E86","87E42FF6-3862-481D-97D6-643676E15F32","4F370A81-5A80-4821-8ECC-D52B56F31E15","1C6D1DC9-2F9B-4DC4-B453-1CA45B17C516","0E8EC0BF-934B-410B-AEC2-0ECA8C8F774D","97086CE7-CD46-4035-A371-02A41D555A66"],"_Position":{"__isSmartRef__":true,"id":18380},"owner":{"__isSmartRef__":true,"id":16931},"layout":{"__isSmartRef__":true,"id":18381},"_ClipMode":"visible","_Rotation":0,"_Scale":0.994014980014994,"__LivelyClassName__":"lively.morphic.Button"},"18299":{"submorphs":[],"scripts":[],"id":"CD7720F3-B412-4D61-ABC4-524846A3F73F","shape":{"__isSmartRef__":true,"id":18300},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18306},"_MaxTextWidth":97,"_MaxTextHeight":null,"textStyle":null,"padding":{"__isSmartRef__":true,"id":18307},"_Padding":{"__isSmartRef__":true,"id":18308},"owner":{"__isSmartRef__":true,"id":18298},"isLabel":true,"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","_ClipMode":"hidden","priorExtent":{"__isSmartRef__":true,"id":18309},"textChunks":[{"__isSmartRef__":true,"id":18310}],"_Align":"center","renderContextTable":{"__isSmartRef__":true,"id":18312},"eventHandler":{"__isSmartRef__":true,"id":18313},"_HandStyle":"default","_PointerEvents":"none","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[7252,"E0EF3EFE-3ADF-4E46-8705-7BF444E4BCED","307A3596-1175-4EA6-AA27-5BA4C9D95AB7","0EF99131-C569-4C2C-B613-E0D8423C1334","BA4EC8D2-AB29-4F9F-B5A0-715A4746A4C4","56735895-BA99-4D98-9866-AA5DBD86237E","81041CF7-31DB-4F65-BB39-FE438A4F266F","D03829B3-268E-40A0-A440-3E4BAC344F30","714637F0-714A-4833-909B-BA4AF1B4628B"],"_MinTextWidth":97,"_MinTextHeight":null,"__LivelyClassName__":"lively.morphic.Text"},"18300":{"position":{"__isSmartRef__":true,"id":18301},"_Extent":{"__isSmartRef__":true,"id":18302},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18303},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18304},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18305},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18301":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18302":{"x":101,"y":21,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18303":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18304":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18305":{"x":2,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18306":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18307":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18308":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18309":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18310":{"style":{"__isSmartRef__":true,"id":18311},"chunkOwner":{"__isSmartRef__":true,"id":18299},"storedString":"run","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"18311":{"__SourceModuleName__":"Global.lively.morphic.TextCore","textShadow":"0px 1px 0 rgba(255,255,255,1)","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18312":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18313":{"morph":{"__isSmartRef__":true,"id":18299},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18314":{"position":{"__isSmartRef__":true,"id":18315},"_Extent":{"__isSmartRef__":true,"id":18316},"_BorderWidth":1.1840000000000002,"_BorderColor":{"__isSmartRef__":true,"id":18317},"_Fill":{"__isSmartRef__":true,"id":18318},"_BorderRadius":5.2,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18328},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18329},"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18315":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18316":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18317":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18318":{"stops":[{"__isSmartRef__":true,"id":18319},{"__isSmartRef__":true,"id":18321},{"__isSmartRef__":true,"id":18323},{"__isSmartRef__":true,"id":18325}],"vector":{"__isSmartRef__":true,"id":18327},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18319":{"offset":0,"color":{"__isSmartRef__":true,"id":18320}},"18320":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18321":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18322}},"18322":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18323":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18324}},"18324":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18325":{"offset":1,"color":{"__isSmartRef__":true,"id":18326}},"18326":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18327":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18328":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18329":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18330":{"stops":[{"__isSmartRef__":true,"id":18331},{"__isSmartRef__":true,"id":18333},{"__isSmartRef__":true,"id":18335},{"__isSmartRef__":true,"id":18337}],"vector":{"__isSmartRef__":true,"id":18327},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18331":{"offset":0,"color":{"__isSmartRef__":true,"id":18332}},"18332":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18333":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18334}},"18334":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18335":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18336}},"18336":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18337":{"offset":1,"color":{"__isSmartRef__":true,"id":18338}},"18338":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18339":{"partsSpaceName":"PartsBin/Inputs","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"partName":"Button","comment":"Has a script that is called on button press","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18340":{"sourceObj":{"__isSmartRef__":true,"id":18298},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16931},"targetMethodName":"runScript","visualConnector":{"__isSmartRef__":true,"id":18341},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18341":{"submorphs":[{"__isSmartRef__":true,"id":18342}],"scripts":[],"shape":{"__isSmartRef__":true,"id":18357},"derivationIds":[null],"id":"C89B50A0-17E7-4D22-AE1D-5112520DAEE7","renderContextTable":{"__isSmartRef__":true,"id":18364},"eventHandler":{"__isSmartRef__":true,"id":18365},"droppingEnabled":true,"halosEnabled":true,"owner":null,"controlPoints":[{"__isSmartRef__":true,"id":18366},{"__isSmartRef__":true,"id":18367}],"con":{"__isSmartRef__":true,"id":18340},"showsMorphMenu":true,"showsHalos":false,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18368},"__LivelyClassName__":"lively.morphic.Path"},"18342":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":18343},"derivationIds":[null],"id":"2A71BE9E-6820-46AF-ACED-3C9BDCC918AF","renderContextTable":{"__isSmartRef__":true,"id":18354},"eventHandler":{"__isSmartRef__":true,"id":18355},"droppingEnabled":true,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":18356},"owner":{"__isSmartRef__":true,"id":18341},"_Rotation":-3.130064002485303,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.Path"},"18343":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":18344},{"__isSmartRef__":true,"id":18345},{"__isSmartRef__":true,"id":18346},{"__isSmartRef__":true,"id":18347}],"renderContextTable":{"__isSmartRef__":true,"id":18348},"_ClipMode":"visible","_Position":{"__isSmartRef__":true,"id":18349},"_Extent":{"__isSmartRef__":true,"id":18350},"_Padding":{"__isSmartRef__":true,"id":18351},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18352},"_Fill":{"__isSmartRef__":true,"id":18353},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"18344":{"isAbsolute":true,"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"18345":{"isAbsolute":true,"x":-12,"y":6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18346":{"isAbsolute":true,"x":4,"y":0,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18347":{"isAbsolute":true,"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18348":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"18349":{"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18350":{"x":16,"y":12,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18351":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18352":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18353":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18354":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18355":{"morph":{"__isSmartRef__":true,"id":18342},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18356":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18357":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":18358},{"__isSmartRef__":true,"id":18359}],"renderContextTable":{"__isSmartRef__":true,"id":18360},"_ClipMode":"visible","_Position":{"__isSmartRef__":true,"id":18361},"_Extent":{"__isSmartRef__":true,"id":18362},"_Padding":{"__isSmartRef__":true,"id":18363},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18352},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"18358":{"isAbsolute":true,"x":829.7085000406639,"y":9.565843617262885,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"18359":{"isAbsolute":true,"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18360":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"18361":{"x":-1,"y":-1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18362":{"x":831,"y":11,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18363":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18364":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18365":{"morph":{"__isSmartRef__":true,"id":18341},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18366":{"morph":{"__isSmartRef__":true,"id":18341},"index":0,"connectedMagnet":null,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"18367":{"morph":{"__isSmartRef__":true,"id":18341},"index":1,"connectedMagnet":null,"marker":{"__isSmartRef__":true,"id":18342},"markerDirection":"prev","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"18368":{"morphMenuItems":{"__isSmartRef__":true,"id":18369}},"18369":{"varMapping":{"__isSmartRef__":true,"id":18370},"source":"function morphMenuItems() {\n var visualConnector = this, con = this.con, world = this.world();\n var items = [\n ['edit converter', function() {\n var source = con.converterString ||\n 'function converter(value) {\\n return value\\n}',\n editor = new lively.morphic.Text(new Rectangle(0,0, 400, 200), source);\n editor.doitContext = con;\n connect(editor, 'savedTextString', con, 'converterString', {updater:\n function($upd, source) { this.targetObj.converter = null; $upd(source) }});\n connect(editor, 'savedTextString', world, 'alertOK', {converter:\n function() { return 'setting new converter' }})\n editor.applyStyle({syntaxHighlighting: true,\n fontFamily: 'Courier', resizeWidth: true, resizeHeight: true});\n var title = con.targetObj.name && con.sourceObj.name ?\n 'Editor for ' + con.targetObj.name + ' -> ' + con.sourceObj.name :\n 'Editor for converter function';\n var window = world.addFramedMorph(editor, title)\n window.align(window.bounds().topCenter(),\n visualConnector.bounds().bottomCenter())\n }],\n ['hide', function() {\n visualConnector.disconnectFromMagnets();\n visualConnector.remove();\n }],\n ['disconnect', function() {\n alertOK('Disconnected ' + visualConnector.con);\n visualConnector.con.visualDisconnect();\n }],\n ['cancel', function() {}],\n ];\n return items;\n }","funcProperties":{"__isSmartRef__":true,"id":18375},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18370":{"this":{"__isSmartRef__":true,"id":18341},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18371}},"18371":{"$super":{"__isSmartRef__":true,"id":18372}},"18372":{"varMapping":{"__isSmartRef__":true,"id":18373},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18374},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18373":{"obj":{"__isSmartRef__":true,"id":18341},"name":"morphMenuItems"},"18374":{},"18375":{},"18376":{"x":101,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18377":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18378":{"morph":{"__isSmartRef__":true,"id":18298},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18379":{"x":71.99397894387357,"y":-13.030105280631261,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18380":{"x":788.7426780861911,"y":9.508591852040126,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18381":{"centeredHorizontal":false,"moveHorizontal":true},"18382":{"submorphs":[{"__isSmartRef__":true,"id":18383}],"scripts":[],"id":"C4D40FCC-1252-4D7F-8C32-76357E46151A","shape":{"__isSmartRef__":true,"id":18398},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18402},"lighterFill":{"__isSmartRef__":true,"id":18414},"label":{"__isSmartRef__":true,"id":18383},"name":"saveButton","showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":18423},"attributeConnections":[{"__isSmartRef__":true,"id":18424}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","priorExtent":{"__isSmartRef__":true,"id":18460},"renderContextTable":{"__isSmartRef__":true,"id":18461},"eventHandler":{"__isSmartRef__":true,"id":18462},"distanceToDragEvent":{"__isSmartRef__":true,"id":18463},"derivationIds":[7251,"BE69DA70-C9C3-4495-A6B5-413BD2FFA0D1","79FE3D3F-77C4-4B39-8243-D672185B416D","A4D2FEDF-2654-4381-AB43-8F89B9CA2E86","D686F0CB-027B-4CA9-8B8D-9306389B219D","F51327CB-803E-4234-BFB3-6F5252D1C936","A79280E8-6AE3-4016-AF47-CE78F71924C6","B05829EB-D452-4D81-983B-E2CE425C8260","32B117E5-52D8-4843-B80E-090B9817E099","49AC923E-5272-4E3C-8F02-4F2AED2BC4E9"],"layout":{"__isSmartRef__":true,"id":18464},"_Position":{"__isSmartRef__":true,"id":18465},"owner":{"__isSmartRef__":true,"id":16931},"_ClipMode":"visible","_Rotation":0,"_Scale":0.9880657804942089,"__LivelyClassName__":"lively.morphic.Button"},"18383":{"submorphs":[],"scripts":[],"id":"AFED9A54-0AE0-4235-9748-0431576F42AA","shape":{"__isSmartRef__":true,"id":18384},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18390},"_MaxTextWidth":97,"_MaxTextHeight":null,"textStyle":null,"padding":{"__isSmartRef__":true,"id":18391},"_Padding":{"__isSmartRef__":true,"id":18392},"owner":{"__isSmartRef__":true,"id":18382},"isLabel":true,"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","_ClipMode":"hidden","priorExtent":{"__isSmartRef__":true,"id":18393},"textChunks":[{"__isSmartRef__":true,"id":18394}],"_Align":"center","renderContextTable":{"__isSmartRef__":true,"id":18396},"eventHandler":{"__isSmartRef__":true,"id":18397},"_HandStyle":"default","_PointerEvents":"none","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[7252,"E0EF3EFE-3ADF-4E46-8705-7BF444E4BCED","307A3596-1175-4EA6-AA27-5BA4C9D95AB7","0EF99131-C569-4C2C-B613-E0D8423C1334","9AECBFB8-25A5-483F-86AD-D7CF9ABC9A25","918C6CC4-3540-4341-BAFD-B195F7807FEE","5AABB138-5EE8-40A5-AB3C-5A9625D0A353","4529D79B-4CC5-467E-91F8-661C3A5F49F8","1E5E570C-FD42-45E3-A7F6-768BB14ACD14","A13FB4E0-72F2-4E7C-A861-EDCBA1393860"],"_MinTextWidth":97,"_MinTextHeight":null,"__LivelyClassName__":"lively.morphic.Text"},"18384":{"position":{"__isSmartRef__":true,"id":18385},"_Extent":{"__isSmartRef__":true,"id":18386},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18387},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18388},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18389},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18385":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18386":{"x":101,"y":21,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18387":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18388":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18389":{"x":2,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18390":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18391":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18392":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18393":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18394":{"style":{"__isSmartRef__":true,"id":18395},"chunkOwner":{"__isSmartRef__":true,"id":18383},"storedString":"save","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"18395":{"__SourceModuleName__":"Global.lively.morphic.TextCore","textShadow":"0px 1px 0 rgba(255,255,255,1)","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18396":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18397":{"morph":{"__isSmartRef__":true,"id":18383},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18398":{"position":{"__isSmartRef__":true,"id":18399},"_Extent":{"__isSmartRef__":true,"id":18400},"_BorderWidth":1.1840000000000002,"_BorderColor":{"__isSmartRef__":true,"id":18401},"_Fill":{"__isSmartRef__":true,"id":18402},"_BorderRadius":5.2,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18412},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18413},"_Opacity":1,"_BorderStyle":"solid","__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18399":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18400":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18401":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18402":{"stops":[{"__isSmartRef__":true,"id":18403},{"__isSmartRef__":true,"id":18405},{"__isSmartRef__":true,"id":18407},{"__isSmartRef__":true,"id":18409}],"vector":{"__isSmartRef__":true,"id":18411},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18403":{"offset":0,"color":{"__isSmartRef__":true,"id":18404}},"18404":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18405":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18406}},"18406":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18407":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18408}},"18408":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18409":{"offset":1,"color":{"__isSmartRef__":true,"id":18410}},"18410":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18411":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18412":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18413":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18414":{"stops":[{"__isSmartRef__":true,"id":18415},{"__isSmartRef__":true,"id":18417},{"__isSmartRef__":true,"id":18419},{"__isSmartRef__":true,"id":18421}],"vector":{"__isSmartRef__":true,"id":18411},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18415":{"offset":0,"color":{"__isSmartRef__":true,"id":18416}},"18416":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18417":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18418}},"18418":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18419":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18420}},"18420":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18421":{"offset":1,"color":{"__isSmartRef__":true,"id":18422}},"18422":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18423":{"partsSpaceName":"PartsBin/Inputs","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"partName":"Button","comment":"Has a script that is called on button press","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18424":{"sourceObj":{"__isSmartRef__":true,"id":18382},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":17427},"targetMethodName":"doSave","visualConnector":{"__isSmartRef__":true,"id":18425},"__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18425":{"submorphs":[{"__isSmartRef__":true,"id":18426}],"scripts":[],"shape":{"__isSmartRef__":true,"id":18441},"derivationIds":[null],"id":"F46012D5-C8BE-4E52-BF98-D052FDAAE17A","renderContextTable":{"__isSmartRef__":true,"id":18448},"eventHandler":{"__isSmartRef__":true,"id":18449},"droppingEnabled":true,"halosEnabled":true,"owner":null,"controlPoints":[{"__isSmartRef__":true,"id":18450},{"__isSmartRef__":true,"id":18451}],"con":{"__isSmartRef__":true,"id":18424},"showsMorphMenu":true,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18452},"__LivelyClassName__":"lively.morphic.Path"},"18426":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":18427},"derivationIds":[null],"id":"A2A83C78-09B8-473C-829B-198206D7A9E4","renderContextTable":{"__isSmartRef__":true,"id":18438},"eventHandler":{"__isSmartRef__":true,"id":18439},"droppingEnabled":true,"halosEnabled":true,"_Position":{"__isSmartRef__":true,"id":18440},"owner":{"__isSmartRef__":true,"id":18425},"_Rotation":3.077607197692381,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.Path"},"18427":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":18428},{"__isSmartRef__":true,"id":18429},{"__isSmartRef__":true,"id":18430},{"__isSmartRef__":true,"id":18431}],"renderContextTable":{"__isSmartRef__":true,"id":18432},"_ClipMode":"visible","_Position":{"__isSmartRef__":true,"id":18433},"_Extent":{"__isSmartRef__":true,"id":18434},"_Padding":{"__isSmartRef__":true,"id":18435},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18436},"_Fill":{"__isSmartRef__":true,"id":18437},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"18428":{"isAbsolute":true,"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"18429":{"isAbsolute":true,"x":-12,"y":6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18430":{"isAbsolute":true,"x":4,"y":0,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18431":{"isAbsolute":true,"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18432":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"18433":{"x":-12,"y":-6,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18434":{"x":16,"y":12,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18435":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18436":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18437":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18438":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18439":{"morph":{"__isSmartRef__":true,"id":18426},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18440":{"x":201.20421122525056,"y":40.24084224505009,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18441":{"dontChangeShape":false,"cachedVertices":null,"_PathElements":[{"__isSmartRef__":true,"id":18442},{"__isSmartRef__":true,"id":18443}],"renderContextTable":{"__isSmartRef__":true,"id":18444},"_ClipMode":"visible","_Position":{"__isSmartRef__":true,"id":18445},"_Extent":{"__isSmartRef__":true,"id":18446},"_Padding":{"__isSmartRef__":true,"id":18447},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18436},"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.Path"},"18442":{"isAbsolute":true,"x":679.4857209639925,"y":9.595948897894004,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.MoveTo"},"18443":{"isAbsolute":true,"x":201.20421122525056,"y":40.24084224505009,"__SourceModuleName__":"Global.lively.morphic.PathShapes","__LivelyClassName__":"lively.morphic.Shapes.LineTo"},"18444":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML","setClipMode":"setClipModeHTML","getPathNode":"getPathNodeHTML","setPathElements":"setPathElementsHTML","getPathBounds":"getPathBoundsHTML","getTotalLength":"getTotalLengthHTML","getPointAtTotalLength":"getPointAtTotalLengthHTML"},"18445":{"x":200,"y":9,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18446":{"x":480,"y":32,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18447":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18448":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18449":{"morph":{"__isSmartRef__":true,"id":18425},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18450":{"morph":{"__isSmartRef__":true,"id":18425},"index":0,"connectedMagnet":null,"__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"18451":{"morph":{"__isSmartRef__":true,"id":18425},"index":1,"connectedMagnet":null,"marker":{"__isSmartRef__":true,"id":18426},"markerDirection":"prev","__SourceModuleName__":"Global.lively.morphic.AdditionalMorphs","__LivelyClassName__":"lively.morphic.ControlPoint"},"18452":{"morphMenuItems":{"__isSmartRef__":true,"id":18453}},"18453":{"varMapping":{"__isSmartRef__":true,"id":18454},"source":"function morphMenuItems() {\n var visualConnector = this, con = this.con, world = this.world();\n var items = [\n ['edit converter', function() {\n var source = con.converterString ||\n 'function converter(value) {\\n return value\\n}',\n editor = new lively.morphic.Text(new Rectangle(0,0, 400, 200), source);\n editor.doitContext = con;\n connect(editor, 'savedTextString', con, 'converterString', {updater:\n function($upd, source) { this.targetObj.converter = null; $upd(source) }});\n connect(editor, 'savedTextString', world, 'alertOK', {converter:\n function() { return 'setting new converter' }})\n editor.applyStyle({syntaxHighlighting: true,\n fontFamily: 'Courier', resizeWidth: true, resizeHeight: true});\n var title = con.targetObj.name && con.sourceObj.name ?\n 'Editor for ' + con.targetObj.name + ' -> ' + con.sourceObj.name :\n 'Editor for converter function';\n var window = world.addFramedMorph(editor, title)\n window.align(window.bounds().topCenter(),\n visualConnector.bounds().bottomCenter())\n }],\n ['hide', function() {\n visualConnector.disconnectFromMagnets();\n visualConnector.remove();\n }],\n ['disconnect', function() {\n alertOK('Disconnected ' + visualConnector.con);\n visualConnector.con.visualDisconnect();\n }],\n ['cancel', function() {}],\n ];\n return items;\n }","funcProperties":{"__isSmartRef__":true,"id":18459},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18454":{"this":{"__isSmartRef__":true,"id":18425},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":18455}},"18455":{"$super":{"__isSmartRef__":true,"id":18456}},"18456":{"varMapping":{"__isSmartRef__":true,"id":18457},"source":"function () {\n try {\n return obj.constructor.prototype[name].apply(obj, arguments)\n } catch(e) {\n alert('Error in $super call: ' + e + '\\n' + e.stack);\n return null;\n }\n }","funcProperties":{"__isSmartRef__":true,"id":18458},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18457":{"obj":{"__isSmartRef__":true,"id":18425},"name":"morphMenuItems"},"18458":{},"18459":{},"18460":{"x":101,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18461":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18462":{"morph":{"__isSmartRef__":true,"id":18382},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18463":{"x":68.77671624028653,"y":-14.497241813457947,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18464":{"centeredHorizontal":false,"moveHorizontal":true},"18465":{"x":675.4189853444968,"y":9.53851695196505,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18466":{"submorphs":[{"__isSmartRef__":true,"id":18467}],"scripts":[],"id":"2BF646FC-3E5D-4F69-BC9E-578112B166F7","shape":{"__isSmartRef__":true,"id":18482},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18498},"value":false,"toggle":false,"isActive":true,"normalFill":{"__isSmartRef__":true,"id":18486},"lighterFill":{"__isSmartRef__":true,"id":18499},"label":{"__isSmartRef__":true,"id":18467},"name":"openTestsButton","showsHalos":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":18508},"attributeConnections":[{"__isSmartRef__":true,"id":18509}],"doNotSerialize":["$$fire"],"doNotCopyProperties":["$$fire"],"__SourceModuleName__":"Global.lively.morphic.Widgets","priorExtent":{"__isSmartRef__":true,"id":18510},"renderContextTable":{"__isSmartRef__":true,"id":18511},"eventHandler":{"__isSmartRef__":true,"id":18512},"distanceToDragEvent":{"__isSmartRef__":true,"id":18513},"derivationIds":[7251,"84054D2E-8176-440D-B413-279956A34FC2","79434046-F834-490E-B705-0CE871D9E8B3","FF38CA79-C0DF-4F2F-8FC3-407571EF6A54","B1D50332-9F4F-4F7C-AC3F-95DC6C73EAA4","5B8D7C39-987A-4849-BFFD-3F316CE03852"],"owner":{"__isSmartRef__":true,"id":16931},"_ClipMode":"visible","_Rotation":0,"_Scale":0.9940149800149939,"__LivelyClassName__":"lively.morphic.Button"},"18467":{"submorphs":[],"scripts":[],"id":"FA865285-1424-4F01-B08E-FF4005F9F6EE","shape":{"__isSmartRef__":true,"id":18468},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"_WhiteSpaceHandling":"pre-wrap","fixedHeight":true,"allowInput":false,"_FontFamily":"Helvetica","registeredForMouseEvents":true,"_Position":{"__isSmartRef__":true,"id":18474},"_MaxTextWidth":97,"_MaxTextHeight":null,"textStyle":null,"padding":{"__isSmartRef__":true,"id":18475},"_Padding":{"__isSmartRef__":true,"id":18476},"owner":{"__isSmartRef__":true,"id":18466},"isLabel":true,"eventsAreIgnored":true,"__SourceModuleName__":"Global.lively.morphic.TextCore","_ClipMode":"hidden","priorExtent":{"__isSmartRef__":true,"id":18477},"textChunks":[{"__isSmartRef__":true,"id":18478}],"_Align":"center","renderContextTable":{"__isSmartRef__":true,"id":18480},"eventHandler":{"__isSmartRef__":true,"id":18481},"_HandStyle":"default","_PointerEvents":"none","attributeConnections":[],"doNotSerialize":[],"doNotCopyProperties":[],"derivationIds":[7252,"0A0A6CB1-BD92-4F39-A425-2EB3D2D4CBA2","CB475566-05CE-43E2-B04D-EE32BC4CB718","6BB077CE-92E6-47BE-BE88-9A48488562D1","9E359973-2FDB-417B-BB06-AB34D52BD310","58F098ED-A190-44F2-B73E-80802B2CF2F6"],"_MinTextWidth":97,"_MinTextHeight":null,"__LivelyClassName__":"lively.morphic.Text"},"18468":{"position":{"__isSmartRef__":true,"id":18469},"_Extent":{"__isSmartRef__":true,"id":18470},"_BorderWidth":0,"_BorderColor":{"__isSmartRef__":true,"id":18471},"_Fill":null,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18472},"_ClipMode":"hidden","_Padding":{"__isSmartRef__":true,"id":18473},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18469":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18470":{"x":101,"y":21,"__LivelyClassName__":"Point","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18471":{"r":0,"g":0,"b":0,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18472":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18473":{"x":2,"y":2,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18474":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18475":{"x":5,"y":5,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18476":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18477":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18478":{"style":{"__isSmartRef__":true,"id":18479},"chunkOwner":{"__isSmartRef__":true,"id":18467},"storedString":"Tests","__SourceModuleName__":"Global.lively.morphic.TextCore","__LivelyClassName__":"lively.morphic.TextChunk"},"18479":{"__SourceModuleName__":"Global.lively.morphic.TextCore","textShadow":"0px 1px 0 rgba(255,255,255,1)","__LivelyClassName__":"lively.morphic.TextEmphasis"},"18480":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML","updateText":"updateTextHTML","setTextExtent":"setTextExtentHTML","setMaxTextWidth":"setMaxTextWidthHTML","setMaxTextHeight":"setMaxTextHeightHTML","setMinTextWidth":"setMinTextWidthHTML","setMinTextHeight":"setMinTextHeightHTML","getTextExtent":"getTextExtentHTML","getTextString":"getTextStringHTML","ignoreTextEvents":"ignoreTextEventsHTML","unignoreTextEvents":"unignoreTextEventsHTML","enableTextEvents":"enableTextEventsHTML","setFontFamily":"setFontFamilyHTML","setFontSize":"setFontSizeHTML","setTextColor":"setTextColorHTML","setFontWeight":"setFontWeightHTML","setFontStyle":"setFontStyleHTML","setTextDecoration":"setTextDecorationHTML","setPadding":"setPaddingHTML","setAlign":"setAlignHTML","setVerticalAlign":"setVerticalAlignHTML","setDisplay":"setDisplayHTML","setWhiteSpaceHandling":"setWhiteSpaceHandlingHTML","focusMorph":"focusMorphHTML","setInputAllowed":"setInputAllowedHTML"},"18481":{"morph":{"__isSmartRef__":true,"id":18467},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18482":{"position":{"__isSmartRef__":true,"id":18483},"_Extent":{"__isSmartRef__":true,"id":18484},"_BorderWidth":1.1840000000000002,"_BorderColor":{"__isSmartRef__":true,"id":18485},"_Fill":{"__isSmartRef__":true,"id":18486},"_BorderRadius":5.2,"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18496},"_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18497},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18483":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18484":{"x":101,"y":21,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18485":{"r":0.839,"g":0.839,"b":0.839,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18486":{"stops":[{"__isSmartRef__":true,"id":18487},{"__isSmartRef__":true,"id":18489},{"__isSmartRef__":true,"id":18491},{"__isSmartRef__":true,"id":18493}],"vector":{"__isSmartRef__":true,"id":18495},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18487":{"offset":0,"color":{"__isSmartRef__":true,"id":18488}},"18488":{"r":0.9600000000000001,"g":0.9600000000000001,"b":0.9600000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18489":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18490}},"18490":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18491":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18492}},"18492":{"r":0.8200000000000001,"g":0.8200000000000001,"b":0.8200000000000001,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18493":{"offset":1,"color":{"__isSmartRef__":true,"id":18494}},"18494":{"r":0.94,"g":0.94,"b":0.94,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18495":{"x":0,"y":0,"width":0,"height":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18496":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18497":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18498":{"x":510,"y":10,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18499":{"stops":[{"__isSmartRef__":true,"id":18500},{"__isSmartRef__":true,"id":18502},{"__isSmartRef__":true,"id":18504},{"__isSmartRef__":true,"id":18506}],"vector":{"__isSmartRef__":true,"id":18495},"__SourceModuleName__":"Global.lively.morphic.Shapes","__LivelyClassName__":"lively.morphic.LinearGradient"},"18500":{"offset":0,"color":{"__isSmartRef__":true,"id":18501}},"18501":{"r":0.98,"g":0.98,"b":0.98,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18502":{"offset":0.4,"color":{"__isSmartRef__":true,"id":18503}},"18503":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18504":{"offset":0.6,"color":{"__isSmartRef__":true,"id":18505}},"18505":{"r":0.91,"g":0.91,"b":0.91,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18506":{"offset":1,"color":{"__isSmartRef__":true,"id":18507}},"18507":{"r":0.97,"g":0.97,"b":0.97,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18508":{"partsSpaceName":"PartsBin/Inputs","__SourceModuleName__":"Global.lively.PartsBin","migrationLevel":4,"partName":"Button","comment":"Has a script that is called on button press","__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18509":{"sourceObj":{"__isSmartRef__":true,"id":18466},"sourceAttrName":"fire","targetObj":{"__isSmartRef__":true,"id":16931},"targetMethodName":"openPartTestRunner","__SourceModuleName__":"Global.lively.bindings","__LivelyClassName__":"AttributeConnection"},"18510":{"x":101,"y":20,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18511":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18512":{"morph":{"__isSmartRef__":true,"id":18466},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18513":{"x":65.95178327801523,"y":-8.024108360992386,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18514":{"target":{"__isSmartRef__":true,"id":16931},"selector":"update","args":[],"stopped":false,"tickTime":500,"currentTimeout":1203,"__LivelyClassName__":"lively.morphic.TargetScript","__SourceModuleName__":"Global.lively.morphic.Core"},"18515":{"position":{"__isSmartRef__":true,"id":18516},"_Extent":{"__isSmartRef__":true,"id":18517},"_BorderWidth":1,"_BorderColor":{"__isSmartRef__":true,"id":18518},"_Fill":{"__isSmartRef__":true,"id":18519},"__SourceModuleName__":"Global.lively.morphic.Shapes","renderContextTable":{"__isSmartRef__":true,"id":18520},"_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_ClipMode":"visible","_Padding":{"__isSmartRef__":true,"id":18521},"__LivelyClassName__":"lively.morphic.Shapes.Rectangle"},"18516":{"x":0,"y":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18517":{"x":909.0285365288845,"y":526.612532614436,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18518":{"r":0.372,"g":0.369,"b":0.372,"a":1,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Color"},"18519":{"r":1,"g":1,"b":1,"a":1,"__LivelyClassName__":"Color","__SourceModuleName__":"Global.lively.morphic.Graphics"},"18520":{"init":"initHTML","appendShape":"renderHTML","setPosition":"setPositionHTML","setExtent":"setExtentHTML","setPadding":"setPaddingHTML","setFill":"setFillHTML","setBorderColor":"setBorderColorHTML","setBorderWidth":"setBorderWidthHTML","setStrokeOpacity":"setStrokeOpacityHTML","setBorderRadius":"setBorderRadiusHTML","setBorderStyle":"setBorderStyleHTML","setOpacity":"setOpacityHTML"},"18521":{"x":0,"y":0,"width":0,"height":0,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Rectangle"},"18522":{"partsSpaceName":"PartsBin/Basic","__SourceModuleName__":"Global.lively.PartsBin","comment":"Edit scripts and connections of a specific morph.","migrationLevel":4,"partName":"ObjectEditorPane","changes":[{"__isSmartRef__":true,"id":18523}],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo"},"18523":{"date":{"__isSmartRef__":true,"id":18524},"author":"lauritz","message":"Adapted the update behavior on ticks. Reduces the impact of HTML's autoscroll to selected list items."},"18524":{"isSerializedDate":true,"string":"Fri Oct 21 2011 00:39:30 GMT+0200 (CEST)"},"18525":{"replaceRenderContext":"replaceRenderContextHTML","init":"initHTML","append":"appendHTML","remove":"removeHTML","onRenderFinished":"onRenderFinishedHTML","triggerEvent":"triggerEventHTML","setTransform":"setTransformHTML","setPosition":"setPositionHTML","setRotation":"setRotationHTML","setExtent":"setExtentHTML","setScale":"setScaleHTML","setVisible":"setVisibleHTML","adjustOrigin":"adjustOriginHTML","setPivotPoint":"setPivotPointHTML","setClipMode":"setClipModeHTML","showsVerticalScrollBar":"showsVerticalScrollBarHTML","showsHorizontalScrollBar":"showsHorizontalScrollBarHTML","getScrollBarExtent":"getScrollBarExtentHTML","setHandStyle":"setHandStyleHTML","setPointerEvents":"setPointerEventsHTML","setToolTip":"setToolTipHTML","focus":"focusHTML","blur":"blurHTML","setFocusable":"setFocusableHTML"},"18526":{"morph":{"__isSmartRef__":true,"id":16931},"__SourceModuleName__":"Global.lively.morphic.Events","__LivelyClassName__":"lively.morphic.EventHandler"},"18527":{"x":909.0285365288845,"y":526.612532614436,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18528":{"resizeWidth":true,"resizeHeight":true,"adjustForNewBounds":true},"18529":{"x":350.2386236582805,"y":-3.2455173507596555,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18530":{"x":0.971126750461849,"y":21.45669012569269,"__SourceModuleName__":"Global.lively.morphic.Graphics","__LivelyClassName__":"Point"},"18531":{},"18532":{"displayInitialScript":{"__isSmartRef__":true,"id":18533},"displayJavaScriptSource":{"__isSmartRef__":true,"id":18537},"displaySourceForConnection":{"__isSmartRef__":true,"id":18541},"displaySourceForScript":{"__isSmartRef__":true,"id":18545},"generateSourceForConnection":{"__isSmartRef__":true,"id":18549},"generateSourceForScript":{"__isSmartRef__":true,"id":18553},"generateTargetCode":{"__isSmartRef__":true,"id":18557},"newConnection":{"__isSmartRef__":true,"id":18561},"newScript":{"__isSmartRef__":true,"id":18565},"reset":{"__isSmartRef__":true,"id":18569},"selectChangedContent":{"__isSmartRef__":true,"id":18573},"setTarget":{"__isSmartRef__":true,"id":18577},"sortedConnectionNamesOfObj":{"__isSmartRef__":true,"id":18581},"sortedScriptNamesOfObj":{"__isSmartRef__":true,"id":18585},"updateLists":{"__isSmartRef__":true,"id":18589},"onShutdown":{"__isSmartRef__":true,"id":18593},"confirmUnsavedChanges":{"__isSmartRef__":true,"id":18597},"update":{"__isSmartRef__":true,"id":18601},"ensureAnnotationLayer":{"__isSmartRef__":true,"id":18605},"migrateOldScriptAnnotations":{"__isSmartRef__":true,"id":18609},"copyToPartsBinWithUserRequest":{"__isSmartRef__":true,"id":18613},"printTags":{"__isSmartRef__":true,"id":18621},"setTag":{"__isSmartRef__":true,"id":18625},"runScript":{"__isSmartRef__":true,"id":18629},"openPartTestRunner":{"__isSmartRef__":true,"id":18633}},"18533":{"varMapping":{"__isSmartRef__":true,"id":18534},"source":"function displayInitialScript() {\n if (this.scriptList.getList().size() > 1) {\n this.scriptList.preselectItem();\n } else if (this.connectionList.getList().size() > 1) {\n this.connectionList.preselectItem();\n } else {\n this.scriptList.selectAt(0);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18535},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18534":{"this":{"__isSmartRef__":true,"id":16931}},"18535":{"timestamp":{"__isSmartRef__":true,"id":18536},"user":"lauritz","tags":[]},"18536":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:13:43 GMT+0100 (CET)"},"18537":{"varMapping":{"__isSmartRef__":true,"id":18538},"source":"function displayJavaScriptSource(jsCode) {\n if (this.scriptPane.hasChanged()) {\n var that = this;\n var callback = function(confirmed) {\n if (confirmed) that.scriptPane.display(jsCode)\n };\n this.confirmUnsavedChanges(callback);\n } else {\n this.scriptPane.display(jsCode);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18539},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18538":{"this":{"__isSmartRef__":true,"id":16931}},"18539":{"timestamp":{"__isSmartRef__":true,"id":18540},"user":"lauritz","tags":[]},"18540":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:59:26 GMT+0100 (CET)"},"18541":{"varMapping":{"__isSmartRef__":true,"id":18542},"source":"function displaySourceForConnection(connection) {\n var code = \"\", that = this;\n if (connection === undefined) return;\n if (connection === null) {\n this.sortedConnectionNamesOfObj(this.target).forEach(function(each) {\n code = code.concat(that.generateSourceForConnection(each[1])).concat(\"\\n\\n\");\n });\n code = code.substring(0, code.length - \"\\n\\n\".length - 1);\n } else {\n code = this.generateSourceForConnection(connection);\n }\n this.displayJavaScriptSource(code);\n}","funcProperties":{"__isSmartRef__":true,"id":18543},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18542":{"this":{"__isSmartRef__":true,"id":16931}},"18543":{"timestamp":{"__isSmartRef__":true,"id":18544},"user":"conradcalmez","tags":[]},"18544":{"isSerializedDate":true,"string":"Thu Feb 02 2012 14:59:30 GMT+0100 (CET)"},"18545":{"varMapping":{"__isSmartRef__":true,"id":18546},"source":"function displaySourceForScript(scriptName) {\n var code = \"\",\n that = this;\n if (scriptName === null) {\n this.sortedScriptNamesOfObj(this.target).forEach(function(each) {\n code = code.concat(that.generateSourceForScript(each)).concat(\"\\n\\n\\n\");\n });\n code = code.substring(0, code.length - \"\\n\\n\\n\".length - 1);\n } else {\n code = this.generateSourceForScript(scriptName); \n }\n this.displayJavaScriptSource(code);\n}","funcProperties":{"__isSmartRef__":true,"id":18547},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18546":{"this":{"__isSmartRef__":true,"id":16931}},"18547":{"timestamp":{"__isSmartRef__":true,"id":18548},"user":"lauritz","tags":[]},"18548":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:51:37 GMT+0100 (CET)"},"18549":{"varMapping":{"__isSmartRef__":true,"id":18550},"source":"function generateSourceForConnection(connection) {\n var c = connection, targetObject = this.target;\n\tif (!c.getTargetObj() || !c.getTargetObj().name || \n\t\t!c.getSourceObj() || !c.getSourceObj().name) return String(c);\n\n\tvar optConfig = []\n\tif (c.converterString)\n\t\toptConfig.push(\"converter: \\n\\t\" + c.converterString)\n\tif (c.updaterString)\n\t\toptConfig.push(\"updater: \\n\\t\" + c.updaterString)\n\treturn Strings.format('connect(%s, \"%s\", %s, \"%s\", {%s});', \n\t\t\tthis.generateTargetCode(targetObject, c.getSourceObj()),\n\t\t\tc.getSourceAttrName(),\n\t\t\tthis.generateTargetCode(targetObject, c.getTargetObj()),\n\t\t\tc.getTargetMethodName(),\n\t\t\toptConfig.join(','));\n\n}","funcProperties":{"__isSmartRef__":true,"id":18551},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18550":{"this":{"__isSmartRef__":true,"id":16931}},"18551":{"timestamp":{"__isSmartRef__":true,"id":18552},"user":"lauritz","tags":[]},"18552":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:59:26 GMT+0100 (CET)"},"18553":{"varMapping":{"__isSmartRef__":true,"id":18554},"source":"function generateSourceForScript(scriptName) {\n var script = this.target[scriptName],\n annotation = '',\n scriptSource = '',\n tagScript = '';\n\n if (script.timestamp && script.user) \n annotation = Strings.format('// changed at %s by %s \\n', script.timestamp, script.user);\n scriptSource = Strings.format('this.addScript(%s)', script.getOriginal());\n tagScript = Strings.format('.tag(%s);', this.printTags(script));\n\n return annotation + scriptSource + tagScript;\n}","funcProperties":{"__isSmartRef__":true,"id":18555},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18554":{"this":{"__isSmartRef__":true,"id":16931}},"18555":{"timestamp":{"__isSmartRef__":true,"id":18556},"user":"lauritz","tags":[]},"18556":{"isSerializedDate":true,"string":"Tue Nov 29 2011 04:32:42 GMT+0100 (CET)"},"18557":{"varMapping":{"__isSmartRef__":true,"id":18558},"source":"function generateTargetCode(baseObject, targetObject) {\n\tvar name = targetObject.name;\n\tif (baseObject === targetObject) \n\t\treturn \"this\";\n\telse if (baseObject[name] === targetObject) \n\t\treturn \"this.\" + name;\n\telse if (baseObject.testObject === targetObject) \n\t\treturn \"this.testObject\";\n\telse if (baseObject.get(name) === targetObject) \n\t\treturn 'this.get(\"' + name + '\")';\n\telse if (targetObject instanceof Morph) \n\t\treturn '$morph(\"' + name + '\")';\n\telse \n\t\treturn \"????\";\n}","funcProperties":{"__isSmartRef__":true,"id":18559},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18558":{"this":{"__isSmartRef__":true,"id":16931}},"18559":{"timestamp":{"__isSmartRef__":true,"id":18560},"user":"lauritz","tags":[]},"18560":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:59:26 GMT+0100 (CET)"},"18561":{"varMapping":{"__isSmartRef__":true,"id":18562},"source":"function newConnection() {\n if (this.target) {\n var code = \"connect(SOURCE, SOURCE_PROPERTY, TARGET, TARGET_PROPERTY);\";\n this.displayJavaScriptSource(code);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18563},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18562":{"this":{"__isSmartRef__":true,"id":16931}},"18563":{"timestamp":{"__isSmartRef__":true,"id":18564},"user":"lauritz","tags":[]},"18564":{"isSerializedDate":true,"string":"Thu Nov 17 2011 04:59:26 GMT+0100 (CET)"},"18565":{"varMapping":{"__isSmartRef__":true,"id":18566},"source":"function newScript() {\n if (this.target) {\n var code = \"this.addScript(function SCRIPTNAME() {\\n \\n}).tag([]);\";\n this.displayJavaScriptSource(code);\n }\n}","funcProperties":{"__isSmartRef__":true,"id":18567},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18566":{"this":{"__isSmartRef__":true,"id":16931}},"18567":{"timestamp":{"__isSmartRef__":true,"id":18568},"user":"lauritz","tags":[]},"18568":{"isSerializedDate":true,"string":"Tue Nov 29 2011 04:24:25 GMT+0100 (CET)"},"18569":{"varMapping":{"__isSmartRef__":true,"id":18570},"source":"function reset() {\n this.scriptPane = this.get('ObjectEditorScriptPane')\n this.scriptList = this.get('ObjectEditorScriptList')\n this.connectionList = this.get('ObjectEditorConnectionList')\n this.morphSelector = this.get('ObjectEditorMorphSelector')\n this.target = null;\n this.scriptPane.reset();\n this.scriptList.setList();\n this.scriptList.selection = null;\n this.connectionList.setList();\n this.connectionList.selection = null;\n this.morphSelector.reset();\n this.tagChooser.reset();\n this.currentTag = null;\n this.stopStepping();\n}","funcProperties":{"__isSmartRef__":true,"id":18571},"__SourceModuleName__":"Global.lively.lang.Closure","__LivelyClassName__":"lively.Closure"},"18570":{"this":{"__isSmartRef__":true,"id":16931}},"18571":{"timestamp":{"__isSmartRef__":true,"id":18572},"user":"conradcalmez","tags":[]},"18572":{"isSerializedDate":true,"string":"Thu Feb 02 2012 14:57:50 GMT+0100 (CET)"},"18573":{"varMapping":{"__isSmartRef__":true,"id":18574},"source":"function selectChangedContent(source) {\n\n var addScriptRegex = /this\\.addScript\\s*\\(\\s*function\\s*([^\\(]*)/g;\n var addScriptMatches = [];\n var addScriptMatch = addScriptRegex.exec(source);\n while (addScriptMatch) {\n addScriptMatches.push(addScriptMatch[1]);\n addScriptMatch = addScriptRegex.exec(source);\n }\n \n // if scripts were added, select either a specific one or all\n if (addScriptMatches.length > 0) { \n if (addScriptMatches.length === 1) {\n return this.scriptList.selectAddedScript(addScriptMatches[0]);\n }\n return this.scriptList.selectAt(0);\n }\n\n var connectionRegex = \n /connect\\(\\s*([^,]*)\\s*,\\s*\"([^,]*)\"\\s*,\\s*([^,]*)\\s*,\\s*\"([^,]*)\"/g;\n var connectionMatches = [];\n var connectionMatch = connectionRegex.exec(source);\n while (connectionMatch) {\n connectionMatches.push(connectionMatch);\n connectionMatch = connectionRegex.exec(source);\n }\n\n // if connections were made, select either a specific one or all\n if (connectionMatches.length > 0) {\n if (connectionMatches.length === 1) {\n var match = connectionMatches[0];\n for (var i=0; i