DO-49 매치 메이킹 시 닉네임 교환토록 처리
This commit is contained in:
parent
43a7ecfaa6
commit
072876bbf0
@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* 게임 방 클래스
|
|
||||||
*/
|
|
||||||
class Room {
|
|
||||||
/**
|
|
||||||
* 새로운 방 객체 생성
|
|
||||||
* @param {string} roomId - 방 고유 ID
|
|
||||||
* @param {string} hostId - 방장 소켓 ID
|
|
||||||
* @param {number} rating - 방장의 급수 (1-18)
|
|
||||||
*/
|
|
||||||
constructor(roomId, hostId, rating) {
|
|
||||||
this.roomId = roomId;
|
|
||||||
this.hostId = hostId;
|
|
||||||
this.rating = rating;
|
|
||||||
this.createdAt = new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 해당 방의 정보를 객체로 반환
|
|
||||||
* @returns {Object} 방 정보 객체
|
|
||||||
*/
|
|
||||||
toJSON() {
|
|
||||||
return {
|
|
||||||
roomId: this.roomId,
|
|
||||||
hostId: this.hostId,
|
|
||||||
rating: this.rating,
|
|
||||||
createdAt: this.createdAt
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Room;
|
|
Loading…
x
Reference in New Issue
Block a user