namespace ChillConnect
{
    public abstract class BaseUICtrl : BaseCtrl
    {
        public virtual uint GetOpenUIMsg(string uiName)
        {
            return 0;
        }

        public virtual uint GetCloseUIMsg(string uiName)
        {
            return 0;
        }

        public void DispatchCloseUI(string uiName = null, object args = null)
        {
            uint msgId = GetCloseUIMsg(uiName);
            if (msgId == 0)
            {
                CloseUI(args);
                return;
            }

            if (uiCtrlDispatcher != null)
            {
                uiCtrlDispatcher.Dispatch(msgId, args);
            }
        }

        public abstract void OpenUI(object args = null);
        public abstract void CloseUI(object args = null);
    }
}