- import { World } from "./World";
+ import { World, ConnectCallback, DisconnectCallback } from "./World";
import { UserInterface } from "./UserInterface";
import {PositionInterface} from "_Model/PositionInterface";
+import {uuid} from "uuidv4";
export class Group {
static readonly MAX_PER_GROUP = 4;
+ private id: string;
private users: UserInterface[];
- private connectCallback: (user1: string, user2: string, group: Group) => void;
- private disconnectCallback: (user1: string, user2: string, group: Group) => void;
+ private connectCallback: ConnectCallback;
+ private disconnectCallback: DisconnectCallback;
- constructor(users: UserInterface[],
- connectCallback: (user1: string, user2: string, group: Group) => void,
- disconnectCallback: (user1: string, user2: string, group: Group) => void
- ) {
+ constructor(users: UserInterface[], connectCallback: ConnectCallback, disconnectCallback: DisconnectCallback) {
this.users = [];
this.connectCallback = connectCallback;
this.disconnectCallback = disconnectCallback;