aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/ClientManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/ClientManager.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/ClientManager.cs b/OpenSim/Framework/General/ClientManager.cs
new file mode 100644
index 0000000..b560ca8
--- /dev/null
+++ b/OpenSim/Framework/General/ClientManager.cs
@@ -0,0 +1,36 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Interfaces;
5
6namespace OpenSim.Framework
7{
8 public delegate void ForEachClientDelegate( IClientAPI client );
9 public class ClientManager
10 {
11 private Dictionary<uint, IClientAPI> m_clients;
12
13 public void ForEachClient(ForEachClientDelegate whatToDo)
14 {
15 foreach (IClientAPI client in m_clients.Values)
16 {
17 whatToDo(client);
18 }
19 }
20
21 public ClientManager()
22 {
23 m_clients = new Dictionary<uint, IClientAPI>();
24 }
25
26 public void Remove(uint id)
27 {
28 m_clients.Remove(id);
29 }
30
31 public void Add(uint id, IClientAPI client )
32 {
33 m_clients.Add( id, client );
34 }
35 }
36}