강동현

Game, WordGuessingGame 추가

import { User } from "../user/User";
export interface Game {
join(user: User): void;
leave(user: User): void;
}
import { roomChatHandler } from "../message/handler/roomChatHandler";
import { Room } from "../room/Room";
import { User } from "../user/User";
import { Game } from "./Game";
export class WorldGuessingGame implements Game {
room: Room;
maxRound: number;
round: number;
constructor(room: Room) {
this.room = room;
if (this.room.users.length < 2) {
throw new Error("인원이 부족합니다.");
}
// TODO: 방장이 설정
this.maxRound = 5;
this.round = 1;
}
join(user: User): void {
throw new Error("Method not implemented.");
}
leave(user: User): void {
throw new Error("Method not implemented.");
}
}
......@@ -15,7 +15,7 @@ export class Room {
public name: string;
public readonly maxUsers: number;
private users: User[] = [];
public users: User[] = [];
private closed: boolean = false;
......