| 63 | } |
| 64 | /** @category Multiplayer */ |
| 65 | export class MessagesList implements IMessagesList { |
| 66 | private readonly data: IMessageData[] = []; |
| 67 | private readonly messageName: string; |
| 68 | |
| 69 | constructor(messageName: string) { |
| 70 | this.messageName = messageName; |
| 71 | } |
| 72 | |
| 73 | public getName(): string { |
| 74 | return this.messageName; |
| 75 | } |
| 76 | |
| 77 | public getMessages(): IMessageData[] { |
| 78 | return this.data; |
| 79 | } |
| 80 | |
| 81 | public pushMessage(data: object, sender: string): void { |
| 82 | this.data.push(new MessageData(data, sender)); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * The peer to peer configuration. |
nothing calls this directly
no outgoing calls
no test coverage detected