/// <summary> /// Function that binds a function to a type in the callback-register. /// </summary> /// <param name="_type">Type of the ProtocolObject</param> /// <param name="_callback">Callback function that expects a JSON string</param> public static void RegisterIntercomCallback(EProtocolObjectType _type, System.Action <ProtocolObject> _callback) { if (s_intercomCallbacks.ContainsKey(_type)) { throw new System.ArgumentException("_type provided is invalid" + "as a callback has already been registered for it."); } s_intercomCallbacks.Add(_type, _callback); }
public ProtocolObject(EProtocolObjectType _type) { Type = _type; }