示例#1
0
    /// <summary>
    /// 判断能否吸收连接房间
    /// </summary>
    private static bool CheckCanPutRoom(List <Int2> OldList, List <Int2> NewList)
    {
        if (OldList == null || NewList == null)
        {
            return(false);
        }
        if (OldList.Count != NewList.Count)
        {
            return(false);
        }

        for (int i = 0; i < OldList.Count; i++)
        {
            RoomGrid oldRoom = FindRoomGrid(OldList[i], XYSYS.RoomGrid);
            RoomGrid NRoom   = FindRoomGrid(NewList[i], XYSYS.RoomGrid);
            if (oldRoom == null || NRoom == null)
            {
                return(false);
            }
            if (m_PutRoom.Contains(NRoom) == true)
            {
                if (!OldList.Contains(NewList[i]))
                {
                    return(false);
                }
                else
                {
                    continue;
                }
            }

            if (oldRoom.CheckRoomGridPosition(NRoom.GetRoomPosition()) == false)
            {
                return(false);
            }
        }
        return(true);
    }