Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강동현
2021-06-01 01:46:50 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c0ef384b3e32c7d44aeaa277fc92085e3f565574
c0ef384b
1 parent
695c4b57
Game, WordGuessingGame 추가
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletions
server/game/Game.ts
server/game/WordGuessingGame.ts
server/room/Room.ts
server/game/Game.ts
0 → 100644
View file @
c0ef384
import
{
User
}
from
"../user/User"
;
export
interface
Game
{
join
(
user
:
User
):
void
;
leave
(
user
:
User
):
void
;
}
server/game/WordGuessingGame.ts
0 → 100644
View file @
c0ef384
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."
);
}
}
server/room/Room.ts
View file @
c0ef384
...
...
@@ -15,7 +15,7 @@ export class Room {
public
name
:
string
;
public
readonly
maxUsers
:
number
;
p
rivate
users
:
User
[]
=
[];
p
ublic
users
:
User
[]
=
[];
private
closed
:
boolean
=
false
;
...
...
Please
register
or
login
to post a comment