You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
994 B
38 lines
994 B
4 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public static class Lobby
|
||
|
{
|
||
|
//大厅中的房间列表
|
||
|
public static List<Room> roomList = new List<Room>();
|
||
|
//大厅中的用户列表
|
||
|
public static List<UserData> userList = new List<UserData>();
|
||
|
|
||
|
public static void LobbyReset()
|
||
|
{
|
||
|
roomList.Clear();
|
||
|
userList.Clear();
|
||
|
}
|
||
|
//通过ID找到大厅用户列表的该用户
|
||
|
public static UserData GetUserDataById(long Id)
|
||
|
{
|
||
|
for (int i = 0; i < Lobby.userList.Count; i++)
|
||
|
{
|
||
|
if (Lobby.userList[i].UserInfo.Id == Id)
|
||
|
return Lobby.userList[i];
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
//通过ID找到大厅房间列表的该房间
|
||
|
public static Room GetRoomById(int Id)
|
||
|
{
|
||
|
for (int i = 0; i < Lobby.roomList.Count; i++)
|
||
|
{
|
||
|
if (Lobby.roomList[i].Id == Id)
|
||
|
return Lobby.roomList[i];
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|