|
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, |
|
280 | 287 | cols: 8, |
281 | 288 | rows: 8, |
282 | 289 |
|
283 | | - hasborder: 1 |
| 290 | + hasborder: 1, |
| 291 | + addExtraInfo: function() { |
| 292 | + this.lgraph = this.addInfoList(this.klass.AreaLGraph); |
| 293 | + } |
284 | 294 | }, |
285 | | - "BoardExec@loute,sashigane": { |
| 295 | + "BoardExec@loute,sashigane,sashikabe": { |
286 | 296 | adjustBoardData: function(key, d) { |
287 | 297 | this.adjustNumberArrow(key, d); |
288 | 298 | } |
289 | 299 | }, |
290 | 300 |
|
291 | | - AreaRoomGraph: { |
| 301 | + "AreaShadeGraph@sashikabe": { |
292 | 302 | enabled: true, |
| 303 | + coloring: true |
| 304 | + }, |
| 305 | + "AreaLGraph:AreaUnshadeGraph@sashikabe#1": { |
| 306 | + enabled: true |
| 307 | + }, |
| 308 | + "AreaLGraph:AreaRoomGraph@loute,sashigane,sashikazune#1": { |
| 309 | + enabled: true |
| 310 | + }, |
| 311 | + |
| 312 | + "AreaLGraph#3": { |
| 313 | + getComponentRefs: function(obj) { |
| 314 | + return obj.lcomp; |
| 315 | + }, // getSideAreaInfo用 |
| 316 | + setComponentRefs: function(obj, component) { |
| 317 | + obj.lcomp = component; |
| 318 | + }, |
| 319 | + getObjNodeList: function(nodeobj) { |
| 320 | + return nodeobj.lcompnodes; |
| 321 | + }, |
| 322 | + resetObjNodeList: function(nodeobj) { |
| 323 | + nodeobj.lcompnodes = []; |
| 324 | + }, |
293 | 325 |
|
294 | 326 | // オーバーライド |
295 | 327 | resetExtraData: function(cell) { |
|
306 | 338 | var subclist = this.board |
307 | 339 | .cellinside(d.x1, d.y1, d.x2, d.y2) |
308 | 340 | .filter(function(cell) { |
309 | | - return cell.room !== component; |
| 341 | + return cell.lcomp !== component; |
310 | 342 | }); |
311 | 343 | var dl = subclist.getRectSize(); |
312 | 344 | if ( |
|
357 | 389 | } |
358 | 390 | }, |
359 | 391 |
|
360 | | - "AreaRoomGraph@sashikazune": { |
| 392 | + "AreaLGraph@sashikazune#2": { |
361 | 393 | setCellPlaces: function(clist, d, dl) { |
362 | 394 | var bd = this.board; |
363 | 395 | var corner = null; |
|
396 | 428 | paint: function() { |
397 | 429 | this.drawBGCells(); |
398 | 430 | this.drawDashedGrid(); |
399 | | - this.drawBorders(); |
| 431 | + if (this.pid === "sashikabe") { |
| 432 | + this.drawShadedCells(); |
| 433 | + this.drawDotCells(); |
| 434 | + } else { |
| 435 | + this.drawBorders(); |
| 436 | + } |
400 | 437 |
|
401 | 438 | this.drawCellArrows(); |
402 | 439 | this.drawHatenas_loute(); |
403 | | - if (this.pid === "sashigane") { |
| 440 | + if (this.pid === "sashigane" || this.pid === "sashikabe") { |
404 | 441 | this.drawCircledNumbers(); |
405 | 442 | } else if (this.pid === "loute") { |
406 | 443 | this.drawCircles(); |
|
553 | 590 | this.outbstr += cm; |
554 | 591 | } |
555 | 592 | }, |
556 | | - "Encode@sashigane": { |
| 593 | + "Encode@sashigane,sashikabe": { |
557 | 594 | decodePzpr: function(type) { |
558 | 595 | this.decodeSashigane(); |
559 | 596 | }, |
|
651 | 688 | } |
652 | 689 | } else if (ca === "-") { |
653 | 690 | cell.qdir = -2; |
| 691 | + } else if (ca === "#") { |
| 692 | + cell.qans = 1; |
| 693 | + } else if (ca === "_") { |
| 694 | + cell.qsub = 1; |
654 | 695 | } else if (ca !== ".") { |
655 | 696 | cell.qdir = +ca; |
656 | 697 | } |
|
661 | 702 | encodeData: function() { |
662 | 703 | var pid = this.pid; |
663 | 704 | this.encodeCell(function(cell) { |
664 | | - if (pid === "sashigane" && cell.qdir === 5) { |
| 705 | + if ((pid === "sashigane" || pid === "sashikabe") && cell.qdir === 5) { |
665 | 706 | return "o" + (cell.qnum !== -1 ? cell.qnum : "") + " "; |
666 | 707 | } else if (cell.qdir === -2) { |
667 | 708 | return "- "; |
668 | 709 | } else if (cell.qdir !== 0) { |
669 | 710 | return cell.qdir + " "; |
| 711 | + } else if (cell.qsub) { |
| 712 | + return "_ "; |
| 713 | + } else if (cell.qans) { |
| 714 | + return "# "; |
670 | 715 | } else { |
671 | 716 | return ". "; |
672 | 717 | } |
|
692 | 737 | // 正解判定処理実行部 |
693 | 738 | AnsCheck: { |
694 | 739 | checklist: [ |
| 740 | + "check2x2ShadeCell@sashikabe", |
695 | 741 | "checkArrowCorner1", |
696 | 742 | "checkArrowCorner2", |
697 | 743 | "checkCircleCorner", |
698 | | - "checkNumberAndSize+@sashigane", |
699 | | - "checkBorderDeadend", |
700 | | - "checkLblock" |
| 744 | + "checkNumberAndSize+@sashigane,sashikabe", |
| 745 | + "checkBorderDeadend@!sashikabe", |
| 746 | + "checkLblock", |
| 747 | + "checkConnectShade@sashikabe", |
| 748 | + "doneShadingDecided@sashikabe" |
701 | 749 | ], |
702 | 750 |
|
| 751 | + checkNumberAndSize: function() { |
| 752 | + this.checkAllArea( |
| 753 | + this.board.lgraph, |
| 754 | + function(w, h, a, n) { |
| 755 | + return n <= 0 || n === a; |
| 756 | + }, |
| 757 | + "bkSizeNe" |
| 758 | + ); |
| 759 | + }, |
| 760 | + |
703 | 761 | checkArrowCorner1: function() { |
704 | | - var rooms = this.board.roommgr.components; |
| 762 | + var rooms = this.board.lgraph.components; |
705 | 763 | allloop: for (var id = 0; id < rooms.length; id++) { |
706 | 764 | if (rooms[id].shape === 0) { |
707 | 765 | continue; |
|
726 | 784 | }, |
727 | 785 |
|
728 | 786 | checkArrowCorner2: function() { |
729 | | - var rooms = this.board.roommgr.components; |
| 787 | + var rooms = this.board.lgraph.components; |
730 | 788 | allloop: for (var id = 0; id < rooms.length; id++) { |
731 | 789 | if (rooms[id].shape === 0) { |
732 | 790 | continue; |
|
761 | 819 | }, |
762 | 820 |
|
763 | 821 | checkCircleCorner: function() { |
764 | | - var rooms = this.board.roommgr.components; |
| 822 | + var rooms = this.board.lgraph.components; |
765 | 823 | allloop: for (var id = 0; id < rooms.length; id++) { |
766 | 824 | if (rooms[id].shape === 0) { |
767 | 825 | continue; |
|
785 | 843 | }, |
786 | 844 |
|
787 | 845 | checkLblock: function() { |
788 | | - var rooms = this.board.roommgr.components; |
| 846 | + var rooms = this.board.lgraph.components; |
789 | 847 | for (var id = 0; id < rooms.length; id++) { |
790 | 848 | if (rooms[id].shape !== 0) { |
791 | 849 | continue; |
|
799 | 857 | } |
800 | 858 | } |
801 | 859 | }, |
| 860 | + "AnsCheck@sashikabe": { |
| 861 | + checkArrowCorner2: function() { |
| 862 | + this.checkAllCell(function(cell) { |
| 863 | + var dir = cell.getObjNum(); |
| 864 | + if (dir < 1 || dir > 4) { |
| 865 | + return false; |
| 866 | + } |
| 867 | + |
| 868 | + var next = cell |
| 869 | + .getaddr() |
| 870 | + .movedir(dir, 2) |
| 871 | + .getc(); |
| 872 | + return next.isnull || next.isShade(); |
| 873 | + }, "arNotPtCnr"); |
| 874 | + } |
| 875 | + }, |
802 | 876 | "AnsCheck@sashikazune": { |
803 | 877 | checklist: [ |
804 | 878 | "checkNumberDistance", |
|
817 | 891 |
|
818 | 892 | checkNumber3Count: function() { |
819 | 893 | this.checkAllBlock( |
820 | | - this.board.roommgr, |
| 894 | + this.board.lgraph, |
821 | 895 | function(cell) { |
822 | 896 | return cell.isNum() && cell.place !== 0; |
823 | 897 | }, |
|
0 commit comments