diff --git a/server/sample_data/sample_doudizhu-test.json b/server/sample_data/sample_doudizhu-test.json new file mode 100644 index 0000000..0f107a9 --- /dev/null +++ b/server/sample_data/sample_doudizhu-test.json @@ -0,0 +1,38 @@ +{ + "initHands": [ + "S2 H2 HK DK HQ CQ DQ CJ S9 H9 D9 C7 S6 H6 C4 D4 S3", + "C2 HA CA DA SQ ST HT D8 S7 H7 C6 D6 S5 H5 C5 S4 H4", + "RJ BJ D2 SA SK CK SJ HJ DJ CT DT C9 S8 H8 C8 D7 D5 H3 S3 D3" + ], + "playerInfo": [ + { + "id": 0, + "index": 0, + "role": "peasant" + }, + { + "id": 1, + "index": 1, + "role": "peasant" + }, + { + "id": 2, + "index": 2, + "role": "landlord" + } + ], + "moveHistory": [ + { + "playerIdx": 2, + "move": "P" + }, + { + "playerIdx": 0, + "move": "P" + }, + { + "playerIdx": 1, + "move": "P" + } + ] +} \ No newline at end of file diff --git a/server/sample_data/sample_doudizhu.json b/server/sample_data/sample_doudizhu.json deleted file mode 100644 index 71585c6..0000000 --- a/server/sample_data/sample_doudizhu.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "initHands": [ - "S2 H2 HK DK HQ CQ DQ CJ S9 H9 D9 C7 S6 H6 C4 D4 S3", - "C2 HA CA DA SQ ST HT D8 S7 H7 C6 D6 S5 H5 C5 S4 H4", - "RJ BJ D2 SA SK CK SJ HJ DJ CT DT C9 S8 H8 C8 D7 D5 H3 S3 D3" - ], - "playerInfo": [ - { - "id": 0, - "index": 0, - "role": "peasant" - }, - { - "id": 1, - "index": 1, - "role": "peasant" - }, - { - "id": 2, - "index": 2, - "role": "landlord" - } - ], - "moveHistory": [ - { - "playerIdx": 2, - "move": "H3 S3 D3 D5" - }, - { - "playerIdx": 0, - "move": "S9 H9 D9 S3" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "SJ HJ DJ D7" - }, - { - "playerIdx": 0, - "move": "HQ CQ DQ C7" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "P" - }, - { - "playerIdx": 0, - "move": "C4 D4" - }, - { - "playerIdx": 1, - "move": "ST HT" - }, - { - "playerIdx": 2, - "move": "SK CK" - }, - { - "playerIdx": 0, - "move": "S2 H2" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "P" - }, - { - "playerIdx": 0, - "move": "S6 H6" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "CT DT" - }, - { - "playerIdx": 0, - "move": "HK DK" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "RJ BJ" - }, - { - "playerIdx": 0, - "move": "P" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "S8 H8 C8 C9" - }, - { - "playerIdx": 0, - "move": "P" - }, - { - "playerIdx": 1, - "move": "HA CA DA H5" - }, - { - "playerIdx": 2, - "move": "P" - }, - { - "playerIdx": 0, - "move": "P" - }, - { - "playerIdx": 1, - "move": "SQ" - }, - { - "playerIdx": 2, - "move": "D2" - }, - { - "playerIdx": 0, - "move": "P" - }, - { - "playerIdx": 1, - "move": "P" - }, - { - "playerIdx": 2, - "move": "SA" - } - ] -} \ No newline at end of file diff --git a/src/components/GameBoard/index.js b/src/components/GameBoard/index.js index b500b79..a210c8a 100644 --- a/src/components/GameBoard/index.js +++ b/src/components/GameBoard/index.js @@ -53,7 +53,7 @@ class DoudizhuGameBoard extends React.Component { computeSingleLineHand(cards) { console.log(cards); if(cards === "P"){ - return