using JetBrains.Annotations;
using System;
using UnityEngine;

public class ChildModelBehaviour : ModelBehaviour
{
    public ChildModel childModel
    { 
        get
        {
            if (model == null)
            {
                return null;
            }
            if (model is ChildModel cModel)
            {
                return cModel;
            }
            throw new InvalidCastException("ChildModelBehaviour needs to be of type ChildModel");
        }
        internal set
        {
            model = value;
        }
    }

    public void UpdateModel(ChildModel model)
    {
        base.UpdateModel(model);
    }
}