import { Component, Input, OnInit } from '@angular/core';
import { MD2Icon, MobDlgType, MobInfo, MobType } from '../../../massive-darkness2.model';

@Component({
  selector: 'md2-mob-attack-info',
  templateUrl: './mob-attack-info.component.html',
  styleUrls: ['./mob-attack-info.component.scss']
})
export class MobAttackInfoComponent implements OnInit {

  MD2Icon = MD2Icon;
  private _mob: MobInfo;
  public get mob(): MobInfo {
    return this._mob;
  }

  @Input() public set mob(v: MobInfo) {
    if (this._mob != v) {
      this._mob = v;

    }
  }
  @Input() mode: MobDlgType = MobDlgType.PreView;

  display: boolean = false;

  constructor() { }
  ngOnInit(): void {
    switch (this.mode) {
      case MobDlgType.Spawn:
        this.display = this.mob.type != MobType.Mob;
        break;
      case MobDlgType.Activating:
      case MobDlgType.PreView:
      case MobDlgType.Dashboard:
        this.display = true;
        break;
      default:
        this.display = false;
        break;
    }
  }

}
