import { Controller } from "./AbstractController";
import "../model/AbstractModel"
import "../model/UserModel"
import "../view/AbstractView"
import "../view/UserView"
import { Model } from "../model/AbstractModel";
import { View } from "../view/AbstractView";
import { ChatMessageViewModel } from "../viewmodel/ChatMessageViewModel";
import { ChatModel } from "../model/ChatModel";
import { ChatView } from "../view/ChatView";

export class ChatController {
    private _model: ChatModel;
    private _view: ChatView;


    constructor(model: ChatModel, view: ChatView) {
        this._model = model;
        this._view = view;
    }


    /**
     * eventHandler
     */
    public eventHandler(vm: ChatMessageViewModel[]): void {
        this._model.someBusinessMethod(vm);
    }

    public test(): void {
        const chatMessageViewModels: ChatMessageViewModel[] = [];
        let chatMessageViewModelMock = new ChatMessageViewModel();
        chatMessageViewModelMock.fromUser = "user1";
        chatMessageViewModelMock.toUser = "user2";
        chatMessageViewModelMock.message = "";
        chatMessageViewModelMock.messageTime = new Date();
        chatMessageViewModels.push(chatMessageViewModelMock);
    }


}