Skip to content

Commit

Permalink
出牌
Browse files Browse the repository at this point in the history
  • Loading branch information
HullQin committed Oct 2, 2021
1 parent a6070ae commit b8566c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/Room/GamingRoom/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ const GamingRoom = (props) => {
<div className='room-seat-info'>
<div className='room-seat-role'>{game.state === 2 && game.landlord === seat ? '👲 地主' : '👨‍🌾 农民'}</div>
<div><span className='room-seat-rest'>{game.held[seat]}</span> 张牌</div>
{game.state === 2 && (
<div style={{ position: 'relative' }}>
{game.last[seat].sort((a, b) => pokerMap[b === 0 ? 0 : b % 54 === 0 ? 54 : b % 54] - pokerMap[a === 0 ? 0 : a % 54 === 0 ? 54 : a % 54]).map((id, index) => <Poker style={{ position: 'absolute', top: 30 * index, transform: 'scale(0.5)' }} key={id} id={id} />)}
</div>
)}
</div>
)}
/>
Expand Down Expand Up @@ -94,4 +99,6 @@ const GamingRoom = (props) => {
);
};

const pokerMap = [0, 14.2, 15.2, 3.2, 4.2, 5.2, 6.2, 7.2, 8.2, 9.2, 10.2, 11.2, 12.2, 13.2, 14.4, 15.4, 3.4, 4.4, 5.4, 6.4, 7.4, 8.4, 9.4, 10.4, 11.4, 12.4, 13.4, 14.6, 15.6, 3.6, 4.6, 5.6, 6.6, 7.6, 8.6, 9.6, 10.6, 11.6, 12.6, 13.6, 14.8, 15.8, 3.8, 4.8, 5.8, 6.8, 7.8, 8.8, 9.8, 10.8, 11.8, 12.8, 13.8, 54, 53];

export default GamingRoom;

0 comments on commit b8566c1

Please sign in to comment.