|
20 | 20 | "marutaring", |
21 | 21 | "tetroctb", |
22 | 22 | "bramble", |
23 | | - "disco" |
| 23 | + "disco", |
| 24 | + "anymino" |
24 | 25 | ], |
25 | 26 | { |
26 | 27 | //--------------------------------------------------------- |
|
46 | 47 | play: ["shade", "unshade", "info-blk"] |
47 | 48 | } |
48 | 49 | }, |
49 | | - "MouseEvent@disco": { |
| 50 | + "MouseEvent@disco,anymino": { |
50 | 51 | inputModes: { |
51 | 52 | edit: ["info-blk"], |
52 | 53 | play: ["shade", "unshade", "info-blk"] |
|
192 | 193 | }, |
193 | 194 |
|
194 | 195 | Board: { |
195 | | - hasborder: 1 |
196 | | - }, |
197 | | - "Board@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": { |
| 196 | + hasborder: 1, |
198 | 197 | addExtraInfo: function() { |
199 | 198 | this.stonegraph = this.addInfoList(this.klass.AreaStoneGraph); |
200 | 199 | } |
|
316 | 315 | "AreaShadeGraph@chocona,tetroctb,bramble": { |
317 | 316 | enabled: true |
318 | 317 | }, |
319 | | - "AreaShadeGraph@nuritwin,marutaring,disco": { |
| 318 | + "AreaShadeGraph@nuritwin,marutaring,disco,anymino": { |
320 | 319 | enabled: true, |
321 | 320 | coloring: true |
322 | 321 | }, |
|
328 | 327 | component.hinge = null; |
329 | 328 | } |
330 | 329 | }, |
331 | | - "AreaStoneGraph:AreaShadeGraph@shimaguni,stostone,heyablock,cocktail,martini,nuritwin,marutaring,tetroctb,disco": { |
| 330 | + "AreaStoneGraph:AreaShadeGraph": { |
332 | 331 | // Same as LITS AreaTetrominoGraph |
333 | 332 | enabled: true, |
334 | 333 | relation: { "cell.qans": "node", "border.ques": "separator" }, |
|
388 | 387 | this.drawGrid(); |
389 | 388 | } |
390 | 389 |
|
391 | | - if ( |
392 | | - this.pid === "stostone" || |
393 | | - this.pid === "nuritwin" || |
394 | | - this.pid === "disco" || |
395 | | - this.pid === "marutaring" |
396 | | - ) { |
| 390 | + if (this.irowakeblk) { |
397 | 391 | this.drawDotCells_stostone(); |
398 | 392 | } |
399 | 393 | this.drawShadedCells(); |
|
434 | 428 | ); |
435 | 429 | } |
436 | 430 | }, |
437 | | - "Graphic@stostone,nuritwin,marutaring,disco#1": { |
| 431 | + "Graphic@stostone,nuritwin,marutaring,disco,anymino#1": { |
438 | 432 | irowakeblk: true, |
439 | 433 | bgcellcolor_func: "error1", |
440 | 434 | bcolor: "rgb(80, 204, 80)", |
|
571 | 565 | this.encodeNumber16(); |
572 | 566 | } |
573 | 567 | }, |
574 | | - "Encode@disco": { |
| 568 | + "Encode@disco,anymino": { |
575 | 569 | decodePzpr: function(type) { |
576 | 570 | this.decodeBorder(); |
577 | 571 | }, |
|
603 | 597 | } |
604 | 598 | } |
605 | 599 | }, |
606 | | - "FileIO@disco": { |
| 600 | + "FileIO@disco,anymino": { |
607 | 601 | decodeData: function() { |
608 | 602 | this.decodeBorderQues(); |
609 | 603 | this.decodeCellAns(); |
|
708 | 702 | "doneShadingDecided" |
709 | 703 | ] |
710 | 704 | }, |
711 | | - "AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble": { |
| 705 | + "AnsCheck@anymino#1": { |
| 706 | + checklist: [ |
| 707 | + "checkShadeCellExist+", |
| 708 | + "check2x2ShadeCell", |
| 709 | + "checkSeqBlocksInRoom", |
| 710 | + "checkAdjacentShapes", |
| 711 | + "checkConnectShade", |
| 712 | + "checkHasAdjacentSize", |
| 713 | + "checkNoShadeCellInArea", |
| 714 | + "doneShadingDecided" |
| 715 | + ] |
| 716 | + }, |
| 717 | + "AnsCheck@shimaguni,stostone,heyablock,cocktail,martini,bramble,anymino": { |
712 | 718 | checkSideAreaShadeCell: function() { |
713 | 719 | this.checkSideAreaCell( |
714 | 720 | function(cell1, cell2) { |
|
1259 | 1265 | } |
1260 | 1266 | } |
1261 | 1267 | }, |
| 1268 | + "AnsCheck@anymino#3": { |
| 1269 | + checkHasAdjacentSize: function() { |
| 1270 | + var bd = this.board; |
| 1271 | + |
| 1272 | + var blocks = bd.stonegraph.components; |
| 1273 | + for (var r = 0; r < blocks.length; r++) { |
| 1274 | + blocks[r].valid = false; |
| 1275 | + } |
| 1276 | + |
| 1277 | + for (var c = 0; c < bd.cell.length; c++) { |
| 1278 | + var cell = bd.cell[c]; |
| 1279 | + var current = cell.stone; |
| 1280 | + if (!current) { |
| 1281 | + continue; |
| 1282 | + } |
| 1283 | + var right = cell.adjacent.right.stone; |
| 1284 | + var bottom = cell.adjacent.bottom.stone; |
| 1285 | + |
| 1286 | + if ( |
| 1287 | + right && |
| 1288 | + right !== current && |
| 1289 | + right.clist.length === current.clist.length |
| 1290 | + ) { |
| 1291 | + right.valid = true; |
| 1292 | + current.valid = true; |
| 1293 | + } |
| 1294 | + if ( |
| 1295 | + bottom && |
| 1296 | + bottom !== current && |
| 1297 | + bottom.clist.length === current.clist.length |
| 1298 | + ) { |
| 1299 | + bottom.valid = true; |
| 1300 | + current.valid = true; |
| 1301 | + } |
| 1302 | + } |
| 1303 | + |
| 1304 | + for (var r = 0; r < blocks.length; r++) { |
| 1305 | + if (!blocks[r].valid) { |
| 1306 | + this.failcode.add("bkNoChain"); |
| 1307 | + if (this.checkOnly) { |
| 1308 | + break; |
| 1309 | + } |
| 1310 | + blocks[r].clist.seterr(1); |
| 1311 | + } |
| 1312 | + } |
| 1313 | + }, |
| 1314 | + checkAdjacentShapes: function() { |
| 1315 | + var self = this; |
| 1316 | + |
| 1317 | + this.checkSideAreaCell( |
| 1318 | + function(cell1, cell2) { |
| 1319 | + return ( |
| 1320 | + cell1.isShade() && |
| 1321 | + cell2.isShade() && |
| 1322 | + !self.isDifferentShapeBlock(cell1.stone, cell2.stone) |
| 1323 | + ); |
| 1324 | + }, |
| 1325 | + true, |
| 1326 | + "bsSameShape" |
| 1327 | + ); |
| 1328 | + } |
| 1329 | + }, |
1262 | 1330 |
|
1263 | 1331 | FailCode: { |
1264 | 1332 | bkShadeDivide: "bkShadeDivide", |
|
0 commit comments