Skip to content

Commit

Permalink
Merge branch 'release/v1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
kobalab committed Oct 27, 2024
2 parents 82b8b87 + 003ccd1 commit a253d26
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v1.3.1 / 2024-10-27

- Majiang.Board が配牌にドラがない・ドラが複数ある場合を処理できるよう修正

## v1.3.0 / 2024-10-19

- Majiang.Board にメソッド last() を追加
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Majiang = require('@kobalab/majiang-core');
| ``Majiang.Board`` | 卓情報を更新するクラス |
| ``Majiang.Player`` | 対局者を実現する基底クラス |

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

## ライセンス
Expand Down
2 changes: 1 addition & 1 deletion lib/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Majiang = {
class Shan {
constructor(baopai) {
this.paishu = 136 - 13 * 4 - 14;
this.baopai = [ baopai ];
this.baopai = [].concat(baopai||[]);
this.fubaopai;
}
zimo(p) { this.paishu--; return p || '_' }
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* @kobalab/majiang-core v1.3.0
* @kobalab/majiang-core v1.3.1
*
* Copyright(C) 2021 Satoshi Kobayashi
* Released under the MIT license
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kobalab/majiang-core",
"version": "1.3.0",
"version": "1.3.1",
"description": "麻雀基本ライブラリ",
"publishConfig": {
"access": "public"
Expand Down
10 changes: 10 additions & 0 deletions test/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ suite('Majiang.Board', ()=>{
assert.equal(board.he.map(he=>he._pai.length)
.reduce((x,y)=>x+y), 0));
test('手番が初期化されること', ()=> assert.equal(board.lunban, -1));
test('ドラが未確定でも処理できること', ()=>{
qipai.baopai = '';
board.qipai(qipai);
assert.equal(board.shan.baopai.length, 0);
});
test('ドラが複数でも処理できること', ()=>{
qipai.baopai = ['s1','p9'];
board.qipai(qipai);
assert.deepEqual(board.shan.baopai, qipai.baopai);
});
});

suite('zimo(zimo)', ()=>{
Expand Down

0 comments on commit a253d26

Please sign in to comment.