public static NetworkData Parse(byte[] data) { NetworkCode code = (NetworkCode)BitConverter.ToInt32(data, 4); NetworkData nd = null; byte[] d = new byte[data.Length - 8]; Buffer.BlockCopy(data, 8, d, 0, data.Length - 8); nd = NetworkDataTypes.GetT(code)?.ParseData(d); if (nd is null) { Console.WriteLine($"Uncategorized net code {code}"); } return(nd); }
private static void Add(NetworkData t, NetworkCode code) { codeToType.Add(code, t); }