using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BattleControllerPrototype : MonoBehaviour {
    [SerializeField] ShipPrototype[] ships = new ShipPrototype[2];
    public int currentShipId = 0;

    public ShipPrototype CurrentShip {
        get {
            return ships[currentShipId];
        }
    }

    private void Start() {
        foreach (var ship in ships) {
            ship.Init(this);
            ship.UpdateParams();
        }
        CurrentShip.StartTurn();
    }

    public void MakeTurn() {
        CurrentShip.EndTurn();
        var oldShwipName = CurrentShip.name;
        currentShipId += 1;
        if (currentShipId >= ships.Length) {
            currentShipId = 0;
        }
        Debug.Log(oldShwipName + "end turn" + CurrentShip.shipName + " Start turn");
        CurrentShip.StartTurn();
    }
}
