import { ControllerDeviceType } from "../device/ControllerDeviceType";
import { AccountVO } from "./AccountVO";

export class LoginUserVO {
    userId: number;
    accessToken: string;
    account: AccountVO
    controllerDeviceType: ControllerDeviceType;
    guid: string;
    loginTime: number;

    constructor() {
        this.userId = -1;
        this.accessToken = "";
        this.account = new AccountVO();
        this.guid = "";
        this.controllerDeviceType = ControllerDeviceType.Android;
        this.loginTime = 0;
    }

    equals(o: any): boolean {
        return o instanceof LoginUserVO &&
        this.guid === o.guid &&
        this.controllerDeviceType === o.controllerDeviceType &&
        this.userId === o.userId &&
        this.accessToken === o.accessToken &&
        this.account === o.account &&
        this.loginTime === o.loginTime;
    }

    toString(): string {
        return `LoginUserVO{` +
          `userId=${this.userId}, ` +
          `accessToken='${this.accessToken}', ` +
          `account='${this.account}', ` +
          `guid='${this.guid}, '` +
          `controllerDeviceType=${ControllerDeviceType[this.controllerDeviceType]}, ` +
          `loginTime='${this.loginTime}'` +
          `}`;
    }

}