aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/ClientManager.cs
blob: 03ad22610de338ad1179dad8b3af5945f2ae4434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;

namespace OpenSim.Framework
{
    public delegate void ForEachClientDelegate( IClientAPI client );
    public class ClientManager
    {
        private Dictionary<uint, IClientAPI> m_clients;
                
        public void ForEachClient(ForEachClientDelegate whatToDo)
        {
            foreach (IClientAPI client in m_clients.Values)
            {
                whatToDo(client);
            }
        }
        
        public ClientManager()
        {
            m_clients = new Dictionary<uint, IClientAPI>();
        }

        public void Add(uint id, IClientAPI client )
        {
            m_clients.Add( id, client );
        }
    }
}