-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
實作最後一人離開房間後則自動關閉房間 #149
實作最後一人離開房間後則自動關閉房間 #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
room.leaveRoom(player.id) | ||
roomRepository.leaveRoom(room) | ||
if (room.isEmpty()) roomRepository.deleteById(room.roomId!!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
room.leaveRoom(player)
if (room.isEmpty()) {
roomRepository.deleteById(room)
} else {
roomRepository.leaveRoom(room)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
roomRepository.leaveRoom(room) | ||
|
||
if (room.isEmpty()) { | ||
roomRepository.deleteById(room.roomId!!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
昨天忘了補充,請幫我將 deleteById 改成下方這樣 🙏
roomRepository.closeRoom(room)
if (room.isEmpty()) { | ||
roomRepository.deleteById(room.roomId!!) | ||
} else { | ||
roomRepository.leaveRoom(room) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT:可以考慮用 when
d2f5812
to
b35993e
Compare
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why need this change? / Root cause:
Changes made:
Test Scope / Change impact:
Issue