using System;
using UnityEngine;

public class CornSkin : MonoBehaviour
{
    [SerializeField] private SpriteRenderer spriteRenderer;
    [SerializeField] private Sprite cornSeedSprite;
    [SerializeField] private Sprite cornSimpleSprite;
    [SerializeField] private Sprite cornBurntSprite;
    
    public void ChangeSkin(CornCondition condition)
    {
        switch (condition)
        {
            case CornCondition.Seed:
                spriteRenderer.sprite = cornSeedSprite;
                break;
            case CornCondition.Simple:
                spriteRenderer.sprite = cornSimpleSprite;
                break;
            case CornCondition.Burnt:
                spriteRenderer.sprite = cornBurntSprite;
                break;
            default:
                throw new ArgumentOutOfRangeException(nameof(condition), condition, null);
        }
    }
}
