BIG WIP of refactoring my work in TS
This commit is contained in:
parent
af5d2a5a97
commit
fbfc208129
12 changed files with 274 additions and 11 deletions
18
back/src/Model/Group.ts
Normal file
18
back/src/Model/Group.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import {MessageUserPosition} from "./Websocket/MessageUserPosition";
|
||||
export class Group {
|
||||
static readonly MAX_PER_GROUP = 4;
|
||||
|
||||
users: MessageUserPosition[];
|
||||
|
||||
constructor(users: MessageUserPosition[]) {
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
getUsers(): MessageUserPosition[] {
|
||||
return this.users;
|
||||
}
|
||||
|
||||
isFull(): boolean {
|
||||
return this.users.length >= Group.MAX_PER_GROUP;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue