using Darkmatter.Core;
using UnityEngine;

namespace Darkmatter.Domain
{
    public class FirstPlatformRule : IPlatformRule
    {
        public void Execute(IPlatform platform)
        {
            foreach (var piece in platform.platformPiece)
            {
                piece.gameObject.SetActive(true);
                piece.GetComponent<Renderer>().material = platform.safeMaterial;
                piece.tag = "Safe";
            }
            platform.platformPiece[Random.Range(1, platform.platformPiece.Count)].gameObject.SetActive(false);
        }
    }
}
