|
7 | 7 | } else { |
8 | 8 | pzpr.classmgr.makeCustom(pidlist, classbase); |
9 | 9 | } |
10 | | -})(["loute", "sashigane", "sashikazune"], { |
| 10 | +})(["loute", "sashigane", "sashikazune", "sashikabe"], { |
11 | 11 | //--------------------------------------------------------- |
12 | 12 | // マウス入力系 |
13 | 13 | "MouseEvent@loute": { |
| 14 | + autoplay_func: "border", |
14 | 15 | inputModes: { |
15 | 16 | edit: ["arrow", "circle-unshade", "undef", "clear"], |
16 | 17 | play: ["border", "subline"] |
17 | 18 | } |
18 | 19 | }, |
19 | 20 | "MouseEvent@sashigane": { |
| 21 | + autoplay_func: "border", |
20 | 22 | inputModes: { |
21 | 23 | edit: ["arrow", "number", "undef", "clear"], |
22 | 24 | play: ["border", "subline"] |
23 | | - }, |
| 25 | + } |
| 26 | + }, |
| 27 | + "MouseEvent@sashikabe": { |
| 28 | + use: true, |
| 29 | + autoplay_func: "cell", |
| 30 | + inputModes: { |
| 31 | + edit: ["arrow", "number", "undef", "clear", "info-blk"], |
| 32 | + play: ["shade", "unshade", "info-blk"] |
| 33 | + } |
| 34 | + }, |
| 35 | + "MouseEvent@loute,sashigane,sashikabe#1": { |
24 | 36 | mouseinput_number: function() { |
25 | 37 | if (this.mousestart) { |
26 | 38 | this.inputqnum_loute(); |
27 | 39 | } |
28 | | - } |
29 | | - }, |
30 | | - "MouseEvent@loute,sashigane#1": { |
| 40 | + }, |
31 | 41 | mouseinput: function() { |
32 | 42 | // オーバーライド |
33 | 43 | if (this.inputMode === "undef" || this.inputMode === "circle-unshade") { |
|
38 | 48 | this.common.mouseinput.call(this); |
39 | 49 | } |
40 | 50 | }, |
41 | | - mouseinput_auto: function() { |
42 | | - if (this.puzzle.playmode) { |
43 | | - if (this.mousestart || this.mousemove) { |
44 | | - if (this.btn === "left" && this.isBorderMode()) { |
45 | | - this.inputborder(); |
46 | | - } else { |
47 | | - this.inputQsubLine(); |
48 | | - } |
49 | | - } |
50 | | - } else if (this.puzzle.editmode) { |
51 | | - if (this.mousestart || this.mousemove) { |
52 | | - this.inputarrow_cell(); |
53 | | - } else if (this.mouseend && this.notInputted()) { |
54 | | - this.inputqnum_loute(); |
55 | | - } |
| 51 | + mouseinputAutoEdit: function() { |
| 52 | + if (this.mousestart || this.mousemove) { |
| 53 | + this.inputarrow_cell(); |
| 54 | + } else if (this.mouseend && this.notInputted()) { |
| 55 | + this.inputqnum_loute(); |
56 | 56 | } |
57 | 57 | }, |
58 | 58 |
|
|
157 | 157 | KeyEvent: { |
158 | 158 | enablemake: true |
159 | 159 | }, |
160 | | - "KeyEvent@loute,sashigane": { |
| 160 | + "KeyEvent@loute,sashigane,sashikabe": { |
161 | 161 | moveTarget: function(ca) { |
162 | 162 | if (ca.match(/shift/)) { |
163 | 163 | return false; |
|
172 | 172 |
|
173 | 173 | if (this.pid === "loute") { |
174 | 174 | this.key_arrow_loute(ca); |
175 | | - } else if (this.pid === "sashigane") { |
| 175 | + } else { |
176 | 176 | this.key_inputqnum_sashigane(ca); |
177 | 177 | } |
178 | 178 | }, |
|
251 | 251 | //--------------------------------------------------------- |
252 | 252 | // 盤面管理系 |
253 | 253 | Cell: { |
| 254 | + allowShade: function() { |
| 255 | + return !this.qdir; |
| 256 | + }, |
| 257 | + allowUnshade: function() { |
| 258 | + return !this.qdir; |
| 259 | + }, |
| 260 | + |
254 | 261 | maxnum: function() { |
255 | 262 | var bd = this.board, |
256 | 263 | bx = this.bx, |
|
269 | 276 | return this.qdir === 5; |
270 | 277 | } |
271 | 278 | }, |
| 279 | + "Cell@sashikabe": { |
| 280 | + posthook: { |
| 281 | + qdir: function(num) { |
| 282 | + if (num) { |
| 283 | + this.setQans(0); |
| 284 | + this.setQsub(0); |
| 285 | + } |
| 286 | + } |
| 287 | + } |
| 288 | + }, |
272 | 289 | "Cell@sashikazune": { |
273 | 290 | minnum: 1, |
274 | 291 | maxnum: function() { |
|
280 | 297 | cols: 8, |
281 | 298 | rows: 8, |
282 | 299 |
|
283 | | - hasborder: 1 |
| 300 | + hasborder: 1, |
| 301 | + addExtraInfo: function() { |
| 302 | + this.lgraph = this.addInfoList(this.klass.AreaLGraph); |
| 303 | + } |
284 | 304 | }, |
285 | | - "BoardExec@loute,sashigane": { |
| 305 | + "BoardExec@loute,sashigane,sashikabe": { |
286 | 306 | adjustBoardData: function(key, d) { |
287 | 307 | this.adjustNumberArrow(key, d); |
288 | 308 | } |
289 | 309 | }, |
290 | 310 |
|
291 | | - AreaRoomGraph: { |
| 311 | + "AreaShadeGraph@sashikabe": { |
292 | 312 | enabled: true, |
| 313 | + coloring: true |
| 314 | + }, |
| 315 | + "AreaLGraph:AreaUnshadeGraph@sashikabe#1": { |
| 316 | + enabled: true |
| 317 | + }, |
| 318 | + "AreaLGraph:AreaRoomGraph@loute,sashigane,sashikazune#1": { |
| 319 | + enabled: true |
| 320 | + }, |
| 321 | + |
| 322 | + "AreaLGraph#3": { |
| 323 | + getComponentRefs: function(obj) { |
| 324 | + return obj.lcomp; |
| 325 | + }, // getSideAreaInfo用 |
| 326 | + setComponentRefs: function(obj, component) { |
| 327 | + obj.lcomp = component; |
| 328 | + }, |
| 329 | + getObjNodeList: function(nodeobj) { |
| 330 | + return nodeobj.lcompnodes; |
| 331 | + }, |
| 332 | + resetObjNodeList: function(nodeobj) { |
| 333 | + nodeobj.lcompnodes = []; |
| 334 | + }, |
293 | 335 |
|
294 | 336 | // オーバーライド |
295 | 337 | resetExtraData: function(cell) { |
|
306 | 348 | var subclist = this.board |
307 | 349 | .cellinside(d.x1, d.y1, d.x2, d.y2) |
308 | 350 | .filter(function(cell) { |
309 | | - return cell.room !== component; |
| 351 | + return cell.lcomp !== component; |
310 | 352 | }); |
311 | 353 | var dl = subclist.getRectSize(); |
312 | 354 | if ( |
|
357 | 399 | } |
358 | 400 | }, |
359 | 401 |
|
360 | | - "AreaRoomGraph@sashikazune": { |
| 402 | + "AreaLGraph@sashikazune#2": { |
361 | 403 | setCellPlaces: function(clist, d, dl) { |
362 | 404 | var bd = this.board; |
363 | 405 | var corner = null; |
|
396 | 438 | paint: function() { |
397 | 439 | this.drawBGCells(); |
398 | 440 | this.drawDashedGrid(); |
399 | | - this.drawBorders(); |
| 441 | + if (this.pid === "sashikabe") { |
| 442 | + this.drawShadedCells(); |
| 443 | + this.drawDotCells(); |
| 444 | + } else { |
| 445 | + this.drawBorders(); |
| 446 | + } |
400 | 447 |
|
401 | 448 | this.drawCellArrows(); |
402 | 449 | this.drawHatenas_loute(); |
403 | | - if (this.pid === "sashigane") { |
| 450 | + if (this.pid === "sashigane" || this.pid === "sashikabe") { |
404 | 451 | this.drawCircledNumbers(); |
405 | 452 | } else if (this.pid === "loute") { |
406 | 453 | this.drawCircles(); |
|
553 | 600 | this.outbstr += cm; |
554 | 601 | } |
555 | 602 | }, |
556 | | - "Encode@sashigane": { |
| 603 | + "Encode@sashigane,sashikabe": { |
557 | 604 | decodePzpr: function(type) { |
558 | 605 | this.decodeSashigane(); |
559 | 606 | }, |
|
651 | 698 | } |
652 | 699 | } else if (ca === "-") { |
653 | 700 | cell.qdir = -2; |
| 701 | + } else if (ca === "#") { |
| 702 | + cell.qans = 1; |
| 703 | + } else if (ca === "_") { |
| 704 | + cell.qsub = 1; |
654 | 705 | } else if (ca !== ".") { |
655 | 706 | cell.qdir = +ca; |
656 | 707 | } |
657 | 708 | }); |
658 | 709 |
|
659 | | - this.decodeBorderAns(); |
| 710 | + if (this.pid !== "sashikabe") { |
| 711 | + this.decodeBorderAns(); |
| 712 | + } |
660 | 713 | }, |
661 | 714 | encodeData: function() { |
662 | 715 | var pid = this.pid; |
663 | 716 | this.encodeCell(function(cell) { |
664 | | - if (pid === "sashigane" && cell.qdir === 5) { |
| 717 | + if ((pid === "sashigane" || pid === "sashikabe") && cell.qdir === 5) { |
665 | 718 | return "o" + (cell.qnum !== -1 ? cell.qnum : "") + " "; |
666 | 719 | } else if (cell.qdir === -2) { |
667 | 720 | return "- "; |
668 | 721 | } else if (cell.qdir !== 0) { |
669 | 722 | return cell.qdir + " "; |
| 723 | + } else if (cell.qsub) { |
| 724 | + return "_ "; |
| 725 | + } else if (cell.qans) { |
| 726 | + return "# "; |
670 | 727 | } else { |
671 | 728 | return ". "; |
672 | 729 | } |
673 | 730 | }); |
674 | 731 |
|
675 | | - this.encodeBorderAns(); |
| 732 | + if (pid !== "sashikabe") { |
| 733 | + this.encodeBorderAns(); |
| 734 | + } |
676 | 735 | } |
677 | 736 | }, |
678 | 737 | "FileIO@sashikazune": { |
|
692 | 751 | // 正解判定処理実行部 |
693 | 752 | AnsCheck: { |
694 | 753 | checklist: [ |
| 754 | + "check2x2ShadeCell@sashikabe", |
695 | 755 | "checkArrowCorner1", |
696 | 756 | "checkArrowCorner2", |
697 | 757 | "checkCircleCorner", |
698 | | - "checkNumberAndSize+@sashigane", |
699 | | - "checkBorderDeadend", |
700 | | - "checkLblock" |
| 758 | + "checkNumberAndSize+@sashigane,sashikabe", |
| 759 | + "checkBorderDeadend@!sashikabe", |
| 760 | + "checkLblock", |
| 761 | + "checkConnectShade@sashikabe", |
| 762 | + "doneShadingDecided@sashikabe" |
701 | 763 | ], |
702 | 764 |
|
| 765 | + checkNumberAndSize: function() { |
| 766 | + this.checkAllArea( |
| 767 | + this.board.lgraph, |
| 768 | + function(w, h, a, n) { |
| 769 | + return n <= 0 || n === a; |
| 770 | + }, |
| 771 | + "bkSizeNe" |
| 772 | + ); |
| 773 | + }, |
| 774 | + |
703 | 775 | checkArrowCorner1: function() { |
704 | | - var rooms = this.board.roommgr.components; |
| 776 | + var rooms = this.board.lgraph.components; |
705 | 777 | allloop: for (var id = 0; id < rooms.length; id++) { |
706 | 778 | if (rooms[id].shape === 0) { |
707 | 779 | continue; |
|
726 | 798 | }, |
727 | 799 |
|
728 | 800 | checkArrowCorner2: function() { |
729 | | - var rooms = this.board.roommgr.components; |
| 801 | + var rooms = this.board.lgraph.components; |
730 | 802 | allloop: for (var id = 0; id < rooms.length; id++) { |
731 | 803 | if (rooms[id].shape === 0) { |
732 | 804 | continue; |
|
761 | 833 | }, |
762 | 834 |
|
763 | 835 | checkCircleCorner: function() { |
764 | | - var rooms = this.board.roommgr.components; |
| 836 | + var rooms = this.board.lgraph.components; |
765 | 837 | allloop: for (var id = 0; id < rooms.length; id++) { |
766 | 838 | if (rooms[id].shape === 0) { |
767 | 839 | continue; |
|
785 | 857 | }, |
786 | 858 |
|
787 | 859 | checkLblock: function() { |
788 | | - var rooms = this.board.roommgr.components; |
| 860 | + var rooms = this.board.lgraph.components; |
789 | 861 | for (var id = 0; id < rooms.length; id++) { |
790 | 862 | if (rooms[id].shape !== 0) { |
791 | 863 | continue; |
|
799 | 871 | } |
800 | 872 | } |
801 | 873 | }, |
| 874 | + "AnsCheck@sashikabe": { |
| 875 | + checkArrowCorner2: function() { |
| 876 | + this.checkAllCell(function(cell) { |
| 877 | + var dir = cell.getObjNum(); |
| 878 | + if (dir < 1 || dir > 4) { |
| 879 | + return false; |
| 880 | + } |
| 881 | + |
| 882 | + var next = cell |
| 883 | + .getaddr() |
| 884 | + .movedir(dir, 2) |
| 885 | + .getc(); |
| 886 | + return next.isnull || next.isShade(); |
| 887 | + }, "arNotPtCnr"); |
| 888 | + } |
| 889 | + }, |
802 | 890 | "AnsCheck@sashikazune": { |
803 | 891 | checklist: [ |
804 | 892 | "checkNumberDistance", |
|
817 | 905 |
|
818 | 906 | checkNumber3Count: function() { |
819 | 907 | this.checkAllBlock( |
820 | | - this.board.roommgr, |
| 908 | + this.board.lgraph, |
821 | 909 | function(cell) { |
822 | 910 | return cell.isNum() && cell.place !== 0; |
823 | 911 | }, |
|
0 commit comments