{"id":0,"registry":{"0":{"submorphs":[{"__isSmartRef__":true,"id":1}],"scripts":[],"id":"4B914A36-35C8-442D-A08C-B7F46E23F67D","shape":{"__isSmartRef__":true,"id":16},"__layered_droppingEnabled__":true,"halosEnabled":true,"registeredForMouseEvents":true,"showsHalos":false,"name":"MinesweeperSquare","partsBinMetaInfo":{"__isSmartRef__":true,"id":17},"eventHandler":{"__isSmartRef__":true,"id":38},"derivationIds":[127,"F0291F62-F100-480C-AEBF-0230398F7983","AE8B5ED7-E305-45BC-BE4A-1C28A49EE12B","39BA345C-17FA-45A0-BAC2-F0CF5654ACF8","FE91EA31-D8AE-461B-8A49-95DA5FBAE5B4","F38439A3-2F4E-4AC2-BF73-2633C00B1393","6748F5B5-2284-4748-A6EE-F1A261CBAD0B","BBAFB862-93AE-4F89-BCFF-9F1C67B7FE4C","7EC17E78-593A-4CC8-B7E3-859BCBBFE785","BD8BECDB-A9A1-4009-B433-C925F0AFCCFC","F2677A9D-5855-4DF2-B248-94545B34B762","D52188B3-7DC0-410E-96B1-50892AC00A37","1C17567C-751A-447E-A93C-0CE8CAEEF262","C31986AF-AB07-427F-BD76-E0F3859AC975","E11AD032-3154-420F-9409-22DBF6EC07A1"],"partTests":{"__isSmartRef__":true,"id":39},"_ClipMode":"visible","moved":true,"droppingEnabled":true,"_Rotation":0,"_Scale":1,"bombMorph":{"__isSmartRef__":true,"id":44},"flagShowing":false,"neighborCountMorph":{"__isSmartRef__":true,"id":1},"isRevealed":false,"hasBomb":false,"_Visible":true,"__serializedExpressions__":["_Position","distanceToDragEvent"],"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":49},"__LivelyClassName__":"lively.morphic.Box","__SourceModuleName__":"Global.lively.morphic.Core","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(29.0,-19.0)"},"1":{"submorphs":[],"scripts":[],"id":"57A3FDFA-C81D-4873-8929-ED898506BA6D","shape":{"__isSmartRef__":true,"id":2},"grabbingEnabled":false,"droppingEnabled":false,"halosEnabled":true,"fixedWidth":true,"fixedHeight":true,"allowsInput":true,"_FontFamily":"Arial, sans-serif","registeredForMouseEvents":true,"_MaxTextWidth":120.695652,"_MaxTextHeight":null,"showsHalos":false,"_FontSize":12,"name":"NeighborCount","partsBinMetaInfo":{"__isSmartRef__":true,"id":3},"textChunks":[{"__isSmartRef__":true,"id":12}],"charsReplaced":"Some Text","lastFindLoc":18,"prevScroll":[0,0],"eventHandler":{"__isSmartRef__":true,"id":14},"_ClipMode":"visible","derivationIds":[355,"1EB1674F-8BF2-419B-B054-86129ED70335","63698904-DC05-4341-A9B6-5CC4A219CD04","F6A714BA-4735-41ED-8A2A-45CB153FBDF8","F1D26890-7392-487D-B5DE-97C772B4E79E","59440FC5-E676-4B9B-A828-C150A05765C0","57692EB3-D337-4024-860E-2A102D74FDCD"],"_WhiteSpaceHandling":"pre-wrap","_MinTextWidth":120.695652,"_MinTextHeight":null,"previousSelection":[0,0],"isBeingDragged":false,"moved":true,"layout":{"__isSmartRef__":true,"id":15},"owner":{"__isSmartRef__":true,"id":0},"_Rotation":0,"_Scale":1,"_Visible":false,"_Align":"center","__serializedExpressions__":["_Position","textColor","_Padding","distanceToDragEvent"],"__LivelyClassName__":"lively.morphic.Text","__SourceModuleName__":"Global.lively.morphic.TextCore","_Position":"lively.pt(0.0,0.0)","textColor":"Color.rgb(0,0,0)","_Padding":"lively.rect(5,5,0,0)","distanceToDragEvent":"lively.pt(85.0,-9.0)"},"2":{"fill":null,"_BorderWidth":2,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_AppearanceStylingMode":false,"_BorderStylingMode":false,"__serializedExpressions__":["_Fill","_Position","_Extent","_BorderColor","_Padding"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","_Fill":"Color.rgb(255,255,255)","_Position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(25.0,25.0)","_BorderColor":"Color.rgb(0,0,0)","_Padding":"lively.rect(4,2,0,0)"},"3":{"partsSpaceName":"PartsBin/Basic/","migrationLevel":8,"comment":"a simple text morph","partName":"Text","changes":[{"__isSmartRef__":true,"id":4},{"__isSmartRef__":true,"id":5},{"__isSmartRef__":true,"id":6},{"__isSmartRef__":true,"id":7},{"__isSmartRef__":true,"id":8},{"__isSmartRef__":true,"id":9},{"__isSmartRef__":true,"id":10},{"__isSmartRef__":true,"id":11}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Sat Apr 05 2014 01:51:52 GMT-0700 (PDT)\")"},"4":{"author":"robertkrahn","message":"resizeWidth = true","id":"E402462A-7AB2-487B-82BD-A3369C1C1F75","__serializedExpressions__":["date"],"date":"new Date(\"Sat Apr 05 2014 01:58:52 GMT-0700 (PDT)\")"},"5":{"author":"jenslincke","message":"no comment","id":"9E495E1B-6E6D-4A89-9F9E-85AF618DC598","__serializedExpressions__":["date"],"date":"new Date(\"Tue Mar 12 2013 10:36:22 GMT-0700 (PDT)\")"},"6":{"author":"robertkrahn","message":"text click was broken?","id":"9D065E14-9653-4B2A-9A2E-3AD84EBBC3E0","__serializedExpressions__":["date"],"date":"new Date(\"Sat Apr 21 2012 07:30:30 GMT-0700 (PDT)\")"},"7":{"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","__serializedExpressions__":["date"],"date":"new Date(\"Sun Feb 26 2012 21:20:38 GMT-0800 (PST)\")"},"8":{"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"0F4DE333-A551-4961-B29D-70270977EBEF","__serializedExpressions__":["date"],"date":"new Date(\"Fri Apr 20 2012 22:31:43 GMT-0700 (PDT)\")"},"9":{"author":"tessi","message":"TextBubble calls its disappear() function after showBubbleTime() milliseconds now","id":"785D95BD-7858-43EB-90E6-A1C085E2F2B9","__serializedExpressions__":["date"],"date":"new Date(\"Fri Apr 20 2012 22:32:09 GMT-0700 (PDT)\")"},"10":{"author":"timfelgentreff","message":"better text","id":"B904F9AC-6EA0-4A8A-83C9-AFC85AADC194","__serializedExpressions__":["date"],"date":"new Date(\"Tue May 08 2012 05:18:18 GMT-0700 (PDT)\")"},"11":{"author":"jenslincke","message":"no comment","id":"A3BA0C1E-7E83-43BF-9EC6-4F4BB3835D62","__serializedExpressions__":["date"],"date":"new Date(\"Tue Mar 12 2013 09:31:56 GMT-0700 (PDT)\")"},"12":{"style":{"__isSmartRef__":true,"id":13},"chunkOwner":{"__isSmartRef__":true,"id":1},"_id":"_6017","storedString":"-","__LivelyClassName__":"lively.morphic.TextChunk","__SourceModuleName__":"Global.lively.morphic.TextCore"},"13":{"__LivelyClassName__":"lively.morphic.TextEmphasis","__SourceModuleName__":"Global.lively.morphic.TextCore"},"14":{"morph":{"__isSmartRef__":true,"id":1},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"15":{"resizeWidth":true},"16":{"_BorderWidth":1,"_ClipMode":"visible","_BorderRadius":0,"_Opacity":1,"_BorderStyle":"solid","_AppearanceStylingMode":false,"__serializedExpressions__":["position","_Extent","_BorderColor","_Fill","_Padding"],"__LivelyClassName__":"lively.morphic.Shapes.Rectangle","__SourceModuleName__":"Global.lively.morphic.Shapes","position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(25.0,25.0)","_BorderColor":"Color.rgb(0,0,0)","_Fill":"Color.rgb(0,0,204)","_Padding":"lively.rect(0,0,0,0)"},"17":{"partsSpaceName":"PartsBin/Rick/","comment":"A plain simple rectangle","migrationLevel":8,"partName":"MinesweeperSquare","changes":[{"__isSmartRef__":true,"id":18},{"__isSmartRef__":true,"id":19},{"__isSmartRef__":true,"id":20},{"__isSmartRef__":true,"id":21},{"__isSmartRef__":true,"id":22},{"__isSmartRef__":true,"id":23},{"__isSmartRef__":true,"id":24},{"__isSmartRef__":true,"id":25},{"__isSmartRef__":true,"id":26},{"__isSmartRef__":true,"id":27},{"__isSmartRef__":true,"id":28},{"__isSmartRef__":true,"id":29},{"__isSmartRef__":true,"id":30},{"__isSmartRef__":true,"id":31},{"__isSmartRef__":true,"id":32},{"__isSmartRef__":true,"id":33},{"__isSmartRef__":true,"id":34},{"__isSmartRef__":true,"id":35},{"__isSmartRef__":true,"id":36},{"__isSmartRef__":true,"id":37}],"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"18":{"author":"lauritz","message":"dropping enabled for the blue rectangle","id":"81D350CB-D926-491F-8FF3-A6C9C831BDF2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 12 2014 07:00:28 GMT-0700 (PDT)\")"},"19":{"author":"jenslincke","message":"no comment","id":"ECD12BFF-E872-4918-8341-C6571E72F36D","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:24:27 GMT-0800 (PST)\")"},"20":{"author":"robertkrahn","message":"no comment","id":"FBBB9C99-B61C-4D5F-8750-6E2987DF0C9C","__serializedExpressions__":["date"],"date":"new Date(\"Thu Jun 20 2013 15:16:24 GMT-0700 (PDT)\")"},"21":{"author":"robertkrahn","message":"no comment","id":"67FD74CD-7AE4-4050-ADC7-4DF73804258D","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 30 2013 00:18:06 GMT-0700 (PDT)\")"},"22":{"author":"jenslincke","message":"no comment","id":"AEB2F41B-2C88-4BBA-8875-93CD17CBA1C8","__serializedExpressions__":["date"],"date":"new Date(\"Wed Jan 23 2013 03:57:18 GMT-0800 (PST)\")"},"23":{"author":"undefined","message":"whoopsie","id":"3F17A2D2-3C24-424B-B0FA-E43112267D23","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:36 GMT-0700 (PDT)\")"},"24":{"author":"undefined","message":"whoopsie","id":"CEA5DCD5-2DB7-40AD-A776-262A7A0666FC","__serializedExpressions__":["date"],"date":"new Date(\"Thu May 03 2012 06:51:30 GMT-0700 (PDT)\")"},"25":{"author":"undefined","message":"sorry","id":"44B56D2E-9B59-4C67-A305-49A6E10E66C2","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:53:45 GMT-0700 (PDT)\")"},"26":{"author":"fbo","message":"","id":"BD1C654D-9100-4B66-BC62-B15FF2498B2B","__serializedExpressions__":["date"],"date":"new Date(\"Fri Feb 24 2012 17:59:09 GMT-0800 (PST)\")"},"27":{"author":"undefined","message":"css transitions","id":"1004E0FC-D96B-4F40-B3E0-F514A3FCFFD7","__serializedExpressions__":["date"],"date":"new Date(\"Wed Mar 14 2012 02:42:26 GMT-0700 (PDT)\")"},"28":{"author":"undefined","message":"suddenly, the rectangle became a CarDemo","id":"B5083AA8-9BAE-48DD-A6B4-FD7DB3998350","__serializedExpressions__":["date"],"date":"new Date(\"Mon Apr 09 2012 04:42:07 GMT-0700 (PDT)\")"},"29":{"author":"bgnauk","message":"no comment","id":"0124E570-50B7-4CE3-83A1-6E7BA89B5CD8","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jun 18 2012 10:35:08 GMT-0700 (PDT)\")"},"30":{"author":"jenslincke","message":"I want my blue rectangle back!","id":"5AA9291A-869F-4D36-8095-4721B5A5B205","__serializedExpressions__":["date"],"date":"new Date(\"Thu Nov 22 2012 01:35:51 GMT-0800 (PST)\")"},"31":{"author":"jenslincke","message":"no comment","id":"A4B86A7E-A398-4C29-BEE0-4AA045ABABD2","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:42:31 GMT-0800 (PST)\")"},"32":{"author":"jenslincke","message":"added legend","id":"7ADA3049-56C1-4D32-874B-F664A79DDB20","__serializedExpressions__":["date"],"date":"new Date(\"Fri Jan 18 2013 07:47:05 GMT-0800 (PST)\")"},"33":{"author":"SAPLivelyScreen","message":"no comment","id":"EF145198-0649-41BD-A92E-521D98FEC49D","__serializedExpressions__":["date"],"date":"new Date(\"Wed May 29 2013 15:36:50 GMT-0700 (PDT)\")"},"34":{"author":"SAPLivelyScreen","message":"no comment","id":"7A44D8CA-6D5F-42A3-A4B4-4D7F51EECA52","__serializedExpressions__":["date"],"date":"new Date(\"Tue Jun 18 2013 11:49:27 GMT-0700 (PDT)\")"},"35":{"author":"robertkrahn","message":"no comment","id":"A452871F-4EB9-45D1-94B8-6065CBA7B8FD","__serializedExpressions__":["date"],"date":"new Date(\"Mon Jul 29 2013 23:20:51 GMT-0700 (PDT)\")"},"36":{"author":"jenslincke","message":"no comment","id":"ADFBF069-513C-4DE6-95A9-8AD4985C6508","__serializedExpressions__":["date"],"date":"new Date(\"Tue Feb 04 2014 01:23:53 GMT-0800 (PST)\")"},"37":{"__serializedExpressions__":["date"],"author":"rick","message":"no comment","id":"9E975587-9840-4971-A6C1-FB8D534FAA58","date":"new Date(\"Mon Aug 18 2014 09:27:03 GMT-0700 (PDT)\")"},"38":{"morph":{"__isSmartRef__":true,"id":0},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"39":{"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":40}},"40":{"test01IsMorph":{"__isSmartRef__":true,"id":41}},"41":{"varMapping":{"__isSmartRef__":true,"id":42},"source":"function test01IsMorph(aPart) {\n    this.assert(aPart.isMorph, 'rectangle should be a morph');\n}","funcProperties":{"__isSmartRef__":true,"id":43},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"42":{"this":{"__isSmartRef__":true,"id":39}},"43":{},"44":{"submorphs":[],"scripts":[],"shape":{"__isSmartRef__":true,"id":45},"_ClipMode":"visible","derivationIds":["F607CA31-D992-4971-94C9-88FED6D4A029","1B31AED1-3F5F-4147-B985-56A6FF83F89D","FD29950F-C95B-4559-A09B-7D0AC788A192","487D539C-B6AC-4844-8BDE-85EF6A3BC36F"],"id":"878A393D-E1FE-4685-B18C-F6D689C1A32C","droppingEnabled":false,"halosEnabled":false,"eventHandler":{"__isSmartRef__":true,"id":46},"name":"Bomb","showsHalos":false,"_Visible":false,"partsBinMetaInfo":{"__isSmartRef__":true,"id":47},"_Rotation":0,"_Scale":1,"owner":null,"draggingEnabled":false,"grabbingEnabled":false,"__serializedExpressions__":["_Position","distanceToDragEvent"],"__LivelyClassName__":"lively.morphic.Image","__SourceModuleName__":"Global.lively.morphic.Widgets","_Position":"lively.pt(0.0,0.0)","distanceToDragEvent":"lively.pt(279.0,-14.0)"},"45":{"_ImageURL":"http://www.public-domain-photos.com/free-cliparts-1-big/tools/weapons/bomb_01.png","_BorderWidth":0,"_BorderColor":null,"_Fill":null,"isLoaded":true,"__serializedExpressions__":["_Position","_Extent","_Padding"],"__LivelyClassName__":"lively.morphic.Shapes.Image","__SourceModuleName__":"Global.lively.morphic.Shapes","_Position":"lively.pt(0.0,0.0)","_Extent":"lively.pt(25.0,25.0)","_Padding":"lively.rect(0,0,0,0)"},"46":{"morph":{"__isSmartRef__":true,"id":44},"__LivelyClassName__":"lively.morphic.EventHandler","__SourceModuleName__":"Global.lively.morphic.Events"},"47":{"partName":"Bomb","requiredModules":[],"partsSpaceName":"PartsBin/Rick/","comment":"no comment","changes":[{"__isSmartRef__":true,"id":48}],"migrationLevel":8,"__serializedExpressions__":["lastModifiedDate"],"__LivelyClassName__":"lively.PartsBin.PartsBinMetaInfo","__SourceModuleName__":"Global.lively.PartsBin","lastModifiedDate":"new Date(\"Sun Aug 17 2014 15:00:34 GMT-0700 (PDT)\")"},"48":{"author":"rick","message":"no comment","id":"B9451626-ABA4-49A0-AAF3-8664F5FF8ED6","__serializedExpressions__":["date"],"date":"new Date(\"Sun Aug 17 2014 15:00:40 GMT-0700 (PDT)\")"},"49":{"addBomb":{"__isSmartRef__":true,"id":50},"clearFlag":{"__isSmartRef__":true,"id":53},"countNeighborBombs":{"__isSmartRef__":true,"id":56},"fixSubmorph":{"__isSmartRef__":true,"id":59},"initAppearance":{"__isSmartRef__":true,"id":62},"initMorphs":{"__isSmartRef__":true,"id":65},"initNeighborsAndCount":{"__isSmartRef__":true,"id":68},"isClosed":{"__isSmartRef__":true,"id":71},"neighborPoints":{"__isSmartRef__":true,"id":74},"onMouseDown":{"__isSmartRef__":true,"id":77},"restoreGameAppearance":{"__isSmartRef__":true,"id":84},"reveal":{"__isSmartRef__":true,"id":87},"setCoordinates":{"__isSmartRef__":true,"id":90},"showBomb":{"__isSmartRef__":true,"id":93},"showDebugState":{"__isSmartRef__":true,"id":96},"showFlag":{"__isSmartRef__":true,"id":99},"showState":{"__isSmartRef__":true,"id":102},"copyImageMorph":{"__isSmartRef__":true,"id":105},"prepareToPublish":{"__isSmartRef__":true,"id":108}},"50":{"varMapping":{"__isSmartRef__":true,"id":51},"source":"function addBomb() {\n    this.hasBomb = true;\n    if (!this.bombMorph) {\n        this.bombMorph = this.copyImageMorph(this.get('Utilities').get('Bomb'), 'Bomb');\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":52},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"51":{"this":{"__isSmartRef__":true,"id":0}},"52":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:56:41 GMT-0700 (PDT)\")"},"53":{"varMapping":{"__isSmartRef__":true,"id":54},"source":"function clearFlag() {\n    this.flagMorph.setVisible(false);\n    this.flagShowing = false;\n}","funcProperties":{"__isSmartRef__":true,"id":55},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"54":{"this":{"__isSmartRef__":true,"id":0}},"55":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:09:57 GMT-0700 (PDT)\")"},"56":{"varMapping":{"__isSmartRef__":true,"id":57},"source":"function countNeighborBombs() {\n    this.neighborCount = this.neighbors.filter(function(sq) {return sq.hasBomb}).length\n    return this.neighborCount\n    \n}","funcProperties":{"__isSmartRef__":true,"id":58},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"57":{"this":{"__isSmartRef__":true,"id":0}},"58":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"59":{"varMapping":{"__isSmartRef__":true,"id":60},"source":"function fixSubmorph(aMorph) {\n    aMorph.disableDragging()\n    aMorph.disableDropping()\n    aMorph.disableGrabbing()\n    aMorph.disableHalos()\n}","funcProperties":{"__isSmartRef__":true,"id":61},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"60":{"this":{"__isSmartRef__":true,"id":0}},"61":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"62":{"varMapping":{"__isSmartRef__":true,"id":63},"source":"function initAppearance() {\n    this.setOpacity(1.0);\n    this.setFill(Global.Color.rgb(00,00,0xCC))\n    if (this.bombMorph) this.bombMorph.setVisible(false)\n    this.neighborCountMorph.setVisible(false);\n    if (this.flagMorph) this.flagMorph.setVisible(false)\n    this.flagShowing = false \n    this.isRevealed = false;\n    this.neighborCountMorph.setPosition(pt(0,0))\n    this.neighborCountMorph.setExtent(pt(25, 25))\n    this.neighborCountMorph.setFill(Global.Color.white)\n    this.neighborCountMorph.setFixedHeight(true);\n    this.neighborCountMorph.setFixedWidth(true);\n    this.neighborCountMorph.setAlign('center')\n    this.neighborCountMorph.setTextString('-')\n    \n}","funcProperties":{"__isSmartRef__":true,"id":64},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"63":{"this":{"__isSmartRef__":true,"id":0}},"64":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 18:21:16 GMT-0700 (PDT)\")"},"65":{"varMapping":{"__isSmartRef__":true,"id":66},"source":"function initMorphs(utilities) {\n    this.neighborCountMorph = this.get('NeighborCount')\n    this.utilities = utilities\n    var morphList = [this, this.neighborCountMorph, this.bombMorph, this.flagMorph]\n    morphList.forEach(function (aMorph) {\n        if (aMorph) {\n            this.fixSubmorph(aMorph)\n        }\n    }, this)\n    \n}","funcProperties":{"__isSmartRef__":true,"id":67},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"66":{"this":{"__isSmartRef__":true,"id":0}},"67":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:17:06 GMT-0700 (PDT)\")"},"68":{"varMapping":{"__isSmartRef__":true,"id":69},"source":"function initNeighborsAndCount() {\n    var neighborPoints = this.neighborPoints();\n    this.neighbors = neighborPoints.map(function(coord) {return this.owner.getSquare(coord)}, this)\n    this.countNeighborBombs()\n    \n}","funcProperties":{"__isSmartRef__":true,"id":70},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"69":{"this":{"__isSmartRef__":true,"id":0}},"70":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"71":{"varMapping":{"__isSmartRef__":true,"id":72},"source":"function isClosed() {\n    return !(this.isRevealed || this.hasBomb)\n}","funcProperties":{"__isSmartRef__":true,"id":73},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"72":{"this":{"__isSmartRef__":true,"id":0}},"73":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"74":{"varMapping":{"__isSmartRef__":true,"id":75},"source":"function neighborPoints() {\n    var myList = [-1, 0, 1]\n    var realOffsets = this.utilities.crossProduct(myList, myList).filter(function (aPoint) {return !aPoint.eqPt(pt(0, 0))})\n    var candidateNeighbors = realOffsets.map(function(offPoint) {return this.coordinates.addPt(offPoint)}, this)\n    return candidateNeighbors.filter(function(aPoint) {\n        return this.owner.onBoard(aPoint)\n    }, this)\n}","funcProperties":{"__isSmartRef__":true,"id":76},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"75":{"this":{"__isSmartRef__":true,"id":0}},"76":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"77":{"varMapping":{"__isSmartRef__":true,"id":78},"source":"function onMouseDown(evt) {\n    if (this.isRevealed) return;\n    if (evt.isRightMouseButtonDown()) {\n        if (this.flagShowing) {\n            this.clearFlag();\n        } else {\n            this.showFlag();\n        }\n        this.owner.checkWin()\n        return;\n    }\n    if (this.hasBomb) {\n        this.showBomb()\n        this.owner.hitBomb()\n    } else {\n        this.reveal();\n        this.owner.checkWin()\n    }\n    \n}","funcProperties":{"__isSmartRef__":true,"id":83},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"78":{"this":{"__isSmartRef__":true,"id":0},"__serializedLivelyClosures__":{"__isSmartRef__":true,"id":79}},"79":{"$super":{"__isSmartRef__":true,"id":80}},"80":{"varMapping":{"__isSmartRef__":true,"id":81},"source":"function () {\n                try {\n                    // FIXME super is supposed to be static\n                    return Object.getPrototypeOf(obj)[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":82},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"81":{"obj":{"__isSmartRef__":true,"id":0},"name":"onMouseDown"},"82":{},"83":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:17:40 GMT-0700 (PDT)\")"},"84":{"varMapping":{"__isSmartRef__":true,"id":85},"source":"function restoreGameAppearance() {\n    this.setOpacity(1.0);\n    this.setFill(Global.Color.rgb(00,00,0xCC))\n    if (this.isClosed()) {\n        if (this.flagShowing) this.showFlag();\n        this.neighborCountMorph.setVisible(false);\n        this.bombMorph.setVisible(false)\n    } else if (this.hasBomb) {\n        // minor bug -- if the game was lost before we called restoreGameAppearance,\n        // this will unlose it.  But this is only called for debugging anyway\n        this.bombMorph.setVisible(false)\n        this.neighborCountMorph.setVisible(false)\n        if(this.flagShowing) this.showFlag();\n    } else {\n        this.bombMorph.setVisible(false)\n        this.flagMorph.setVisible(false)\n        this.flagIsShowing = false\n        this.neighborCountMorph.setVisible(true);\n        this.neighborCountMorph.bringToFront();\n        if (this.neighborCount == 0) {\n            this.neighborCountMorph.setTextString('')\n        } else {\n            this.neighborCountMorph.setTextString(this.neighborCount);\n        }\n    }\n    \n}","funcProperties":{"__isSmartRef__":true,"id":86},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"85":{"this":{"__isSmartRef__":true,"id":0}},"86":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:21:19 GMT-0700 (PDT)\")"},"87":{"varMapping":{"__isSmartRef__":true,"id":88},"source":"function reveal() {\n    if (this.hasBomb) return;\n    if (this.isRevealed) return;\n    if (this.flagShowing) return;\n    this.isRevealed = true;\n    this.showState()\n    if (this.neighborCount == 0) {\n        this.neighbors.forEach(function(neighbor) {neighbor.reveal();});\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":89},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"88":{"this":{"__isSmartRef__":true,"id":0}},"89":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"90":{"varMapping":{"__isSmartRef__":true,"id":91},"source":"function setCoordinates(aPoint) {\n    this.coordinates = aPoint;\n}","funcProperties":{"__isSmartRef__":true,"id":92},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"91":{"this":{"__isSmartRef__":true,"id":0}},"92":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:02:37 GMT-0700 (PDT)\")"},"93":{"varMapping":{"__isSmartRef__":true,"id":94},"source":"function showBomb() {\n    if (!this.hasBomb) return;\n    this.bombMorph.setVisible(true)\n    if (this.flagMorph) this.flagMorph.setVisible(false)\n    this.flagShowing = false\n    this.isRevealed = true;\n    this.neighborCountMorph.setVisible(false)\n    \n}","funcProperties":{"__isSmartRef__":true,"id":95},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"94":{"this":{"__isSmartRef__":true,"id":0}},"95":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:23:20 GMT-0700 (PDT)\")"},"96":{"varMapping":{"__isSmartRef__":true,"id":97},"source":"function showDebugState() {\n    this.setOpacity(0.5);\n    if (!this.isClosed()) {\n        this.setFill(Global.Color.green)\n    }\n    if (this.hasBomb) {\n        this.bombMorph.setVisible(true)\n        this.bombMorph.bringToFront()\n        this.neighborCountMorph.setVisible(false);\n    } else {\n        if (this.bombMorph) {this.bombMorph.setVisible(false)}\n        this.neighborCountMorph.setVisible(true);\n        this.neighborCountMorph.bringToFront()\n        if (this.neighborCount == 0) {\n            this.neighborCountMorph.setTextString('')\n        } else if (this.neighborCount) {\n            this.neighborCountMorph.setTextString(this.neighborCount);\n        } else {\n            this.neighborCountMorph.setTextString('-')\n        }\n    }\n    \n}","funcProperties":{"__isSmartRef__":true,"id":98},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"97":{"this":{"__isSmartRef__":true,"id":0}},"98":{"__serializedExpressions__":["timestamp"],"user":"rick","timestamp":"new Date(\"Mon Aug 18 2014 09:07:56 GMT-0700 (PDT)\")"},"99":{"varMapping":{"__isSmartRef__":true,"id":100},"source":"function showFlag() {\n    if (!this.flagMorph) {\n        this.flagMorph = this.copyImageMorph(this.get('Utilities').get('Flag'), 'Flag');\n    }\n    this.flagMorph.setVisible(true);\n    this.flagMorph.bringToFront();\n    this.flagShowing = true;\n    \n}","funcProperties":{"__isSmartRef__":true,"id":101},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"100":{"this":{"__isSmartRef__":true,"id":0}},"101":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:57:50 GMT-0700 (PDT)\")"},"102":{"varMapping":{"__isSmartRef__":true,"id":103},"source":"function showState() {\n    if (this.flagMorph) {\n        this.flagMorph.setVisible(false)\n    }\n    this.flagShowing = false\n    if (this.hasBomb) {\n        this.bombMorph.setVisible(true)\n        this.neighborCountMorph.setVisible(false);\n    } else {\n        if (this.bombMorph) {\n            this.bombMorph.setVisible(false)\n        }\n        this.neighborCountMorph.setVisible(true);\n        this.neighborCountMorph.bringToFront()\n        if (this.neighborCount == 0) {\n            this.neighborCountMorph.setTextString('')\n        } else if (this.neighborCount) {\n            this.neighborCountMorph.setTextString(this.neighborCount);\n        }\n    }\n    \n}","funcProperties":{"__isSmartRef__":true,"id":104},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"103":{"this":{"__isSmartRef__":true,"id":0}},"104":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 18:17:33 GMT-0700 (PDT)\")"},"105":{"varMapping":{"__isSmartRef__":true,"id":106},"source":"function copyImageMorph(aForeignMorph, myName) {\n    var newMorph = aForeignMorph.copy();\n    newMorph.setName(myName)\n    this.addMorph(newMorph);\n    newMorph.setVisible(false);\n    newMorph.setPosition(pt(0, 0))\n    this.fixSubmorph(newMorph)\n    return newMorph\n}","funcProperties":{"__isSmartRef__":true,"id":107},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"106":{"this":{"__isSmartRef__":true,"id":0}},"107":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 17:55:52 GMT-0700 (PDT)\")"},"108":{"varMapping":{"__isSmartRef__":true,"id":109},"source":"function prepareToPublish() {\n    if (this.flagMorph) {\n        this.flagMorph.remove();\n        this.flagShowing = false;\n        this.flagMorph = undefined;\n    }\n    if (this.bombMorph) {\n        this.bombMorph.remove()\n        this.hasBomb = false;\n        this.flagMorph = undefined\n    }\n}","funcProperties":{"__isSmartRef__":true,"id":110},"__LivelyClassName__":"lively.Closure","__SourceModuleName__":"Global.lively.lang.Closure"},"109":{"this":{"__isSmartRef__":true,"id":0}},"110":{"user":"rick","__serializedExpressions__":["timestamp"],"timestamp":"new Date(\"Sun Aug 17 2014 18:02:05 GMT-0700 (PDT)\")"},"isSimplifiedRegistry":true}}