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

public enum PlantLineType
{
    Top = 0,
    Center = 1,
    Bottom = 2
}
public class PlantLine : MonoBehaviour
{
    [SerializeField] private TextMeshPro board;
    [SerializeField] private PlantLineType lineName;
    [SerializeField] private List<CornSeedling> seedlings = new List<CornSeedling>();
    public PlantLineType LineName => lineName;
    public List<CornSeedling> Seedlings => seedlings;
    private readonly string boardFormat = "x{0}";

    public void SetFieldLevel(CornFieldRank rank)
    {
        switch (rank)
        {
            case CornFieldRank.Rank1:
                board.text = string.Format(boardFormat, 1);
                break;
            case CornFieldRank.Rank2:
                board.text = string.Format(boardFormat, 2);
                break;
            case CornFieldRank.Rank3:
                board.text = string.Format(boardFormat, 3);
                break;
            default:
                throw new ArgumentOutOfRangeException(nameof(rank), rank, null);
        }
    }
}
