diff --git a/server/sample_data/sample_leduc_holdem.json b/server/sample_data/sample_leduc_holdem.json index 4b92154..b01c350 100644 --- a/server/sample_data/sample_leduc_holdem.json +++ b/server/sample_data/sample_leduc_holdem.json @@ -22,7 +22,7 @@ "probabilities": [ { "move": "Check", - "probability": 0.35 + "probability": 0.7661 }, { "move": "Raise", @@ -34,7 +34,7 @@ }, { "move": "Fold", - "probability": 0.01 + "probability": 0.2339 } ] }, @@ -44,11 +44,11 @@ "probabilities": [ { "move": "Raise", - "probability": 0.9 + "probability": 0.4123 }, { "move": "Check", - "probability": 0.05 + "probability": 0.4983 }, { "move": "Call", @@ -56,7 +56,7 @@ }, { "move": "Fold", - "probability": 0.01 + "probability": 0.0894 } ] }, @@ -66,19 +66,19 @@ "probabilities": [ { "move": "Call", - "probability": 0.9 + "probability": 0.5251 }, { "move": "Check", - "probability": 0.05 + "probability": -1 }, { "move": "Raise", - "probability": 0.02 + "probability": 0.1803 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.2946 } ] }, @@ -88,19 +88,19 @@ "probabilities": [ { "move": "Check", - "probability": 0.9 + "probability": 0.7435 }, { "move": "Raise", - "probability": 0.05 + "probability": 0.2324 }, { "move": "Call", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.0241 } ] } @@ -112,19 +112,19 @@ "probabilities": [ { "move": "Raise", - "probability": 0.9 + "probability": 0.5031 }, { "move": "Check", - "probability": 0.05 + "probability": 0.2138 }, { "move": "Call", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.2931 } ] }, @@ -134,19 +134,19 @@ "probabilities": [ { "move": "Call", - "probability": 0.9 + "probability": 0.4363 }, { "move": "Check", - "probability": 0.05 + "probability": -1 }, { "move": "Raise", - "probability": 0.02 + "probability": 0.3512 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.2485 } ] }, @@ -156,19 +156,19 @@ "probabilities": [ { "move": "Raise", - "probability": 0.9 + "probability": 0.6402 }, { "move": "Check", - "probability": 0.05 + "probability": 0.2563 }, { "move": "Call", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.1035 } ] }, @@ -178,19 +178,19 @@ "probabilities": [ { "move": "Call", - "probability": 0.9 + "probability": 0.6042 }, { "move": "Check", - "probability": 0.05 + "probability": -1 }, { "move": "Raise", - "probability": 0.02 + "probability": -1 }, { "move": "Fold", - "probability": 0.01 + "probability": 0.3958 } ] } diff --git a/src/view/DoudizhuGameView.js b/src/view/DoudizhuGameView.js index aff711a..7beb6ae 100644 --- a/src/view/DoudizhuGameView.js +++ b/src/view/DoudizhuGameView.js @@ -17,6 +17,11 @@ import ReplayRoundedIcon from '@material-ui/icons/ReplayRounded'; import NotInterestedIcon from '@material-ui/icons/NotInterested'; import SkipNextIcon from '@material-ui/icons/SkipNext'; import SkipPreviousIcon from '@material-ui/icons/SkipPrevious'; +import DialogTitle from "@material-ui/core/DialogTitle"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogActions from "@material-ui/core/DialogActions"; +import Dialog from "@material-ui/core/Dialog"; class DoudizhuGameView extends React.Component { constructor(props) { @@ -47,6 +52,8 @@ class DoudizhuGameView extends React.Component { gameInfo: this.initGameState, gameStateLoop: null, gameSpeed: 0, + gameEndDialog: false, + gameEndDialogText: "", fullScreenLoading: false }; } @@ -89,11 +96,13 @@ class DoudizhuGameView extends React.Component { this.setState({ gameInfo: gameInfo }); if(winner.role === "landlord") setTimeout(()=>{ - alert("Landlord Wins"); + const mes = "Landlord Wins"; + this.setState({gameEndDialog: true, gameEndDialogText: mes}); }, 200); else setTimeout(()=>{ - alert("Peasants Win"); + const mes = "Peasants Win"; + this.setState({gameEndDialog: true, gameEndDialogText: mes}); }, 200); }else{ Message({ @@ -311,6 +320,10 @@ class DoudizhuGameView extends React.Component { this.setState({gameInfo: gameInfo}); } + handleCloseGameEndDialog() { + this.setState({gameEndDialog: false, gameEndDialogText: ""}); + } + render(){ let sliderValueText = (value) => { return value; @@ -348,6 +361,24 @@ class DoudizhuGameView extends React.Component { return (