您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

54 行
1.5 KiB

using System.Collections.Generic;
namespace LobbyRelaySample
{
public enum LobbyServiceState
{
Empty,
Fetching,
Error,
Fetched
}
/// <summary>
/// Holds the latest service data, such as the list of rooms
/// </summary>
[System.Serializable]
public class LobbyServiceData : Observed<LobbyServiceData>
{
LobbyServiceState m_CurrentState = LobbyServiceState.Empty;
public long lastErrorCode;
public LobbyServiceState State
{
get { return m_CurrentState; }
set
{
m_CurrentState = value;
OnChanged(this);
}
}
Dictionary<string, LobbyData> m_currentLobbies = new Dictionary<string, LobbyData>();
/// <summary>
/// Will only trigger if the dictionary is set wholesale. Changes in the size, or contents will not trigger OnChanged
/// string is lobby ID, Key is the Lobby data representation of it
/// </summary>
public Dictionary<string, LobbyData> CurrentLobbies
{
get { return m_currentLobbies; }
set
{
m_currentLobbies = value;
OnChanged(this);
}
}
public override void CopyObserved(LobbyServiceData oldObserved)
{
m_currentLobbies = oldObserved.CurrentLobbies;
OnChanged(this);
}
}
}