public ModelTypeInfo(Type consumerType, ReadSource source, Type modelType, Type responseType = null) { ConsumerType = consumerType; ModelType = modelType; Source = source; ResponseType = responseType; }
private void Init() { nglobal = Instance; DontDestroyOnLoad(this.gameObject); readSource = ReadSource.Instance; //poolManager = PoolManager.Instance; }
/// <summary> /// Finds target for consumer and model /// </summary> private Tuple <string, ushort> GetTarget(ReadSource source, TypeDeliveryDescriptor consumerDescriptor, TypeDeliveryDescriptor modelDescriptor) { ushort contentType = 0; string target = null; if (source == ReadSource.Queue) { if (consumerDescriptor.HasQueueName) { target = consumerDescriptor.QueueName; } else if (modelDescriptor.HasQueueName) { target = modelDescriptor.QueueName; } } else { if (consumerDescriptor.HasContentType) { contentType = consumerDescriptor.ContentType ?? 0; } else if (modelDescriptor.HasContentType) { contentType = modelDescriptor.ContentType ?? 0; } if (consumerDescriptor.HasDirectReceiver) { target = consumerDescriptor.DirectTarget; } else if (modelDescriptor.HasDirectReceiver) { target = modelDescriptor.DirectTarget; } } if (source == ReadSource.Queue && string.IsNullOrEmpty(target)) { target = modelDescriptor.QueueName; } return(new Tuple <string, ushort>(target, contentType)); }