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

namespace Onward.CustomContent.Assets
{
    public class GM_Operations_Hunt : GM_Base
    {
        [Header("Objectives")]
        public ObjectiveOpHunt[] Objectives;

        public GM_Operations_Hunt()
           : base(GM_Base.EGameModeType.Operations_Hunt)
        {
        }

        void Start()
        {
            Util.EnforceSingleInstance<GM_Operations_Hunt>();
        }

        public override void Validate()
        {
            base.Validate();

            ValidateObjectiveEntries(ref Objectives);

            if (Objectives.Length <= 0)
            {
                throw new ContentExceptionWithGameObject(gameObject, "Op. Hunt requires at least one objective.");
            }

            if (GameObject.FindObjectOfType<GM_Operations_Evac>() == null)
            {
                throw new ContentExceptionWithGameObject(gameObject, "For Operations support Evac and Hunt are required. Please add missing Evac gamemode.");
            }
        }
    }
}