@konoui/mjimage 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -8
- package/dist/index.js +177 -171
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const Tn = "MS Gothic, sans-serif", ft = {
|
|
|
15
15
|
S: "s",
|
|
16
16
|
Z: "z",
|
|
17
17
|
BACK: "_"
|
|
18
|
-
},
|
|
18
|
+
}, g = {
|
|
19
19
|
TSUMO: "t",
|
|
20
20
|
RON: "v",
|
|
21
21
|
DORA: "d",
|
|
@@ -154,8 +154,8 @@ class Ns {
|
|
|
154
154
|
const le = (n, t) => {
|
|
155
155
|
if (n.t == t.t) {
|
|
156
156
|
if (C(n) && C(t)) {
|
|
157
|
-
if (n.has(
|
|
158
|
-
if (t.has(
|
|
157
|
+
if (n.has(g.RED)) return -1;
|
|
158
|
+
if (t.has(g.RED)) return 1;
|
|
159
159
|
}
|
|
160
160
|
return n.n - t.n;
|
|
161
161
|
}
|
|
@@ -169,20 +169,20 @@ const le = (n, t) => {
|
|
|
169
169
|
return e[n.t] - e[t.t];
|
|
170
170
|
}, vs = (n, t) => {
|
|
171
171
|
const e = {
|
|
172
|
-
[
|
|
173
|
-
[
|
|
174
|
-
[
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
172
|
+
[g.HORIZONTAL]: 1,
|
|
173
|
+
[g.TSUMO]: 2,
|
|
174
|
+
[g.RON]: 3,
|
|
175
|
+
[g.DORA]: 4,
|
|
176
|
+
[g.COLOR_GRAYSCALE]: 5,
|
|
177
|
+
[g.RED]: 6
|
|
178
178
|
};
|
|
179
179
|
return e[n] - e[t];
|
|
180
180
|
}, Ts = (n) => {
|
|
181
181
|
const t = [];
|
|
182
182
|
n.forEach((s, r) => {
|
|
183
|
-
s.has(
|
|
183
|
+
s.has(g.HORIZONTAL) && t.push(r);
|
|
184
184
|
});
|
|
185
|
-
const e = n.filter((s) => !s.has(
|
|
185
|
+
const e = n.filter((s) => !s.has(g.HORIZONTAL)).sort(le);
|
|
186
186
|
return t.forEach((s) => {
|
|
187
187
|
e.splice(s, 0, n[s]);
|
|
188
188
|
}), e;
|
|
@@ -331,7 +331,7 @@ class x extends T {
|
|
|
331
331
|
if (e.length < t.length) {
|
|
332
332
|
if (C(s)) {
|
|
333
333
|
const r = new w(s.t, 5);
|
|
334
|
-
super([r.clone({ add:
|
|
334
|
+
super([r.clone({ add: g.RED }), r, r, r], b.AN_KAN);
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
super([s, s, s, s], b.AN_KAN);
|
|
@@ -340,7 +340,7 @@ class x extends T {
|
|
|
340
340
|
super(t, b.AN_KAN);
|
|
341
341
|
}
|
|
342
342
|
get tilesWithBack() {
|
|
343
|
-
const t = this.tiles[0].clone({ remove:
|
|
343
|
+
const t = this.tiles[0].clone({ remove: g.RED }), e = C(t) ? t.clone({ add: g.RED }) : t;
|
|
344
344
|
return [new w(p.BACK, 0), e, t, new w(p.BACK, 0)];
|
|
345
345
|
}
|
|
346
346
|
static from(t) {
|
|
@@ -369,8 +369,8 @@ class K extends T {
|
|
|
369
369
|
return T.deserialize({ tiles: t, type: b.SHO_KAN });
|
|
370
370
|
}
|
|
371
371
|
static fromPon(t, e) {
|
|
372
|
-
const s = t.tiles.findIndex((i) => i.has(
|
|
373
|
-
return r.splice(s, 0, e.clone({ add:
|
|
372
|
+
const s = t.tiles.findIndex((i) => i.has(g.HORIZONTAL)), r = [...t.tiles];
|
|
373
|
+
return r.splice(s, 0, e.clone({ add: g.HORIZONTAL })), new K(r);
|
|
374
374
|
}
|
|
375
375
|
toString() {
|
|
376
376
|
return gt(this.tiles);
|
|
@@ -545,9 +545,9 @@ class B {
|
|
|
545
545
|
function nn(n) {
|
|
546
546
|
if (n.length === 0) return b.UNKNOWN;
|
|
547
547
|
if (n.length === 1)
|
|
548
|
-
return n[0].has(
|
|
549
|
-
const t = n.every((i) => i.equals(n[0])), e = n.filter((i) => i.has(
|
|
550
|
-
(i) => i.has(
|
|
548
|
+
return n[0].has(g.DORA) ? b.IMAGE_DORA : n[0].has(g.TSUMO) ? b.TSUMO : b.HAND;
|
|
549
|
+
const t = n.every((i) => i.equals(n[0])), e = n.filter((i) => i.has(g.HORIZONTAL)).length, s = n.filter(
|
|
550
|
+
(i) => i.has(g.TSUMO) || i.has(g.DORA)
|
|
551
551
|
).length, r = n.filter((i) => i.t == p.BACK).length;
|
|
552
552
|
if (s > 0) return b.UNKNOWN;
|
|
553
553
|
if (e == 0 && r == 0) return b.HAND;
|
|
@@ -571,7 +571,7 @@ function Os(n) {
|
|
|
571
571
|
function ks(n, t) {
|
|
572
572
|
return n.map((e) => {
|
|
573
573
|
const s = new w(t, e.n, e.ops);
|
|
574
|
-
return s.isNum() && s.n == 0 ? s.clone({ n: 5, add:
|
|
574
|
+
return s.isNum() && s.n == 0 ? s.clone({ n: 5, add: g.RED }) : s;
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
function sn(n, t) {
|
|
@@ -591,7 +591,7 @@ function Cn(n) {
|
|
|
591
591
|
return [t, e];
|
|
592
592
|
}
|
|
593
593
|
function Cs(n) {
|
|
594
|
-
const t = Object.values(
|
|
594
|
+
const t = Object.values(g);
|
|
595
595
|
if (!t.includes(n.char)) return [new w(p.BACK, 0), !1];
|
|
596
596
|
const e = [];
|
|
597
597
|
for (let s = 0; s < 4; s++) {
|
|
@@ -602,10 +602,10 @@ function Cs(n) {
|
|
|
602
602
|
if (!o) break;
|
|
603
603
|
for (const c of e) n.readChar();
|
|
604
604
|
const a = new w(p.BACK, i, e);
|
|
605
|
-
if (a.has(
|
|
606
|
-
throw new Error(`found ${
|
|
607
|
-
if (a.has(
|
|
608
|
-
throw new Error(`unable to specify both ${
|
|
605
|
+
if (a.has(g.RED) && a.n != 5)
|
|
606
|
+
throw new Error(`found ${g.RED} but number is not 5: ${i}`);
|
|
607
|
+
if (a.has(g.DORA) && a.has(g.TSUMO))
|
|
608
|
+
throw new Error(`unable to specify both ${g.DORA} and ${g.TSUMO}`);
|
|
609
609
|
return [a, !0];
|
|
610
610
|
}
|
|
611
611
|
}
|
|
@@ -1422,8 +1422,8 @@ const Sr = function(n) {
|
|
|
1422
1422
|
const l = a.rawTagName;
|
|
1423
1423
|
let u = a.tagExp, h = a.attrExpPresent, d = a.closeIndex;
|
|
1424
1424
|
this.options.transformTagName && (c = this.options.transformTagName(c)), e && s && e.tagname !== "!xml" && (s = this.saveTextToParentTag(s, e, r, !1));
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1425
|
+
const y = e;
|
|
1426
|
+
y && this.options.unpairedTags.indexOf(y.tagname) !== -1 && (e = this.tagsNodeStack.pop(), r = r.substring(0, r.lastIndexOf("."))), c !== t.tagname && (r += r ? "." + c : c);
|
|
1427
1427
|
const f = i;
|
|
1428
1428
|
if (this.isItStopNode(this.options.stopNodes, r, c)) {
|
|
1429
1429
|
let m = "";
|
|
@@ -1704,8 +1704,8 @@ function Hn(n, t, e, s) {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
let u = s;
|
|
1706
1706
|
u !== "" && (u += t.indentBy);
|
|
1707
|
-
const h = hn(a[":@"], t), d = s + `<${c}${h}`,
|
|
1708
|
-
t.unpairedTags.indexOf(c) !== -1 ? t.suppressUnpairedNode ? r += d + ">" : r += d + "/>" : (!
|
|
1707
|
+
const h = hn(a[":@"], t), d = s + `<${c}${h}`, y = Hn(a[c], t, l, u);
|
|
1708
|
+
t.unpairedTags.indexOf(c) !== -1 ? t.suppressUnpairedNode ? r += d + ">" : r += d + "/>" : (!y || y.length === 0) && t.suppressEmptyNode ? r += d + "/>" : y && y.endsWith(">") ? r += d + `>${y}${s}</${c}>` : (r += d + ">", y && s !== "" && (y.includes("/>") || y.includes("</")) ? r += s + t.indentBy + y + s : r += y, r += `</${c}>`), i = !0;
|
|
1709
1709
|
}
|
|
1710
1710
|
return r;
|
|
1711
1711
|
}
|
|
@@ -2131,8 +2131,8 @@ const j = (n, t) => {
|
|
|
2131
2131
|
}, 0);
|
|
2132
2132
|
return { width: n.tiles.reduce((a, c) => a + W(c, t).width, 0), height: i };
|
|
2133
2133
|
}, W = (n, t) => {
|
|
2134
|
-
const e = parseFloat((ft.HEIGHT * t).toPrecision(5)), s = parseFloat((ft.WIDTH * t).toPrecision(5)), r = n.has(
|
|
2135
|
-
return (n.has(
|
|
2134
|
+
const e = parseFloat((ft.HEIGHT * t).toPrecision(5)), s = parseFloat((ft.WIDTH * t).toPrecision(5)), r = n.has(g.HORIZONTAL) ? { width: e, height: s, baseWidth: s, baseHeight: e } : { width: s, height: e, w: s, baseWidth: s, baseHeight: e };
|
|
2135
|
+
return (n.has(g.TSUMO) || n.has(g.DORA)) && (r.width += s * ft.TEXT_SCALE), r;
|
|
2136
2136
|
};
|
|
2137
2137
|
class Tt {
|
|
2138
2138
|
constructor(t = {}) {
|
|
@@ -2151,7 +2151,7 @@ class Tt {
|
|
|
2151
2151
|
// image wrapper
|
|
2152
2152
|
image(t) {
|
|
2153
2153
|
let e = new Wn().load(this.buildURL(t));
|
|
2154
|
-
return this.svgSprite && (e = new ze().use(Tt.buildID(t))), t instanceof w && t.has(
|
|
2154
|
+
return this.svgSprite && (e = new ze().use(Tt.buildID(t))), t instanceof w && t.has(g.COLOR_GRAYSCALE) && e.css({ filter: "contrast(65%)" }), e;
|
|
2155
2155
|
}
|
|
2156
2156
|
createImage(t, e, s) {
|
|
2157
2157
|
const r = W(t, this.scale);
|
|
@@ -2176,7 +2176,7 @@ class Tt {
|
|
|
2176
2176
|
static buildID(t) {
|
|
2177
2177
|
if (t == 100 || t == 1e3)
|
|
2178
2178
|
return t == 100 ? "stick100" : "stick1000";
|
|
2179
|
-
const e = t.t == p.BACK || t.has(
|
|
2179
|
+
const e = t.t == p.BACK || t.has(g.RED) ? 0 : t.n;
|
|
2180
2180
|
return `${t.t}${e}`;
|
|
2181
2181
|
}
|
|
2182
2182
|
buildURL(t) {
|
|
@@ -2193,30 +2193,30 @@ class Ln extends Tt {
|
|
|
2193
2193
|
const s = e instanceof x ? e.tilesWithBack : e.tiles, r = new v();
|
|
2194
2194
|
let i = 0;
|
|
2195
2195
|
for (const o of s) {
|
|
2196
|
-
const a = W(o, this.scale), c = o.has(
|
|
2196
|
+
const a = W(o, this.scale), c = o.has(g.HORIZONTAL) ? this.createRotate90Image.bind(this) : this.createImage.bind(this), l = o.has(g.HORIZONTAL) ? this.getDiffTileHeightWidth(o) : 0, u = c(o, i, l);
|
|
2197
2197
|
r.add(u), i += a.width;
|
|
2198
2198
|
}
|
|
2199
2199
|
return r;
|
|
2200
2200
|
}
|
|
2201
2201
|
createBlockPonChiKan(e) {
|
|
2202
|
-
const s = e.tiles.findIndex((o) => o.has(
|
|
2202
|
+
const s = e.tiles.findIndex((o) => o.has(g.HORIZONTAL));
|
|
2203
2203
|
let r = 0;
|
|
2204
2204
|
const i = new v();
|
|
2205
2205
|
if (e.type == b.SHO_KAN) {
|
|
2206
2206
|
let o = s;
|
|
2207
2207
|
for (let a = 0; a < e.tiles.length; a++)
|
|
2208
|
-
e.tiles[a].has(
|
|
2208
|
+
e.tiles[a].has(g.HORIZONTAL) && (o = a);
|
|
2209
2209
|
for (let a = 0; a < e.tiles.length; a++) {
|
|
2210
2210
|
const c = W(e.tiles[a], this.scale);
|
|
2211
2211
|
if (a == o) continue;
|
|
2212
2212
|
if (a == s) {
|
|
2213
|
-
const h = e.tiles[s], d = e.tiles[o],
|
|
2213
|
+
const h = e.tiles[s], d = e.tiles[o], y = W(h, this.scale), f = this.createRotate90Image(h, 0, 0, !0), m = this.createRotate90Image(
|
|
2214
2214
|
d,
|
|
2215
2215
|
0,
|
|
2216
|
-
|
|
2216
|
+
y.height,
|
|
2217
2217
|
!0
|
|
2218
2218
|
);
|
|
2219
|
-
i.add(new v().translate(r, 0).add(f).add(m)), r +=
|
|
2219
|
+
i.add(new v().translate(r, 0).add(f).add(m)), r += y.width;
|
|
2220
2220
|
continue;
|
|
2221
2221
|
}
|
|
2222
2222
|
const l = c.width * 2 - c.height, u = this.createImage(e.tiles[a], r, l);
|
|
@@ -2273,12 +2273,12 @@ const Yr = (n, t) => {
|
|
|
2273
2273
|
return { ...i, e: o };
|
|
2274
2274
|
},
|
|
2275
2275
|
[b.IMAGE_DORA]: function(r) {
|
|
2276
|
-
r = (t == null ? void 0 : t.doraText) == !1 ? new Dt([r.tiles[0].clone({ remove:
|
|
2276
|
+
r = (t == null ? void 0 : t.doraText) == !1 ? new Dt([r.tiles[0].clone({ remove: g.DORA })]) : r;
|
|
2277
2277
|
const i = j(r, e), o = new v(), a = (t == null ? void 0 : t.doraText) === !1 ? n.createImage(r.tiles[0], 0, 0) : n.createTextImage(r.tiles[0], 0, 0, "(ドラ)");
|
|
2278
2278
|
return o.add(a), { ...i, e: o };
|
|
2279
2279
|
},
|
|
2280
2280
|
[b.TSUMO]: function(r) {
|
|
2281
|
-
r = (t == null ? void 0 : t.tsumoText) == !1 ? new Dt([r.tiles[0].clone({ remove:
|
|
2281
|
+
r = (t == null ? void 0 : t.tsumoText) == !1 ? new Dt([r.tiles[0].clone({ remove: g.TSUMO })]) : r;
|
|
2282
2282
|
const i = j(r, e), o = new v(), a = (t == null ? void 0 : t.tsumoText) === !1 ? n.createImage(r.tiles[0], 0, 0) : n.createTextImage(r.tiles[0], 0, 0, "(ツモ)");
|
|
2283
2283
|
return o.add(a), { ...i, e: o };
|
|
2284
2284
|
},
|
|
@@ -2303,7 +2303,7 @@ const Yr = (n, t) => {
|
|
|
2303
2303
|
throw new Error("isolated is unsupported");
|
|
2304
2304
|
},
|
|
2305
2305
|
[b.UNKNOWN]: function(r) {
|
|
2306
|
-
if (r.tiles.some((a) => a.has(
|
|
2306
|
+
if (r.tiles.some((a) => a.has(g.TSUMO) || a.has(g.DORA)))
|
|
2307
2307
|
throw new Error("found an unknown block with operator tiles");
|
|
2308
2308
|
const i = j(r, e), o = n.createBlockHandDiscard(r);
|
|
2309
2309
|
return { ...i, e: o };
|
|
@@ -2314,14 +2314,14 @@ const Yr = (n, t) => {
|
|
|
2314
2314
|
let r = 0, i = 0;
|
|
2315
2315
|
const o = [];
|
|
2316
2316
|
for (const h of t) {
|
|
2317
|
-
const d = s[h.type],
|
|
2318
|
-
i +=
|
|
2317
|
+
const d = s[h.type], y = d(h);
|
|
2318
|
+
i += y.width, r = y.height > r ? y.height : r, o.push(y);
|
|
2319
2319
|
}
|
|
2320
2320
|
const a = r, c = i + (t.length - 1) * n.blockMargin, l = new v();
|
|
2321
2321
|
let u = 0;
|
|
2322
2322
|
for (const h of o) {
|
|
2323
|
-
const d = a - h.height,
|
|
2324
|
-
|
|
2323
|
+
const d = a - h.height, y = new v().translate(u, d);
|
|
2324
|
+
y.add(h.e), l.add(y), u += h.width + n.blockMargin;
|
|
2325
2325
|
}
|
|
2326
2326
|
return { e: l, width: c, height: a };
|
|
2327
2327
|
}, Xo = (n, t, e = {}, s = {
|
|
@@ -2395,14 +2395,14 @@ const Yr = (n, t) => {
|
|
|
2395
2395
|
}, ti = (n, t, e) => {
|
|
2396
2396
|
const s = t.font, r = t.textWidth, i = t.textHeight, o = e.sticks.dead, a = e.sticks.reach, c = en.WIDTH * n.scale, l = en.HEIGHT * n.scale;
|
|
2397
2397
|
let u = r * 3, h = i;
|
|
2398
|
-
const d = (c + n.tileWidth + r - u) / 2,
|
|
2398
|
+
const d = (c + n.tileWidth + r - u) / 2, y = new Nt().plain(e.round).font(s).x(d).y(0);
|
|
2399
2399
|
h += 25 * n.scale;
|
|
2400
2400
|
const f = n.tileHeight, m = new v().size(c, f).translate(0, h), A = { family: s.family, size: s.size * 0.7 }, S = n.createStick(1e3).size(c, l).x(0).y(0), O = new Nt().plain(a.toString()).font(A).dx(c).dy(l), R = n.createStick(100).size(c, l).x(0).y(l + l), mt = new Nt().plain(o.toString()).font(A).dx(c).dy(l * 3);
|
|
2401
2401
|
m.add(S), m.add(O), m.add(R), m.add(mt);
|
|
2402
2402
|
const wt = n.createImage(e.doras[0], 0, 0).x(c + r).y(0);
|
|
2403
2403
|
m.add(wt);
|
|
2404
2404
|
const bt = new v();
|
|
2405
|
-
return bt.add(
|
|
2405
|
+
return bt.add(y), bt.add(y), bt.add(m), {
|
|
2406
2406
|
e: bt,
|
|
2407
2407
|
width: c + n.tileWidth + r,
|
|
2408
2408
|
height: h + n.tileHeight
|
|
@@ -2422,11 +2422,11 @@ const Yr = (n, t) => {
|
|
|
2422
2422
|
), d = L(i.e, i.width, i.height, 180).translate(
|
|
2423
2423
|
(c - i.width) / 2,
|
|
2424
2424
|
0
|
|
2425
|
-
),
|
|
2425
|
+
), y = L(o.e, o.width, o.height, 90).translate(
|
|
2426
2426
|
0,
|
|
2427
2427
|
(c - o.width) / 2
|
|
2428
2428
|
), f = new v().size(c, l);
|
|
2429
|
-
return f.add(u), f.add(h), f.add(d), f.add(
|
|
2429
|
+
return f.add(u), f.add(h), f.add(d), f.add(y), { e: new v().add(f), width: c, height: l };
|
|
2430
2430
|
}, ni = (n) => {
|
|
2431
2431
|
const t = Object.values(Pe), e = t.indexOf(n);
|
|
2432
2432
|
return [...t.slice(e), ...t.slice(0, e)];
|
|
@@ -2443,7 +2443,7 @@ const Yr = (n, t) => {
|
|
|
2443
2443
|
width: i + a * tn.toString().length,
|
|
2444
2444
|
height: o
|
|
2445
2445
|
};
|
|
2446
|
-
}, [u, h, d,
|
|
2446
|
+
}, [u, h, d, y] = ni(
|
|
2447
2447
|
e.frontPlace
|
|
2448
2448
|
), f = e.scores, A = l(u, f.front, {
|
|
2449
2449
|
x: s / 2,
|
|
@@ -2467,7 +2467,7 @@ const Yr = (n, t) => {
|
|
|
2467
2467
|
s / 2 - R.width,
|
|
2468
2468
|
-R.height
|
|
2469
2469
|
);
|
|
2470
|
-
let wt = l(
|
|
2470
|
+
let wt = l(y, f.left, {
|
|
2471
2471
|
"dominant-baseline": "ideographic",
|
|
2472
2472
|
"text-anchor": "middle"
|
|
2473
2473
|
});
|
|
@@ -2479,12 +2479,12 @@ const Yr = (n, t) => {
|
|
|
2479
2479
|
}, ri = (n, t) => {
|
|
2480
2480
|
const e = jt(t.front, n), s = jt(t.right, n), r = jt(t.opposite, n), i = jt(t.left, n), o = [e.height, s.height, r.height, i.height].reduce(
|
|
2481
2481
|
(O, R) => Math.max(O, R)
|
|
2482
|
-
), a = n.tileWidth * 5 + n.tileHeight * 1, c = o, l = a + o * 2 + n.blockMargin, u = l, h = new v().size(l, u), d = l / 2 - a / 2,
|
|
2482
|
+
), a = n.tileWidth * 5 + n.tileHeight * 1, c = o, l = a + o * 2 + n.blockMargin, u = l, h = new v().size(l, u), d = l / 2 - a / 2, y = u / 2 - a / 2, f = L(e.e, a, c, 0).translate(
|
|
2483
2483
|
d,
|
|
2484
2484
|
u - c
|
|
2485
2485
|
), m = L(s.e, a, c, 270).translate(
|
|
2486
2486
|
l - c,
|
|
2487
|
-
|
|
2487
|
+
y
|
|
2488
2488
|
), A = L(
|
|
2489
2489
|
r.e,
|
|
2490
2490
|
a,
|
|
@@ -2492,7 +2492,7 @@ const Yr = (n, t) => {
|
|
|
2492
2492
|
180
|
|
2493
2493
|
).translate(d, 0), S = L(i.e, a, c, 90).translate(
|
|
2494
2494
|
0,
|
|
2495
|
-
|
|
2495
|
+
y
|
|
2496
2496
|
);
|
|
2497
2497
|
return h.add(f), h.add(m), h.add(A), h.add(S), { e: new v().add(h), width: l, height: u };
|
|
2498
2498
|
}, ii = (n, t, e, s, r) => {
|
|
@@ -3004,21 +3004,23 @@ class je {
|
|
|
3004
3004
|
const t = [];
|
|
3005
3005
|
for (const [e, s] of z()) {
|
|
3006
3006
|
let r = this.get(e, s);
|
|
3007
|
-
e != p.Z && s == 5 && this.get(e, 0) > 0 && (r -= this.get(e, 0), t.push(new w(e, s, [
|
|
3007
|
+
e != p.Z && s == 5 && this.get(e, 0) > 0 && (r -= this.get(e, 0), t.push(new w(e, s, [g.RED])));
|
|
3008
3008
|
for (let i = 0; i < r; i++)
|
|
3009
3009
|
t.push(new w(e, s));
|
|
3010
3010
|
}
|
|
3011
3011
|
if (this.drawn != null) {
|
|
3012
|
-
const e = this.drawn, s = t.findIndex(
|
|
3012
|
+
const e = this.drawn, s = t.findIndex(
|
|
3013
|
+
(r) => r.equals(e) && e.has(g.RED) == r.has(g.RED)
|
|
3014
|
+
);
|
|
3013
3015
|
N(
|
|
3014
3016
|
s >= 0,
|
|
3015
3017
|
`hand has drawn: ${this.drawn} but no tile in hands: ${t.join("")}`
|
|
3016
|
-
), t[s] = t[s].clone({ add:
|
|
3018
|
+
), t[s] = t[s].clone({ add: g.TSUMO });
|
|
3017
3019
|
}
|
|
3018
3020
|
return t;
|
|
3019
3021
|
}
|
|
3020
3022
|
toString() {
|
|
3021
|
-
const t = this.called.length > 0 ? `${lt}${this.called.join(lt)}` : "", e = this.drawn ? `${lt}${this.drawn.toString()}` : "", s = this.hands.filter((i) => !i.has(
|
|
3023
|
+
const t = this.called.length > 0 ? `${lt}${this.called.join(lt)}` : "", e = this.drawn ? `${lt}${this.drawn.toString()}` : "", s = this.hands.filter((i) => !i.has(g.TSUMO));
|
|
3022
3024
|
return `${new Dt(s).toString()}${e}${t}`;
|
|
3023
3025
|
}
|
|
3024
3026
|
get called() {
|
|
@@ -3044,29 +3046,29 @@ class je {
|
|
|
3044
3046
|
inc(t) {
|
|
3045
3047
|
const e = [];
|
|
3046
3048
|
for (const s of t) {
|
|
3047
|
-
if (s.t != p.BACK && this.get(s.t, s.n) >= 4 || s.has(
|
|
3049
|
+
if (s.t != p.BACK && this.get(s.t, s.n) >= 4 || s.has(g.RED) && this.get(s.t, 0) > 0)
|
|
3048
3050
|
throw this.dec(e), new Error(`unable to increase ${s} in ${this.toString()}`);
|
|
3049
|
-
e.push(s), s.t == p.BACK ? this.data[s.t][1] += 1 : (this.data[s.t][s.n] += 1, s.has(
|
|
3051
|
+
e.push(s), s.t == p.BACK ? this.data[s.t][1] += 1 : (this.data[s.t][s.n] += 1, s.has(g.RED) && (this.data[s.t][0] += 1));
|
|
3050
3052
|
}
|
|
3051
3053
|
return e;
|
|
3052
3054
|
}
|
|
3053
3055
|
dec(t) {
|
|
3054
3056
|
const e = [];
|
|
3055
3057
|
for (const s of t) {
|
|
3056
|
-
if (this.get(s.t, s.n) < 1 || s.has(
|
|
3058
|
+
if (this.get(s.t, s.n) < 1 || s.has(g.RED) && this.get(s.t, 0) <= 0)
|
|
3057
3059
|
throw this.inc(e), new Error(
|
|
3058
3060
|
`unable to decrease ${s.toString()} in ${this.toString()}`
|
|
3059
3061
|
);
|
|
3060
|
-
if (e.push(s), s.t == p.BACK ? this.data[s.t][1] -= 1 : (this.data[s.t][s.n] -= 1, s.has(
|
|
3062
|
+
if (e.push(s), s.t == p.BACK ? this.data[s.t][1] -= 1 : (this.data[s.t][s.n] -= 1, s.has(g.RED) && (this.data[s.t][0] -= 1)), C(s) && this.get(s.t, 5) == 0 && this.get(s.t, 0) > 0) {
|
|
3061
3063
|
this.data[s.t][0] = 0;
|
|
3062
|
-
const r = e.pop().clone({ add:
|
|
3064
|
+
const r = e.pop().clone({ add: g.RED });
|
|
3063
3065
|
e.push(r);
|
|
3064
3066
|
}
|
|
3065
3067
|
}
|
|
3066
3068
|
return e;
|
|
3067
3069
|
}
|
|
3068
3070
|
draw(t) {
|
|
3069
|
-
const e = t.clone({ add:
|
|
3071
|
+
const e = t.clone({ add: g.TSUMO });
|
|
3070
3072
|
this.inc([e]), this.data.tsumo = e;
|
|
3071
3073
|
}
|
|
3072
3074
|
discard(t) {
|
|
@@ -3078,7 +3080,7 @@ class je {
|
|
|
3078
3080
|
this.data.reached = !0;
|
|
3079
3081
|
}
|
|
3080
3082
|
call(t) {
|
|
3081
|
-
const e = t.tiles.filter((s) => !s.has(
|
|
3083
|
+
const e = t.tiles.filter((s) => !s.has(g.HORIZONTAL));
|
|
3082
3084
|
if (e.length != t.tiles.length - 1)
|
|
3083
3085
|
throw new Error(`removal: ${e} block: ${t}`);
|
|
3084
3086
|
this.dec(e), this.data.called = [...this.called, t], this.data.tsumo = null;
|
|
@@ -3095,7 +3097,7 @@ class je {
|
|
|
3095
3097
|
);
|
|
3096
3098
|
if (e == -1) throw new Error(`unable to find ${t.tiles[0]}`);
|
|
3097
3099
|
let s = t.tiles[0];
|
|
3098
|
-
s = C(s) ? s.clone({ remove:
|
|
3100
|
+
s = C(s) ? s.clone({ remove: g.RED }) : s, this.dec([s]), this.data.called = [
|
|
3099
3101
|
...this.called.slice(0, e),
|
|
3100
3102
|
...this.called.slice(e + 1),
|
|
3101
3103
|
t
|
|
@@ -3142,18 +3144,18 @@ class he {
|
|
|
3142
3144
|
fourSetsOnePair() {
|
|
3143
3145
|
const t = (s) => {
|
|
3144
3146
|
const r = [0, 0, 0];
|
|
3145
|
-
for (const [d,
|
|
3146
|
-
this.hand.get(d,
|
|
3147
|
+
for (const [d, y] of z({ filterBy: [p.Z] }))
|
|
3148
|
+
this.hand.get(d, y) >= 3 ? r[0]++ : this.hand.get(d, y) == 2 ? r[1]++ : this.hand.get(d, y) == 1 && r[2]++;
|
|
3147
3149
|
const i = [0, 0, 0], o = this.hand.get(p.BACK, 0), a = o % 3;
|
|
3148
3150
|
i[0] = Math.floor(o / 3), a == 2 ? i[1] = 1 : a == 1 && (i[2] = 1);
|
|
3149
3151
|
let c = 13;
|
|
3150
3152
|
const l = this.patternNumType(p.M), u = this.patternNumType(p.P), h = this.patternNumType(p.S);
|
|
3151
3153
|
for (const d of [l.patternA, l.patternB])
|
|
3152
|
-
for (const
|
|
3154
|
+
for (const y of [u.patternA, u.patternB])
|
|
3153
3155
|
for (const f of [h.patternA, h.patternB]) {
|
|
3154
3156
|
const m = [this.hand.called.length, 0, 0];
|
|
3155
3157
|
for (let S = 0; S < 3; S++)
|
|
3156
|
-
m[S] += d[S] +
|
|
3158
|
+
m[S] += d[S] + y[S] + f[S] + r[S] + i[S];
|
|
3157
3159
|
const A = this.calcCommon(m[0], m[1], m[2], s);
|
|
3158
3160
|
A < c && (c = A);
|
|
3159
3161
|
}
|
|
@@ -3216,14 +3218,14 @@ class Ai {
|
|
|
3216
3218
|
}
|
|
3217
3219
|
markDrawn(t, e) {
|
|
3218
3220
|
if (t.length == 0) return [];
|
|
3219
|
-
const s = this.hand.drawn != null || e.has(
|
|
3221
|
+
const s = this.hand.drawn != null || e.has(g.TSUMO) ? g.TSUMO : g.RON, r = [];
|
|
3220
3222
|
for (let o = 0; o < t.length; o++) {
|
|
3221
3223
|
const a = t[o], c = {};
|
|
3222
3224
|
for (let l = 0; l < a.length; l++) {
|
|
3223
3225
|
const u = a[l];
|
|
3224
3226
|
if (u.isCalled()) continue;
|
|
3225
3227
|
const h = u.tiles.findIndex(
|
|
3226
|
-
(
|
|
3228
|
+
(y) => y.equals(e) && e.has(g.RED) == y.has(g.RED)
|
|
3227
3229
|
);
|
|
3228
3230
|
if (h < 0) continue;
|
|
3229
3231
|
const d = Fn(u);
|
|
@@ -3422,7 +3424,7 @@ class fn {
|
|
|
3422
3424
|
}
|
|
3423
3425
|
a > 13 && a < 26 && (c = 8e3), this.cfg.roundUp8000 && (o == 30 && a == 4 || o == 60 && a == 3) && (c = 2e3);
|
|
3424
3426
|
const l = e[r].hand.some(
|
|
3425
|
-
(f) => f.tiles.some((m) => m.has(
|
|
3427
|
+
(f) => f.tiles.some((m) => m.has(g.TSUMO))
|
|
3426
3428
|
), u = this.cfg.orig.myWind, h = u == E.E, d = H(0);
|
|
3427
3429
|
if (l) {
|
|
3428
3430
|
const f = this.cfg.sticks.dead * 100;
|
|
@@ -3519,12 +3521,12 @@ class fn {
|
|
|
3519
3521
|
return this.cfg.reached == 1 ? [{ name: "立直", double: 1 }] : this.cfg.reached == 2 ? [{ name: "ダブル立直", double: 2 }] : [];
|
|
3520
3522
|
}
|
|
3521
3523
|
dB1(t) {
|
|
3522
|
-
return this.minus() != 0 ? [] : (this.hand.drawn == null, t.some((s) => s.tiles.some((r) => r.has(
|
|
3524
|
+
return this.minus() != 0 ? [] : (this.hand.drawn == null, t.some((s) => s.tiles.some((r) => r.has(g.TSUMO))) ? [{ name: "門前清自摸和", double: 1 }] : []);
|
|
3523
3525
|
}
|
|
3524
3526
|
dC1(t) {
|
|
3525
3527
|
if (this.minus() != 0) return [];
|
|
3526
3528
|
const e = "平和", s = this.calcFu(t);
|
|
3527
|
-
return s == 20 ? [{ name: e, double: 1 }] : !t.some((r) => r.tiles.some((i) => i.has(
|
|
3529
|
+
return s == 20 ? [{ name: e, double: 1 }] : !t.some((r) => r.tiles.some((i) => i.has(g.TSUMO))) && s == 30 ? [{ name: e, double: 1 }] : [];
|
|
3528
3530
|
}
|
|
3529
3531
|
dD1(t) {
|
|
3530
3532
|
return t.some(
|
|
@@ -3563,7 +3565,7 @@ class fn {
|
|
|
3563
3565
|
for (const a of o.tiles) {
|
|
3564
3566
|
for (const c of this.cfg.doras) a.equals(c) && e++;
|
|
3565
3567
|
for (const c of this.cfg.blindDoras) a.equals(c) && s++;
|
|
3566
|
-
a.has(
|
|
3568
|
+
a.has(g.RED) && r++;
|
|
3567
3569
|
}
|
|
3568
3570
|
const i = [];
|
|
3569
3571
|
return e > 0 && i.push({ name: "ドラ", double: e }), r > 0 && i.push({ name: "赤ドラ", double: r }), this.hand.reached && s > 0 && i.push({ name: "裏ドラ", double: s }), i;
|
|
@@ -3595,7 +3597,7 @@ class fn {
|
|
|
3595
3597
|
) ? [{ name: "対々和", double: 2 }] : [];
|
|
3596
3598
|
}
|
|
3597
3599
|
dD2(t) {
|
|
3598
|
-
return this.minus() != 0 ? [] : t.filter((s) => (s instanceof x || s instanceof F) && !s.tiles.some((r) => r.has(
|
|
3600
|
+
return this.minus() != 0 ? [] : t.filter((s) => (s instanceof x || s instanceof F) && !s.tiles.some((r) => r.has(g.RON))).length >= 3 ? [{ name: "三暗刻", double: 2 }] : [];
|
|
3599
3601
|
}
|
|
3600
3602
|
dE2(t) {
|
|
3601
3603
|
return t.filter(
|
|
@@ -3675,7 +3677,7 @@ class fn {
|
|
|
3675
3677
|
}
|
|
3676
3678
|
dA13(t) {
|
|
3677
3679
|
return t.length != 13 ? [] : t.some(
|
|
3678
|
-
(s) => s instanceof P && s.tiles.some((r) => r.has(
|
|
3680
|
+
(s) => s instanceof P && s.tiles.some((r) => r.has(g.TSUMO) || r.has(g.RON))
|
|
3679
3681
|
) ? [{ name: "国士無双13面待ち", double: 26 }] : [{ name: "国士無双", double: 13 }];
|
|
3680
3682
|
}
|
|
3681
3683
|
dB13(t) {
|
|
@@ -3683,9 +3685,9 @@ class fn {
|
|
|
3683
3685
|
}
|
|
3684
3686
|
dC13(t) {
|
|
3685
3687
|
return t.length == 7 ? [] : t.every(
|
|
3686
|
-
(r) => r instanceof x || r instanceof F && !r.tiles.some((i) => i.has(
|
|
3688
|
+
(r) => r instanceof x || r instanceof F && !r.tiles.some((i) => i.has(g.RON)) || r instanceof P
|
|
3687
3689
|
) ? t.some(
|
|
3688
|
-
(r) => r instanceof P && r.tiles.every((i) => i.has(
|
|
3690
|
+
(r) => r instanceof P && r.tiles.every((i) => i.has(g.TSUMO) || i.has(g.RON))
|
|
3689
3691
|
) ? [{ name: "四暗刻単騎待ち", double: 26 }] : [{ name: "四暗刻", double: 13 }] : [];
|
|
3690
3692
|
}
|
|
3691
3693
|
dD13(t) {
|
|
@@ -3730,15 +3732,15 @@ class fn {
|
|
|
3730
3732
|
const r = this.cfg.myWind.n, i = this.cfg.roundWind.n;
|
|
3731
3733
|
if (t.length == 7) return 25;
|
|
3732
3734
|
const o = t.find(
|
|
3733
|
-
(f) => f.tiles.some((m) => m.has(
|
|
3734
|
-
), a = this.minus() == 1, c = o.tiles.some((f) => f.has(
|
|
3735
|
+
(f) => f.tiles.some((m) => m.has(g.TSUMO) || m.has(g.RON))
|
|
3736
|
+
), a = this.minus() == 1, c = o.tiles.some((f) => f.has(g.TSUMO)), l = (f, m) => {
|
|
3735
3737
|
const A = f.tiles[0];
|
|
3736
3738
|
return A.t == p.Z && [5, 6, 7].includes(A.n) || A.t == p.Z && [r, i].includes(A.n) || V.includes(A.n) ? m * 2 : m;
|
|
3737
3739
|
};
|
|
3738
3740
|
for (const f of t)
|
|
3739
3741
|
switch (!0) {
|
|
3740
3742
|
case f instanceof F:
|
|
3741
|
-
const m = f.tiles.some((A) => A.has(
|
|
3743
|
+
const m = f.tiles.some((A) => A.has(g.RON)) ? 2 : 4;
|
|
3742
3744
|
s += l(f, m);
|
|
3743
3745
|
break;
|
|
3744
3746
|
case f instanceof X:
|
|
@@ -3754,13 +3756,13 @@ class fn {
|
|
|
3754
3756
|
s += ((f) => {
|
|
3755
3757
|
if (f instanceof F) return 0;
|
|
3756
3758
|
if (f instanceof P) return 2;
|
|
3757
|
-
const m = f.tiles, A = m.findIndex((S) => S.has(
|
|
3759
|
+
const m = f.tiles, A = m.findIndex((S) => S.has(g.TSUMO) || S.has(g.RON));
|
|
3758
3760
|
return A == 1 || A == 0 && m[2].n == 9 || A == 2 && m[0].n == 1 ? 2 : 0;
|
|
3759
3761
|
})(o);
|
|
3760
3762
|
const d = t.find((f) => f instanceof P).tiles[0];
|
|
3761
3763
|
d.t == p.Z && ([5, 6, 7].includes(d.n) && (s += 2), d.n == i && (s += 2), d.n == r && (s += 2));
|
|
3762
|
-
let
|
|
3763
|
-
return !a && s == 20 && (
|
|
3764
|
+
let y = !1;
|
|
3765
|
+
return !a && s == 20 && (y = !0), c && !y && (s += 2), !c && !a && (s += 10), !c && !a && s == 30 && (y = !0), a && s == 20 && (s = 30), s;
|
|
3764
3766
|
}
|
|
3765
3767
|
}
|
|
3766
3768
|
const Fn = (n) => n.tiles.reduce((t, e) => `${t}${e.n}${e.t}`, ""), pn = (n) => {
|
|
@@ -3776,6 +3778,10 @@ const Fn = (n) => n.tiles.reduce((t, e) => `${t}${e.n}${e.t}`, ""), pn = (n) =>
|
|
|
3776
3778
|
return e;
|
|
3777
3779
|
}, it = (n) => [...n.tiles].sort(le)[0], gn = (n) => {
|
|
3778
3780
|
const t = n.n, e = n.t;
|
|
3781
|
+
if (e == p.Z) {
|
|
3782
|
+
if (t == 4) return new w(e, 1);
|
|
3783
|
+
if (t == 7) return new w(e, 5);
|
|
3784
|
+
}
|
|
3779
3785
|
return new w(e, t % 9 + 1);
|
|
3780
3786
|
};
|
|
3781
3787
|
class Lt {
|
|
@@ -3788,7 +3794,7 @@ class Lt {
|
|
|
3788
3794
|
for (const o of e) {
|
|
3789
3795
|
const a = t.dec([o]), c = Lt.candidateTiles(t, s);
|
|
3790
3796
|
t.inc(a);
|
|
3791
|
-
const l = s != null && s.arrangeRed && o.has(
|
|
3797
|
+
const l = s != null && s.arrangeRed && o.has(g.RED) ? o.clone({ removeAll: !0 }) : o.has(g.RED) ? o.clone({ removeAll: !0, add: g.RED }) : o.clone({ removeAll: !0 });
|
|
3792
3798
|
c.shanten < i ? (r.clear(), r.set(l.toString(), {
|
|
3793
3799
|
shanten: c.shanten,
|
|
3794
3800
|
candidates: c.candidates,
|
|
@@ -3993,7 +3999,7 @@ class Oi {
|
|
|
3993
3999
|
throw new Error(
|
|
3994
4000
|
`[counter] cannot decrease ${e.toString()} due to zero`
|
|
3995
4001
|
);
|
|
3996
|
-
this.c[e.t][e.n] -= 1, e.has(
|
|
4002
|
+
this.c[e.t][e.n] -= 1, e.has(g.RED) && (this.c[e.t][0] -= 1);
|
|
3997
4003
|
}
|
|
3998
4004
|
}
|
|
3999
4005
|
}
|
|
@@ -4245,10 +4251,10 @@ function zi(n, t) {
|
|
|
4245
4251
|
clock: a,
|
|
4246
4252
|
logger: c
|
|
4247
4253
|
} = t, l = {
|
|
4248
|
-
schedule: (d,
|
|
4254
|
+
schedule: (d, y, f, m, A = Math.random().toString(36).slice(2)) => {
|
|
4249
4255
|
const S = {
|
|
4250
4256
|
source: d,
|
|
4251
|
-
target:
|
|
4257
|
+
target: y,
|
|
4252
4258
|
event: f,
|
|
4253
4259
|
delay: m,
|
|
4254
4260
|
id: A,
|
|
@@ -4256,65 +4262,65 @@ function zi(n, t) {
|
|
|
4256
4262
|
}, O = _n(d, A);
|
|
4257
4263
|
h._snapshot._scheduledEvents[O] = S;
|
|
4258
4264
|
const R = a.setTimeout(() => {
|
|
4259
|
-
delete o[O], delete h._snapshot._scheduledEvents[O], h._relay(d,
|
|
4265
|
+
delete o[O], delete h._snapshot._scheduledEvents[O], h._relay(d, y, f);
|
|
4260
4266
|
}, m);
|
|
4261
4267
|
o[O] = R;
|
|
4262
4268
|
},
|
|
4263
|
-
cancel: (d,
|
|
4264
|
-
const f = _n(d,
|
|
4269
|
+
cancel: (d, y) => {
|
|
4270
|
+
const f = _n(d, y), m = o[f];
|
|
4265
4271
|
delete o[f], delete h._snapshot._scheduledEvents[f], m !== void 0 && a.clearTimeout(m);
|
|
4266
4272
|
},
|
|
4267
4273
|
cancelAll: (d) => {
|
|
4268
|
-
for (const
|
|
4269
|
-
const f = h._snapshot._scheduledEvents[
|
|
4274
|
+
for (const y in h._snapshot._scheduledEvents) {
|
|
4275
|
+
const f = h._snapshot._scheduledEvents[y];
|
|
4270
4276
|
f.source === d && l.cancel(d, f.id);
|
|
4271
4277
|
}
|
|
4272
4278
|
}
|
|
4273
4279
|
}, u = (d) => {
|
|
4274
4280
|
if (!i.size)
|
|
4275
4281
|
return;
|
|
4276
|
-
const
|
|
4282
|
+
const y = {
|
|
4277
4283
|
...d,
|
|
4278
4284
|
rootId: n.sessionId
|
|
4279
4285
|
};
|
|
4280
4286
|
i.forEach((f) => {
|
|
4281
4287
|
var m;
|
|
4282
|
-
return (m = f.next) == null ? void 0 : m.call(f,
|
|
4288
|
+
return (m = f.next) == null ? void 0 : m.call(f, y);
|
|
4283
4289
|
});
|
|
4284
4290
|
}, h = {
|
|
4285
4291
|
_snapshot: {
|
|
4286
4292
|
_scheduledEvents: ((t == null ? void 0 : t.snapshot) && t.snapshot.scheduler) ?? {}
|
|
4287
4293
|
},
|
|
4288
4294
|
_bookId: () => `x:${Li++}`,
|
|
4289
|
-
_register: (d,
|
|
4295
|
+
_register: (d, y) => (e.set(d, y), d),
|
|
4290
4296
|
_unregister: (d) => {
|
|
4291
4297
|
e.delete(d.sessionId);
|
|
4292
|
-
const
|
|
4293
|
-
|
|
4298
|
+
const y = r.get(d);
|
|
4299
|
+
y !== void 0 && (s.delete(y), r.delete(d));
|
|
4294
4300
|
},
|
|
4295
4301
|
get: (d) => s.get(d),
|
|
4296
|
-
_set: (d,
|
|
4302
|
+
_set: (d, y) => {
|
|
4297
4303
|
const f = s.get(d);
|
|
4298
|
-
if (f && f !==
|
|
4304
|
+
if (f && f !== y)
|
|
4299
4305
|
throw new Error(`Actor with system ID '${d}' already exists.`);
|
|
4300
|
-
s.set(d,
|
|
4306
|
+
s.set(d, y), r.set(y, d);
|
|
4301
4307
|
},
|
|
4302
4308
|
inspect: (d) => {
|
|
4303
|
-
const
|
|
4304
|
-
return i.add(
|
|
4309
|
+
const y = Me(d);
|
|
4310
|
+
return i.add(y), {
|
|
4305
4311
|
unsubscribe() {
|
|
4306
|
-
i.delete(
|
|
4312
|
+
i.delete(y);
|
|
4307
4313
|
}
|
|
4308
4314
|
};
|
|
4309
4315
|
},
|
|
4310
4316
|
_sendInspectionEvent: u,
|
|
4311
|
-
_relay: (d,
|
|
4317
|
+
_relay: (d, y, f) => {
|
|
4312
4318
|
h._sendInspectionEvent({
|
|
4313
4319
|
type: "@xstate.event",
|
|
4314
4320
|
sourceRef: d,
|
|
4315
|
-
actorRef:
|
|
4321
|
+
actorRef: y,
|
|
4316
4322
|
event: f
|
|
4317
|
-
}),
|
|
4323
|
+
}), y._send(f);
|
|
4318
4324
|
},
|
|
4319
4325
|
scheduler: l,
|
|
4320
4326
|
getSnapshot: () => ({
|
|
@@ -4325,14 +4331,14 @@ function zi(n, t) {
|
|
|
4325
4331
|
start: () => {
|
|
4326
4332
|
const d = h._snapshot._scheduledEvents;
|
|
4327
4333
|
h._snapshot._scheduledEvents = {};
|
|
4328
|
-
for (const
|
|
4334
|
+
for (const y in d) {
|
|
4329
4335
|
const {
|
|
4330
4336
|
source: f,
|
|
4331
4337
|
target: m,
|
|
4332
4338
|
event: A,
|
|
4333
4339
|
delay: S,
|
|
4334
4340
|
id: O
|
|
4335
|
-
} = d[
|
|
4341
|
+
} = d[y];
|
|
4336
4342
|
l.schedule(f, m, A, S, O);
|
|
4337
4343
|
}
|
|
4338
4344
|
},
|
|
@@ -4394,10 +4400,10 @@ class Ui {
|
|
|
4394
4400
|
h._stop();
|
|
4395
4401
|
},
|
|
4396
4402
|
emit: (h) => {
|
|
4397
|
-
const d = this.eventListeners.get(h.type),
|
|
4398
|
-
if (!d && !
|
|
4403
|
+
const d = this.eventListeners.get(h.type), y = this.eventListeners.get("*");
|
|
4404
|
+
if (!d && !y)
|
|
4399
4405
|
return;
|
|
4400
|
-
const f = [...d ? d.values() : [], ...
|
|
4406
|
+
const f = [...d ? d.values() : [], ...y ? y.values() : []];
|
|
4401
4407
|
for (const m of f)
|
|
4402
4408
|
m(h);
|
|
4403
4409
|
},
|
|
@@ -4412,11 +4418,11 @@ class Ui {
|
|
|
4412
4418
|
}
|
|
4413
4419
|
}), !h.exec)
|
|
4414
4420
|
return;
|
|
4415
|
-
const
|
|
4421
|
+
const y = be;
|
|
4416
4422
|
try {
|
|
4417
4423
|
be = !0, h.exec(h.info, h.params);
|
|
4418
4424
|
} finally {
|
|
4419
|
-
be =
|
|
4425
|
+
be = y;
|
|
4420
4426
|
}
|
|
4421
4427
|
};
|
|
4422
4428
|
this._processingStatus === $.Running ? d() : this._deferred.push(d);
|
|
@@ -5294,20 +5300,20 @@ function fo(n, t, e, s, r, i, o, a) {
|
|
|
5294
5300
|
const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
5295
5301
|
po(s, o, u, l), a && u.add(n.machine.root);
|
|
5296
5302
|
const h = /* @__PURE__ */ new Set();
|
|
5297
|
-
for (const d of [...l].sort((
|
|
5303
|
+
for (const d of [...l].sort((y, f) => y.order - f.order)) {
|
|
5298
5304
|
r.add(d);
|
|
5299
|
-
const
|
|
5300
|
-
|
|
5305
|
+
const y = [];
|
|
5306
|
+
y.push(...d.entry);
|
|
5301
5307
|
for (const f of d.invoke)
|
|
5302
|
-
|
|
5308
|
+
y.push(Xi(f.src, {
|
|
5303
5309
|
...f,
|
|
5304
5310
|
syncSnapshot: !!f.onSnapshot
|
|
5305
5311
|
}));
|
|
5306
5312
|
if (u.has(d)) {
|
|
5307
5313
|
const f = d.initial.actions;
|
|
5308
|
-
|
|
5314
|
+
y.push(...f);
|
|
5309
5315
|
}
|
|
5310
|
-
if (c = Mt(c, t, e,
|
|
5316
|
+
if (c = Mt(c, t, e, y, i, d.invoke.map((f) => f.id)), d.type === "final") {
|
|
5311
5317
|
const f = d.parent;
|
|
5312
5318
|
let m = (f == null ? void 0 : f.type) === "parallel" ? f : f == null ? void 0 : f.parent, A = m || d;
|
|
5313
5319
|
for ((f == null ? void 0 : f.type) === "compound" && i.push(Ce(f.id, d.output !== void 0 ? Re(d.output, c.context, t, e.self) : void 0)); (m == null ? void 0 : m.type) === "parallel" && !h.has(m) && Je(r, m); )
|
|
@@ -5377,10 +5383,10 @@ function go(n, t, e, s, r, i, o, a) {
|
|
|
5377
5383
|
let u;
|
|
5378
5384
|
for (const h of l)
|
|
5379
5385
|
for (const d of ao(h)) {
|
|
5380
|
-
let
|
|
5381
|
-
d.history === "deep" ?
|
|
5386
|
+
let y;
|
|
5387
|
+
d.history === "deep" ? y = (f) => Ve(f) && et(f, h) : y = (f) => f.parent === h, u ?? (u = {
|
|
5382
5388
|
...i
|
|
5383
|
-
}), u[d.id] = Array.from(r).filter(
|
|
5389
|
+
}), u[d.id] = Array.from(r).filter(y);
|
|
5384
5390
|
}
|
|
5385
5391
|
for (const h of l)
|
|
5386
5392
|
c = Mt(c, t, e, [...h.exit, ...h.invoke.map((d) => rs(d.id))], o, void 0), r.delete(h);
|
|
@@ -5418,7 +5424,7 @@ function fs(n, t, e, s, r, i) {
|
|
|
5418
5424
|
});
|
|
5419
5425
|
continue;
|
|
5420
5426
|
}
|
|
5421
|
-
const
|
|
5427
|
+
const y = u, [f, m, A] = y.resolve(
|
|
5422
5428
|
e,
|
|
5423
5429
|
a,
|
|
5424
5430
|
h,
|
|
@@ -5427,11 +5433,11 @@ function fs(n, t, e, s, r, i) {
|
|
|
5427
5433
|
// this holds all params
|
|
5428
5434
|
r
|
|
5429
5435
|
);
|
|
5430
|
-
a = f, "retryResolve" in
|
|
5431
|
-
type:
|
|
5436
|
+
a = f, "retryResolve" in y && (i == null || i.push([y, m])), "execute" in y && e.actionExecutor({
|
|
5437
|
+
type: y.type,
|
|
5432
5438
|
info: h,
|
|
5433
5439
|
params: m,
|
|
5434
|
-
exec:
|
|
5440
|
+
exec: y.execute.bind(null, e, m)
|
|
5435
5441
|
}), A && (a = fs(a, t, e, A, r, i));
|
|
5436
5442
|
}
|
|
5437
5443
|
return a;
|
|
@@ -5592,10 +5598,10 @@ function vo(n, t) {
|
|
|
5592
5598
|
getMeta: u,
|
|
5593
5599
|
toJSON: h,
|
|
5594
5600
|
...d
|
|
5595
|
-
} = n,
|
|
5601
|
+
} = n, y = {};
|
|
5596
5602
|
for (const m in i) {
|
|
5597
5603
|
const A = i[m];
|
|
5598
|
-
|
|
5604
|
+
y[m] = {
|
|
5599
5605
|
snapshot: A.getPersistedSnapshot(t),
|
|
5600
5606
|
src: A.src,
|
|
5601
5607
|
systemId: A._systemId,
|
|
@@ -5605,7 +5611,7 @@ function vo(n, t) {
|
|
|
5605
5611
|
return {
|
|
5606
5612
|
...d,
|
|
5607
5613
|
context: ps(o),
|
|
5608
|
-
children:
|
|
5614
|
+
children: y
|
|
5609
5615
|
};
|
|
5610
5616
|
}
|
|
5611
5617
|
function ps(n) {
|
|
@@ -6055,7 +6061,7 @@ class Qe {
|
|
|
6055
6061
|
const l = r[c], u = l.snapshot, h = l.src, d = typeof h == "string" ? Fe(this, h) : h;
|
|
6056
6062
|
if (!d)
|
|
6057
6063
|
return;
|
|
6058
|
-
const
|
|
6064
|
+
const y = kt(d, {
|
|
6059
6065
|
id: c,
|
|
6060
6066
|
parent: e.self,
|
|
6061
6067
|
syncSnapshot: l.syncSnapshot,
|
|
@@ -6063,7 +6069,7 @@ class Qe {
|
|
|
6063
6069
|
src: h,
|
|
6064
6070
|
systemId: l.systemId
|
|
6065
6071
|
});
|
|
6066
|
-
s[c] =
|
|
6072
|
+
s[c] = y;
|
|
6067
6073
|
});
|
|
6068
6074
|
const i = qt({
|
|
6069
6075
|
...t,
|
|
@@ -6462,7 +6468,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
|
|
|
6462
6468
|
t.controller.emit(a), t.controller.pollReplies(o, [r]);
|
|
6463
6469
|
},
|
|
6464
6470
|
notify_choice_after_discarded: ({ context: t, event: e }) => {
|
|
6465
|
-
const s = t.genEventID(), r = t.controller.river.lastTile, i = r.t.clone({ add:
|
|
6471
|
+
const s = t.genEventID(), r = t.controller.river.lastTile, i = r.t.clone({ add: g.HORIZONTAL });
|
|
6466
6472
|
for (const o of Object.values(E)) {
|
|
6467
6473
|
const a = {
|
|
6468
6474
|
id: s,
|
|
@@ -6511,7 +6517,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
|
|
|
6511
6517
|
t.controller.emit(c), t.controller.pollReplies(r, [i]);
|
|
6512
6518
|
},
|
|
6513
6519
|
notify_choice_for_reach_acceptance: ({ context: t, event: e }) => {
|
|
6514
|
-
const s = t.genEventID(), r = t.controller.river.lastTile, i = r.t.clone({ add:
|
|
6520
|
+
const s = t.genEventID(), r = t.controller.river.lastTile, i = r.t.clone({ add: g.HORIZONTAL });
|
|
6515
6521
|
for (const o of Object.values(E)) {
|
|
6516
6522
|
const a = {
|
|
6517
6523
|
id: s,
|
|
@@ -6537,11 +6543,11 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
|
|
|
6537
6543
|
e.type == "SHO_KAN" || e.type == "AN_KAN",
|
|
6538
6544
|
`unexpected event ${e.type}`
|
|
6539
6545
|
);
|
|
6540
|
-
const s = t.genEventID(), r = e.block.tiles[0].clone({ remove:
|
|
6546
|
+
const s = t.genEventID(), r = e.block.tiles[0].clone({ remove: g.HORIZONTAL });
|
|
6541
6547
|
for (const i of Object.values(E)) {
|
|
6542
6548
|
const o = t.controller.doWin(
|
|
6543
6549
|
i,
|
|
6544
|
-
e.block.tiles[0].clone({ remove:
|
|
6550
|
+
e.block.tiles[0].clone({ remove: g.HORIZONTAL }),
|
|
6545
6551
|
{
|
|
6546
6552
|
discardedBy: e.iam,
|
|
6547
6553
|
quadWin: !0,
|
|
@@ -6602,7 +6608,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
|
|
|
6602
6608
|
const a = t.currentWind;
|
|
6603
6609
|
t.controller.hand(a).reached || (t.missingMap[a] = !1);
|
|
6604
6610
|
for (const c of Object.values(E)) {
|
|
6605
|
-
let l = new w(p.BACK, 0, [
|
|
6611
|
+
let l = new w(p.BACK, 0, [g.TSUMO]);
|
|
6606
6612
|
c == a && (l = o);
|
|
6607
6613
|
const u = {
|
|
6608
6614
|
id: r,
|
|
@@ -6651,7 +6657,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
|
|
|
6651
6657
|
},
|
|
6652
6658
|
notify_reach: ({ context: t, event: e }) => {
|
|
6653
6659
|
N(e.type == "REACH", `unexpected event ${e.type}`);
|
|
6654
|
-
const s = t.genEventID(), r = e.iam, i = e.tile.clone({ add:
|
|
6660
|
+
const s = t.genEventID(), r = e.iam, i = e.tile.clone({ add: g.HORIZONTAL });
|
|
6655
6661
|
t.oneShotMap[r] = !0;
|
|
6656
6662
|
for (const o of Object.values(E)) {
|
|
6657
6663
|
const a = {
|
|
@@ -6871,7 +6877,7 @@ class vt {
|
|
|
6871
6877
|
for (let r = 0; r < 4; r++)
|
|
6872
6878
|
for (let i of s) {
|
|
6873
6879
|
let o = new w(e, i);
|
|
6874
|
-
e != p.Z && r == 3 && i == 5 && (o = o.clone({ add:
|
|
6880
|
+
e != p.Z && r == 3 && i == 5 && (o = o.clone({ add: g.RED })), this.walls.drawable.push(o.toString());
|
|
6875
6881
|
}
|
|
6876
6882
|
}
|
|
6877
6883
|
Vn(this.walls.drawable);
|
|
@@ -6931,7 +6937,7 @@ class fe {
|
|
|
6931
6937
|
let s = this.hand(t).reached ? 1 : void 0;
|
|
6932
6938
|
if (s) {
|
|
6933
6939
|
const r = this.river.discards(t);
|
|
6934
|
-
s = r.length == 0 || r.length == 1 && r[0].t.has(
|
|
6940
|
+
s = r.length == 0 || r.length == 1 && r[0].t.has(g.HORIZONTAL) ? 2 : 1;
|
|
6935
6941
|
}
|
|
6936
6942
|
return {
|
|
6937
6943
|
doraMarkers: this.observer.doraMarkers,
|
|
@@ -7051,7 +7057,7 @@ class fe {
|
|
|
7051
7057
|
const l = o.choices[i.type];
|
|
7052
7058
|
N(l, `${i.type} choice is none`), this.actor.send({
|
|
7053
7059
|
type: i.type,
|
|
7054
|
-
tile: w.from(l[0]).clone({ remove:
|
|
7060
|
+
tile: w.from(l[0]).clone({ remove: g.TSUMO }),
|
|
7055
7061
|
iam: a
|
|
7056
7062
|
});
|
|
7057
7063
|
break;
|
|
@@ -7203,20 +7209,20 @@ class fe {
|
|
|
7203
7209
|
const r = this.hand(t);
|
|
7204
7210
|
if (r.reached || r.hands.length < 3 || r.get(s.t, s.n) < 2) return !1;
|
|
7205
7211
|
const i = s.clone({ removeAll: !0 }), o = rn(t, e, b.PON), a = [], c = new X([i, i, i]).clone({
|
|
7206
|
-
replace: { idx: o, tile: s.clone({ add:
|
|
7212
|
+
replace: { idx: o, tile: s.clone({ add: g.HORIZONTAL }) }
|
|
7207
7213
|
});
|
|
7208
7214
|
let l = c;
|
|
7209
|
-
C(s) && s.has(
|
|
7215
|
+
C(s) && s.has(g.RED) && (l = c.clone({
|
|
7210
7216
|
replace: {
|
|
7211
7217
|
idx: o,
|
|
7212
7218
|
tile: i.clone({
|
|
7213
|
-
add: [
|
|
7219
|
+
add: [g.RED, g.HORIZONTAL]
|
|
7214
7220
|
})
|
|
7215
7221
|
}
|
|
7216
7222
|
}));
|
|
7217
7223
|
const u = o % 2 + 1;
|
|
7218
7224
|
if (C(s) && r.get(s.t, 0) > 0 && (l = c.clone({
|
|
7219
|
-
replace: { idx: u, tile: i.clone({ add:
|
|
7225
|
+
replace: { idx: u, tile: i.clone({ add: g.RED }) }
|
|
7220
7226
|
})), a.push(l), C(i) && r.get(i.t, 5) == 3) {
|
|
7221
7227
|
const h = c.clone({
|
|
7222
7228
|
replace: { idx: u, tile: i }
|
|
@@ -7230,8 +7236,8 @@ class fe {
|
|
|
7230
7236
|
const r = this.hand(t);
|
|
7231
7237
|
if (r.reached || r.hands.length < 3) return !1;
|
|
7232
7238
|
const i = s.clone({
|
|
7233
|
-
remove:
|
|
7234
|
-
add: [
|
|
7239
|
+
remove: g.TSUMO,
|
|
7240
|
+
add: [g.HORIZONTAL]
|
|
7235
7241
|
}), o = [];
|
|
7236
7242
|
i.n - 2 >= 1 && r.get(s.t, i.n - 2) > 0 && r.get(s.t, i.n - 1) > 0 && o.push(
|
|
7237
7243
|
new J([
|
|
@@ -7253,12 +7259,12 @@ class fe {
|
|
|
7253
7259
|
])
|
|
7254
7260
|
);
|
|
7255
7261
|
for (let d = 0; d < o.length; d++) {
|
|
7256
|
-
const
|
|
7262
|
+
const y = o[d], f = this.cannotDiscardTile(y), m = [];
|
|
7257
7263
|
for (const O of f) {
|
|
7258
7264
|
const R = r.get(O.t, O.n);
|
|
7259
|
-
for (let mt = 0; mt < R; mt++) m.push(O.clone({ remove:
|
|
7265
|
+
for (let mt = 0; mt < R; mt++) m.push(O.clone({ remove: g.RED }));
|
|
7260
7266
|
}
|
|
7261
|
-
const A = r.dec([...m,
|
|
7267
|
+
const A = r.dec([...m, y.tiles[1], y.tiles[2]]), S = r.hands.length == 0;
|
|
7262
7268
|
r.inc(A), S && o.splice(d, 1);
|
|
7263
7269
|
}
|
|
7264
7270
|
if (o.length == 0) return !1;
|
|
@@ -7270,10 +7276,10 @@ class fe {
|
|
|
7270
7276
|
(s) => C(s.tiles[1]) || C(s.tiles[2])
|
|
7271
7277
|
).map((s) => {
|
|
7272
7278
|
if (C(s.tiles[1])) {
|
|
7273
|
-
const r = s.tiles[1].clone({ add:
|
|
7279
|
+
const r = s.tiles[1].clone({ add: g.RED });
|
|
7274
7280
|
return s.clone({ replace: { idx: 1, tile: r } });
|
|
7275
7281
|
} else if (C(s.tiles[2])) {
|
|
7276
|
-
const r = s.tiles[2].clone({ add:
|
|
7282
|
+
const r = s.tiles[2].clone({ add: g.RED });
|
|
7277
7283
|
return s.clone({ replace: { idx: 2, tile: r } });
|
|
7278
7284
|
}
|
|
7279
7285
|
}).filter((s) => s != null);
|
|
@@ -7306,12 +7312,12 @@ class fe {
|
|
|
7306
7312
|
for (const [r, i] of z())
|
|
7307
7313
|
if (e.get(r, i) == 4) {
|
|
7308
7314
|
const o = new w(r, i), a = [o, o, o, o];
|
|
7309
|
-
C(o) && (a[1] = o.clone({ add:
|
|
7315
|
+
C(o) && (a[1] = o.clone({ add: g.RED })), s.push(new x(a));
|
|
7310
7316
|
}
|
|
7311
7317
|
if (s.length == 0) return !1;
|
|
7312
7318
|
for (const r of s)
|
|
7313
7319
|
N(
|
|
7314
|
-
r.tiles.filter((i) => i.has(
|
|
7320
|
+
r.tiles.filter((i) => i.has(g.HORIZONTAL)).length == 0,
|
|
7315
7321
|
`h op ${r.toString()}`
|
|
7316
7322
|
);
|
|
7317
7323
|
return s;
|
|
@@ -7325,17 +7331,17 @@ class fe {
|
|
|
7325
7331
|
for (const i of s) {
|
|
7326
7332
|
const o = i.tiles[0].clone({
|
|
7327
7333
|
removeAll: !0,
|
|
7328
|
-
add:
|
|
7334
|
+
add: g.HORIZONTAL
|
|
7329
7335
|
});
|
|
7330
7336
|
if (e.get(o.t, o.n) == 1) {
|
|
7331
|
-
const a = C(o) && e.get(o.t, 0) > 0 ? o.clone({ add:
|
|
7337
|
+
const a = C(o) && e.get(o.t, 0) > 0 ? o.clone({ add: g.RED }) : o;
|
|
7332
7338
|
r.push(new K([...i.tiles, a]));
|
|
7333
7339
|
}
|
|
7334
7340
|
}
|
|
7335
7341
|
if (r.length == 0) return !1;
|
|
7336
7342
|
for (const i of r)
|
|
7337
7343
|
N(
|
|
7338
|
-
i.tiles.filter((o) => o.has(
|
|
7344
|
+
i.tiles.filter((o) => o.has(g.HORIZONTAL)).length == 2,
|
|
7339
7345
|
`h op ${i.toString()}`
|
|
7340
7346
|
);
|
|
7341
7347
|
return r;
|
|
@@ -7347,27 +7353,27 @@ class fe {
|
|
|
7347
7353
|
if (r.get(i.t, i.n) != 3) return !1;
|
|
7348
7354
|
const o = rn(t, e, b.DAI_KAN);
|
|
7349
7355
|
let a = new Y([i, i, i, i]).clone({
|
|
7350
|
-
replace: { idx: o, tile: i.clone({ add:
|
|
7356
|
+
replace: { idx: o, tile: i.clone({ add: g.HORIZONTAL }) }
|
|
7351
7357
|
});
|
|
7352
|
-
if (C(s) && s.has(
|
|
7358
|
+
if (C(s) && s.has(g.RED))
|
|
7353
7359
|
a = a.clone({
|
|
7354
7360
|
replace: {
|
|
7355
7361
|
idx: o,
|
|
7356
|
-
tile: i.clone({ add: [
|
|
7362
|
+
tile: i.clone({ add: [g.HORIZONTAL, g.RED] })
|
|
7357
7363
|
}
|
|
7358
7364
|
});
|
|
7359
|
-
else if (C(s) && !s.has(
|
|
7365
|
+
else if (C(s) && !s.has(g.RED)) {
|
|
7360
7366
|
N(
|
|
7361
7367
|
r.get(s.t, 0) > 0,
|
|
7362
7368
|
`hand does not have red tile: ${r.toString()}`
|
|
7363
7369
|
);
|
|
7364
7370
|
const c = o % 3 + 1;
|
|
7365
7371
|
a = a.clone({
|
|
7366
|
-
replace: { idx: c, tile: i.clone({ add:
|
|
7372
|
+
replace: { idx: c, tile: i.clone({ add: g.RED }) }
|
|
7367
7373
|
});
|
|
7368
7374
|
}
|
|
7369
7375
|
return N(
|
|
7370
|
-
a.tiles.filter((c) => c.has(
|
|
7376
|
+
a.tiles.filter((c) => c.has(g.HORIZONTAL)).length == 1,
|
|
7371
7377
|
`h op ${a.toString()}`
|
|
7372
7378
|
), a;
|
|
7373
7379
|
}
|
|
@@ -7458,17 +7464,17 @@ class gs {
|
|
|
7458
7464
|
case "CHI":
|
|
7459
7465
|
case "DAI_KAN": {
|
|
7460
7466
|
const r = T.deserialize(t.block);
|
|
7461
|
-
this.hands[t.iam].call(r), this.river.markCalled(), t.iam != t.wind && this.counter.dec(...r.tiles.filter((i) => !i.has(
|
|
7467
|
+
this.hands[t.iam].call(r), this.river.markCalled(), t.iam != t.wind && this.counter.dec(...r.tiles.filter((i) => !i.has(g.HORIZONTAL)));
|
|
7462
7468
|
break;
|
|
7463
7469
|
}
|
|
7464
7470
|
case "SHO_KAN": {
|
|
7465
7471
|
const r = K.from(t.block.tiles);
|
|
7466
|
-
this.hands[t.iam].kan(r), t.iam != t.wind && this.counter.dec(r.tiles.filter((i) => i.has(
|
|
7472
|
+
this.hands[t.iam].kan(r), t.iam != t.wind && this.counter.dec(r.tiles.filter((i) => i.has(g.HORIZONTAL))[0]);
|
|
7467
7473
|
break;
|
|
7468
7474
|
}
|
|
7469
7475
|
case "AN_KAN": {
|
|
7470
7476
|
const r = x.from(t.block.tiles);
|
|
7471
|
-
this.hands[t.iam].kan(r), t.iam != t.wind && this.counter.dec(...r.tiles.filter((i) => !i.has(
|
|
7477
|
+
this.hands[t.iam].kan(r), t.iam != t.wind && this.counter.dec(...r.tiles.filter((i) => !i.has(g.HORIZONTAL)));
|
|
7472
7478
|
break;
|
|
7473
7479
|
}
|
|
7474
7480
|
case "REACH": {
|
|
@@ -7673,7 +7679,7 @@ class Qo {
|
|
|
7673
7679
|
}
|
|
7674
7680
|
}
|
|
7675
7681
|
const ta = (n) => {
|
|
7676
|
-
const [t, e] = Zt(), [s, r] = Zt(), [i, o] = Zt(), [a, c] = Zt(), l = ["player-1", "player-2", "player-3", "player-4"], u = n == null ? void 0 : n.playerInjection, h = (u == null ? void 0 : u.p1) ?? Jt, d = (u == null ? void 0 : u.p2) ?? Jt,
|
|
7682
|
+
const [t, e] = Zt(), [s, r] = Zt(), [i, o] = Zt(), [a, c] = Zt(), l = ["player-1", "player-2", "player-3", "player-4"], u = n == null ? void 0 : n.playerInjection, h = (u == null ? void 0 : u.p1) ?? Jt, d = (u == null ? void 0 : u.p2) ?? Jt, y = (u == null ? void 0 : u.p3) ?? Jt, f = (u == null ? void 0 : u.p4) ?? Jt, m = new h(l[0], e), A = new d(l[1], r), S = new y(l[2], o), O = new f(l[3], c), R = [
|
|
7677
7683
|
{ handler: t, id: l[0] },
|
|
7678
7684
|
{ handler: s, id: l[1] },
|
|
7679
7685
|
{ handler: i, id: l[2] },
|
|
@@ -7730,7 +7736,7 @@ class ce {
|
|
|
7730
7736
|
{
|
|
7731
7737
|
const o = t.get(r);
|
|
7732
7738
|
i += o * ot(r, s);
|
|
7733
|
-
const a = t.get(new w(r.t, r.n + 1)), c = t.get(new w(r.t, r.n + 2)), l = t.get(new w(r.t, r.n - 1)), u = t.get(new w(r.t, r.n - 2)), h = r.n - 2 > 0 ? Math.min(l, u) : 0, d = r.n + 2 <= 9 ? Math.min(a, c) : 0,
|
|
7739
|
+
const a = t.get(new w(r.t, r.n + 1)), c = t.get(new w(r.t, r.n + 2)), l = t.get(new w(r.t, r.n - 1)), u = t.get(new w(r.t, r.n - 2)), h = r.n - 2 > 0 ? Math.min(l, u) : 0, d = r.n + 2 <= 9 ? Math.min(a, c) : 0, y = r.n - 1 >= 1 && r.n + 1 <= 9 ? Math.min(a, l) : 0, f = Math.max(h, y), m = Math.max(y, d);
|
|
7734
7740
|
return i += o * ot(r, s), i += h * ot(new w(r.t, r.n - 2), s), i += d * ot(new w(r.t, r.n + 2), s), i += f * ot(new w(r.t, r.n - 1), s), i += m * ot(new w(r.t, r.n + 1), s), r.n == 0, i;
|
|
7735
7741
|
}
|
|
7736
7742
|
}
|
|
@@ -7810,7 +7816,7 @@ export {
|
|
|
7810
7816
|
Go as MyUse,
|
|
7811
7817
|
V as N19,
|
|
7812
7818
|
Kt as NZ,
|
|
7813
|
-
|
|
7819
|
+
g as OP,
|
|
7814
7820
|
Bo as Observer,
|
|
7815
7821
|
B as Parser,
|
|
7816
7822
|
re as PlaceManager,
|