diff --git a/server/sample_data/doudizhu_random.json b/server/sample_data/doudizhu_random.json new file mode 100644 index 0000000..c5b1f57 --- /dev/null +++ b/server/sample_data/doudizhu_random.json @@ -0,0 +1,735 @@ +{ + "initHands": [ + "C3 H3 S3 C5 S5 S7 D8 C8 S8 S9 C9 CQ DQ HQ SK HK HA DA D2 RJ", + "D3 C4 D5 H6 H7 H8 D9 H9 HT DT HJ CK CA SA H2 C2 S2", + "D4 H4 S4 H5 C6 D6 S6 D7 C7 CT ST CJ SJ DJ SQ DK BJ" + ], + "playerInfo": [ + { + "id": 0, + "index": 0, + "role": "landlord" + }, + { + "id": 1, + "index": 1, + "role": "peasant" + }, + { + "id": 2, + "index": 2, + "role": "peasant" + } + ], + "moveHistory": [ + { + "playerIdx": 0, + "move": [ + "D2" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D2" + }, + { + "probability": 0.003236245954692557, + "move": "S7" + }, + { + "probability": 0.003236245954692557, + "move": "CQ DQ HQ" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "C5", + "S5", + "D8", + "C8", + "S8" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "C5 S5 D8 C8 S8" + }, + { + "probability": 0.003236245954692557, + "move": "CQ DQ HQ" + }, + { + "probability": 0.003236245954692557, + "move": "HA" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "H2 C2 S2" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "D4", + "H4", + "S4" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D4 H4 S4" + }, + { + "probability": 0.003236245954692557, + "move": "C6 D6 S6" + }, + { + "probability": 0.003236245954692557, + "move": "CJ SJ DJ" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "CQ", + "DQ", + "HQ" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "CQ DQ HQ" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "D8 C8 S8" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "H2", + "C2", + "S2" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "H2 C2 S2" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "D3" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D3" + }, + { + "probability": 0.003236245954692557, + "move": "D9" + }, + { + "probability": 0.003236245954692557, + "move": "H8" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "D3" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D3" + }, + { + "probability": 0.003236245954692557, + "move": "CA SA" + }, + { + "probability": 0.003236245954692557, + "move": "CA" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "C4" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "C4" + }, + { + "probability": 0.003236245954692557, + "move": "D3" + }, + { + "probability": 0.003236245954692557, + "move": "DT" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "BJ" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "CJ" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "CJ" + }, + { + "probability": 0.003236245954692557, + "move": "D7" + }, + { + "probability": 0.003236245954692557, + "move": "H5 C6 D6 S6" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "H5" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "H5" + }, + { + "probability": 0.003236245954692557, + "move": "C6" + }, + { + "probability": 0.003236245954692557, + "move": "CT ST" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "D8 C8 S8" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "CT", + "ST" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "CT ST" + }, + { + "probability": 0.003236245954692557, + "move": "H5" + }, + { + "probability": 0.003236245954692557, + "move": "SQ" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "DA" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "DA" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "D2" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "D8" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D8" + }, + { + "probability": 0.003236245954692557, + "move": "SK HK" + }, + { + "probability": 0.003236245954692557, + "move": "C5 S5 C8 S8 D8" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "S7" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "S7" + }, + { + "probability": 0.003236245954692557, + "move": "C5 C8 S8 D8" + }, + { + "probability": 0.003236245954692557, + "move": "C8" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "HA" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "HA" + }, + { + "probability": 0.003236245954692557, + "move": "DA HA" + }, + { + "probability": 0.003236245954692557, + "move": "S7" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "S5", + "C5" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "S5 C5" + }, + { + "probability": 0.003236245954692557, + "move": "S5 S8 D8 C8" + }, + { + "probability": 0.003236245954692557, + "move": "S8 D8" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "DT" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "DT" + }, + { + "probability": 0.003236245954692557, + "move": "D9" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "SQ" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "SQ" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 0, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 1, + "move": [], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "CT", + "ST" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "CT ST" + }, + { + "probability": 0.003236245954692557, + "move": "H5" + }, + { + "probability": 0.003236245954692557, + "move": "CT" + } + ] + }, + { + "playerIdx": 0, + "move": [ + "S9" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "S9" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + }, + { + "probability": 0.003236245954692557, + "move": "C8" + } + ] + }, + { + "playerIdx": 1, + "move": [ + "D9" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "D9" + }, + { + "probability": 0.003236245954692557, + "move": "pass" + } + ] + }, + { + "playerIdx": 2, + "move": [ + "ST" + ], + "probabilities": [ + { + "probability": 0.003236245954692557, + "move": "ST" + }, + { + "probability": 0.003236245954692557, + "move": "CT ST" + } + ] + } + ] +} diff --git a/server/sample_data/sample_doudizhu.json b/server/sample_data/sample_doudizhu.json index f5a1e86..b334fb8 100644 --- a/server/sample_data/sample_doudizhu.json +++ b/server/sample_data/sample_doudizhu.json @@ -72,10 +72,10 @@ }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -111,27 +111,27 @@ "probability": 0.05 }, { - "move": "P", + "move": "pass", "probability": 0.02 } ] }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] }, { "playerIdx": 2, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -177,7 +177,7 @@ "move": "SK CK", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 0.5 }, { @@ -195,7 +195,7 @@ "move": "S2 H2", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 0.5 }, { @@ -206,20 +206,20 @@ }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] }, { "playerIdx": 2, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -244,10 +244,10 @@ }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 0.8 }, { @@ -265,7 +265,7 @@ "move": "CT DT", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 0.5 }, { @@ -287,17 +287,17 @@ "probability": 0.9 }, { - "move": "P", + "move": "pass", "probability": 0.1 } ] }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 0.9 }, { @@ -315,27 +315,27 @@ "probability": 0.9 }, { - "move": "P", + "move": "pass", "probability": 0.1 } ] }, { "playerIdx": 0, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -360,10 +360,10 @@ }, { "playerIdx": 0, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -377,7 +377,7 @@ "probability": 0.5 }, { - "move": "P", + "move": "pass", "probability": 0.1 }, { @@ -388,20 +388,20 @@ }, { "playerIdx": 2, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] }, { "playerIdx": 0, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] @@ -437,27 +437,27 @@ "probability": 0.3 }, { - "move": "P", + "move": "pass", "probability": 0.2 } ] }, { "playerIdx": 0, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] }, { "playerIdx": 1, - "move": "P", + "move": "pass", "probabilities": [ { - "move": "P", + "move": "pass", "probability": 1 } ] diff --git a/server/sample_data/sample_leduc_holdem.json b/server/sample_data/sample_leduc_holdem.json index 03e14e0..4b92154 100644 --- a/server/sample_data/sample_leduc_holdem.json +++ b/server/sample_data/sample_leduc_holdem.json @@ -22,15 +22,15 @@ "probabilities": [ { "move": "Check", - "probability": 0.9 + "probability": 0.35 }, { "move": "Raise", - "probability": 0.05 + "probability": -1 }, { "move": "Call", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", @@ -52,7 +52,7 @@ }, { "move": "Call", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", diff --git a/src/assets/doudizhu.scss b/src/assets/doudizhu.scss index c045ca9..f20b1e2 100644 --- a/src/assets/doudizhu.scss +++ b/src/assets/doudizhu.scss @@ -35,11 +35,11 @@ height: 60px; .timer-text { color: #303133; - margin-top: 3px; + margin-top: 5px; font-size: 23px; font-weight: bold; text-shadow: 0 2px 2px #909399; - line-height: 57px; + line-height: 55px; } text-align: center; background-image: url("./images/timer.png"); @@ -59,10 +59,7 @@ font-size: 23px; font-weight: bold; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); - //letter-spacing: -4px; color: #F2F6FC; - - } } } @@ -72,6 +69,7 @@ display: table; span { + color: whitesmoke; display: table-cell; vertical-align: middle; text-align: center; @@ -196,6 +194,7 @@ padding-left: 20px; margin-left: 130px; width: 450px; + font-size: 14px; } .player-hand-placeholder { diff --git a/src/assets/gameview.scss b/src/assets/gameview.scss index e69d890..eb5afa1 100644 --- a/src/assets/gameview.scss +++ b/src/assets/gameview.scss @@ -2,10 +2,15 @@ margin: 5px; } +.MuiAppBar-colorPrimary.header-bar-wrapper { + background-color: #373538; +} + .header-bar { width: 1000px; margin-left: auto; margin-right: auto; + height: 65px; padding: 5px; display: flex; .stretch { @@ -50,23 +55,28 @@ display: flex; align-items: center; justify-content: center; - font-size: 26px; - font-weight: 600; - letter-spacing: 1px; - -ms-transform:scale(1, 1.1) translateY(-1px); - -webkit-transform:scale(1, 1.1) translateY(-1px); - -moz-transform:scale(1, 1.1) translateY(-1px); - -o-transform:scale(1, 1.1) translateY(-1px); + .title-text{ + line-height: 65px; + font-size: 26px; + font-weight: 600; + letter-spacing: 1px; + transform: scale(1, 1.1) translateY(-1px); + -ms-transform:scale(1, 1.1) translateY(-1px); + -webkit-transform:scale(1, 1.1) translateY(1px); + -moz-transform:scale(1, 1.1) translateY(-1px); + -o-transform:scale(1, 1.1) translateY(-1px); - .subtitle { - color: #C0C4CC; - margin-left: 11px; - font-size: 16px; - -ms-transform: translateY(3px); - -webkit-transform: translateY(3px); - -moz-transform: translateY(3px); - -o-transform: translateY(3px); + .subtitle { + color: #C0C4CC; + margin-left: 11px; + font-size: 16px; + -ms-transform: translateY(3px); + -webkit-transform: translateY(3px); + -moz-transform: translateY(3px); + -o-transform: translateY(3px); + } } + } } @@ -171,6 +181,10 @@ text-align: center; font-size: 16px; font-weight: bolder; + text-shadow: -1px -1px 0 #fff, + 1px -1px 0 #fff, + -1px 1px 0 #fff, + 1px 1px 0 #fff; } } .non-card.hide { @@ -265,6 +279,10 @@ font-size: 16px; font-weight: bolder; color: #303133; + text-shadow: -1px -1px 0 #fff, + 1px -1px 0 #fff, + -1px 1px 0 #fff, + 1px 1px 0 #fff; } } .non-card.hide { diff --git a/src/assets/images/Actions/Call_u.png b/src/assets/images/Actions/Call_u.png new file mode 100644 index 0000000..055ff35 Binary files /dev/null and b/src/assets/images/Actions/Call_u.png differ diff --git a/src/assets/images/Actions/Check_u.png b/src/assets/images/Actions/Check_u.png new file mode 100644 index 0000000..fdfee10 Binary files /dev/null and b/src/assets/images/Actions/Check_u.png differ diff --git a/src/assets/images/Actions/Fold_u.png b/src/assets/images/Actions/Fold_u.png new file mode 100644 index 0000000..f394937 Binary files /dev/null and b/src/assets/images/Actions/Fold_u.png differ diff --git a/src/assets/images/Actions/Raise_u.png b/src/assets/images/Actions/Raise_u.png new file mode 100644 index 0000000..7b1250a Binary files /dev/null and b/src/assets/images/Actions/Raise_u.png differ diff --git a/src/assets/index.css b/src/assets/index.css index bbad0b7..7eeaf60 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -1,9 +1,10 @@ @import url('https://fonts.googleapis.com/css?family=Arvo&display=swap'); body { + background-color: rgb(241, 241, 241); margin: 0; color: #606266; - font-family: 'Rockwell', 'Arvo', monospace; + font-family: 'Arvo', 'Rockwell', monospace; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } diff --git a/src/assets/leducholdem.scss b/src/assets/leducholdem.scss index f0b8573..0187276 100644 --- a/src/assets/leducholdem.scss +++ b/src/assets/leducholdem.scss @@ -36,11 +36,11 @@ height: 60px; .timer-text { color: #303133; - margin-top: 3px; + margin-top: 5px; font-size: 23px; font-weight: bold; text-shadow: 0 2px 2px #909399; - line-height: 57px; + line-height: 55px; } text-align: center; background-image: url("./images/timer.png"); @@ -51,7 +51,16 @@ .non-card { display: table; width: 80px; - height: 40px; + height: 60px; + .action-text { + display: table-cell; + vertical-align: middle; + text-align: center; + font-size: 23px; + font-weight: bold; + text-shadow: 0 2px 2px rgba(0, 0, 0, 0.87); + color: #F2F6FC; + } } } diff --git a/src/components/GameBoard/DoudizhuGameBoard.js b/src/components/GameBoard/DoudizhuGameBoard.js index bd8d9e4..b389ab4 100644 --- a/src/components/GameBoard/DoudizhuGameBoard.js +++ b/src/components/GameBoard/DoudizhuGameBoard.js @@ -52,7 +52,7 @@ class DoudizhuGameBoard extends React.Component { } computeSingleLineHand(cards, fadeClassName="") { - if(cards === "P"){ + if(cards === "pass"){ return