using System.Collections.Generic; namespace LobbyRelaySample { public enum LobbyServiceState { Empty, Fetching, Error, Fetched } /// /// Holds data related to the Lobby service itself - The latest retrieved lobby list, the state of retrieval. /// [System.Serializable] public class LobbyServiceData : Observed { LobbyServiceState m_CurrentState = LobbyServiceState.Empty; public long lastErrorCode; public LobbyServiceState State { get { return m_CurrentState; } set { m_CurrentState = value; OnChanged(this); } } Dictionary m_currentLobbies = new Dictionary(); /// /// 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 /// public Dictionary CurrentLobbies { get { return m_currentLobbies; } set { m_currentLobbies = value; OnChanged(this); } } public override void CopyObserved(LobbyServiceData oldObserved) { m_currentLobbies = oldObserved.CurrentLobbies; OnChanged(this); } } }