From 717433c9c5d1e756965f4d5591c2d606786361e1 Mon Sep 17 00:00:00 2001 From: "Alecio Furanze (Ale)" Date: Thu, 27 Jun 2024 12:06:26 +0200 Subject: [PATCH] update MapContainer to MapDescriptor --- src/http/partials/Server/Map.cs | 34 +++------------------------------ 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/src/http/partials/Server/Map.cs b/src/http/partials/Server/Map.cs index 252bd7f8..0b42fe1b 100644 --- a/src/http/partials/Server/Map.cs +++ b/src/http/partials/Server/Map.cs @@ -11,14 +11,14 @@ internal class Map : IHTTP.Map { internal const string ALL_MEHOD = "*"; - public readonly List m_mapList; + public readonly List m_mapList; public readonly Server m_server; public Map(Server server) { m_server = server; - m_mapList = new List(); + m_mapList = new List(); } public void WebSocket(string path, Action callback) @@ -159,7 +159,7 @@ private void Add if (Path.IsValid(path)) { - var map = new MapContainer + var map = new MapDescriptor ( path, Path.IsParamPath(path), @@ -171,34 +171,6 @@ private void Add m_mapList.Add(map); } } - - internal struct MapContainer - { - public bool UseParams { get; } - public string Path { get; } - public string Method { get; } - public bool IsWebsocket { get; } - public Action HttpCallback { get; } - public Action WebsocketCallback { get; } - - public MapContainer - ( - string path, - bool useParams, - string method, - bool isWebsocket, - Action httpCallback, - Action websocketCallback - ) - { - Path = path; - UseParams = useParams; - Method = method; - IsWebsocket = isWebsocket; - HttpCallback = httpCallback; - WebsocketCallback = websocketCallback; - } - } } } } \ No newline at end of file