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

@Component({
  selector: 'md2-mob-def-info',
  templateUrl: './mob-def-info.component.html',
  styleUrls: ['./mob-def-info.component.scss']
})
export class MobDefInfoComponent 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.BeenAttacked:
      case MobDlgType.PreView:
      case MobDlgType.Spawn:
      case MobDlgType.Dashboard:
        this.display = true;
        break;
      default:
        this.display = false;
        break;
    }
    if (!this.mob.defenseInfo || this.mob.defenseInfo.blue == 0 && this.mob.defenseInfo.black == 0) {
      this.display = false;
    }
  }

}
