import { inject, Injectable } from "@angular/core";
import { MatDialog, MatDialogRef } from "@angular/material/dialog";
import { PlanetDialogComponent } from "../components/dialog/planet-dialog/planet-dialog.component";
import { Planet } from "../model/planet.model";
import { Ship } from "../model/ships/ship.model";

@Injectable({
  providedIn: 'root',
})
export class GameService {
  public showPlanetInfo: Planet | undefined;
  public showShipInfo: Ship | undefined;

  public ships: Ship[] = [];
  public planets: Planet[] = [];

  constructor() {}

  showDialog(planet: Planet) {
    this.showPlanetInfo = planet;
  }

  showShip(ship: Ship) {
    this.showShipInfo = ship;
  }

  get canDrag(): boolean {
    return this.showShipInfo == undefined && this.showPlanetInfo == undefined;
  }
}