using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Simple3.RCS;
using Simple3.RCS.CarTypes;
using SimpleCore.PropType;

namespace StandardScene.ChargeStationType
{
    public class AbstractChargeStation
    {
        public bool IsSafe = true;
        public int SiteId { get; set; }

        public string Ip { get; set; }
        public int Port { get; set; }
        public string CommunicationType { get; set; }
        
        /// <summary>
        /// 关闭当前通讯连接
        /// </summary>
        public virtual void CloseCommunication()
        {
            // 默认实现为空，子类可重写
        }

        /// <summary>
        /// 创建通讯连接
        /// </summary>
        public virtual void CreateCommunication(IPAddress ip, int port)
        {

        }

        public virtual void SendToChargeStation(int isCharge,Car car,Site site)
        {}

        /// <summary>
        /// UDP 报文回调钩子：默认空实现，具体桩型按需重写。
        /// 用于解耦 ChargeUdpService 对具体充电桩类型的 is 判断，便于驱动外移至卫星 dll。
        /// </summary>
        public virtual void OnUdpMessage(byte[] message)
        {
        }
    }
}
