/// <summary> /// Registers a new AMQP object control reference with the controller. /// </summary> /// <param name="objRef">The object control reference to register.</param> public void RegisterObject(AmqpObjectControlReference objRef) { if (objRef == null) { throw new System.ArgumentNullException("objRef"); } // Ensure this reference has been filled out properly if (string.IsNullOrEmpty(objRef.AmqpId)) { Debug.LogWarningFormat("AMQP Control Object Reference is missing its ID: {0}", objRef.name); return; } // Add new if (!objectsById.ContainsKey(objRef.AmqpId)) { objectsById.Add(objRef.AmqpId, objRef); } // Replace, but warn else { Debug.LogWarningFormat("AMQP Control Object Reference with ID has already been registered: {0}", objRef.AmqpId); objectsById[objRef.AmqpId] = objRef; } if (DebugLogMessages) { Debug.LogFormat("AMQP Control Object registered with ID {0} => {1}", objRef.AmqpId, objRef.name); } }
/// <summary> /// unregisters an existing AMQP object control reference from the controller. /// </summary> /// <param name="objRef">The object control reference to unregister.</param> public void UnregisterObject(AmqpObjectControlReference objRef) { if (objRef == null) { throw new System.ArgumentNullException("objRef"); } // Ensure this reference has been filled out properly if (string.IsNullOrEmpty(objRef.AmqpId)) { Debug.LogWarningFormat("AMQP Control Object Reference is missing its ID: {0}", objRef.name); return; } if (objectsById.ContainsKey(objRef.AmqpId)) { objectsById.Remove(objRef.AmqpId); if (DebugLogMessages) { Debug.LogFormat("AMQP Control Object Reference unregistere {0}", objRef.AmqpId); } } }