示例#1
0
        /// <summary>
        /// 往接收端中添加发送端信息
        /// </summary>
        /// <param name="send"></param>
        public void AddReceiveDistanced(DistanceData send)
        {
            if (Distanced == null)
            {
                Distanced = new List <DistanceData>();
            }

            //移除正在交互的
            if (Distanceing.Contains(send))
            {
                Distanceing.Remove(send);
            }

            if (Distanced.Contains(send))
            {
                return;
            }

            Distanced.Add(send);

            if (maxCount == -1)
            {
                return;
            }

            maxCount--;
        }
        /// <summary>
        /// 往接收端中添加发送端信息
        /// </summary>
        /// <param name="send"></param>
        public void AddReceiveDistanced(DistanceInteraction send)
        {
            if (Distanced == null)
            {
                Distanced = new List <DistanceInteraction>();
            }

            //移除正在交互的
            if (Distancing.Contains(send))
            {
                Distancing.Remove(send);
            }

            if (Distanced.Contains(send))
            {
                return;
            }

            Distanced.Add(send);

            if (distanceData.maxCount == -1)
            {
                return;
            }

            distanceData.maxCount--;
        }