File size: 587 Bytes
defab59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using Fusion;

public static class DinoSessionCache
{
    static readonly List<SessionInfo> sessions = new List<SessionInfo>();

    public static IReadOnlyList<SessionInfo> Sessions => sessions;

    public static event Action<IReadOnlyList<SessionInfo>> OnUpdated;

    public static void SetSessions(IList<SessionInfo> list)
    {
        sessions.Clear();
        if (list != null)
        {
            for (int i = 0; i < list.Count; i++)
                sessions.Add(list[i]);
        }
        OnUpdated?.Invoke(Sessions);
    }
}