Skip to content

Commit a253d26

Browse files
committed
Merge branch 'release/v1.3.1'
2 parents 82b8b87 + 003ccd1 commit a253d26

File tree

7 files changed

+20
-5
lines changed

7 files changed

+20
-5
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### v1.3.1 / 2024-10-27
2+
3+
- Majiang.Board が配牌にドラがない・ドラが複数ある場合を処理できるよう修正
4+
15
## v1.3.0 / 2024-10-19
26

37
- Majiang.Board にメソッド last() を追加

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const Majiang = require('@kobalab/majiang-core');
2727
| ``Majiang.Board`` | 卓情報を更新するクラス |
2828
| ``Majiang.Player`` | 対局者を実現する基底クラス |
2929

30+
## API仕様
3031
- [API仕様](https://github.com/kobalab/majiang-core/wiki)
3132

3233
## ライセンス

lib/board.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Majiang = {
1111
class Shan {
1212
constructor(baopai) {
1313
this.paishu = 136 - 13 * 4 - 14;
14-
this.baopai = [ baopai ];
14+
this.baopai = [].concat(baopai||[]);
1515
this.fubaopai;
1616
}
1717
zimo(p) { this.paishu--; return p || '_' }

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* @kobalab/majiang-core v1.3.0
2+
* @kobalab/majiang-core v1.3.1
33
*
44
* Copyright(C) 2021 Satoshi Kobayashi
55
* Released under the MIT license

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kobalab/majiang-core",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "麻雀基本ライブラリ",
55
"publishConfig": {
66
"access": "public"

test/board.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ suite('Majiang.Board', ()=>{
101101
assert.equal(board.he.map(he=>he._pai.length)
102102
.reduce((x,y)=>x+y), 0));
103103
test('手番が初期化されること', ()=> assert.equal(board.lunban, -1));
104+
test('ドラが未確定でも処理できること', ()=>{
105+
qipai.baopai = '';
106+
board.qipai(qipai);
107+
assert.equal(board.shan.baopai.length, 0);
108+
});
109+
test('ドラが複数でも処理できること', ()=>{
110+
qipai.baopai = ['s1','p9'];
111+
board.qipai(qipai);
112+
assert.deepEqual(board.shan.baopai, qipai.baopai);
113+
});
104114
});
105115

106116
suite('zimo(zimo)', ()=>{

0 commit comments

Comments
 (0)