示例#1
0
        private void InstallServiceBrowserDestinations(ServiceDefinition service, AdapterDefinition adapter)
        {
            //ServiceBrowser destinations
            DestinationDefinition destination = new DestinationDefinition(service);

            destination.Id = DestinationDefinition.FluorineServiceBrowserDestination;
            destination.Properties.Source = DestinationDefinition.FluorineServiceBrowserDestination;
            destination.AdapterRef        = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination    = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineManagementDestination;
            destination.Properties.Source = DestinationDefinition.FluorineManagementDestination;
            destination.AdapterRef        = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination    = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineCodeGeneratorDestination;
            destination.Properties.Source = DestinationDefinition.FluorineCodeGeneratorDestination;
            destination.AdapterRef        = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination    = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineSqlServiceDestination;
            destination.Properties.Source = DestinationDefinition.FluorineSqlServiceDestination;
            destination.AdapterRef        = new AdapterRef(adapter);
            service.AddDestination(destination);
        }
示例#2
0
        /// <summary>
        /// Creates a destination with the specified settings.
        /// </summary>
        /// <param name="destinationDefinition">Destination settings.</param>
        /// <param name="adapterDefinition">Adapter settings.</param>
        /// <returns>The created destination instance.</returns>
        public virtual Destination CreateDestination(DestinationDefinition destinationDefinition, AdapterDefinition adapterDefinition)
        {
            lock (_objLock)
            {
                if (!_destinations.ContainsKey(destinationDefinition.Id))
                {
                    Destination destination = NewDestination(destinationDefinition);
                    destination.Init(adapterDefinition);

                    /*
                     * if (destinationDefinition.Adapter != null)
                     *  destination.Init(destinationSettings.Adapter);
                     *                  else
                     *  destination.Init(_serviceSettings.DefaultAdapter);
                     */
                    _destinations[destination.Id] = destination;

                    string source = destination.DestinationDefinition.Properties.Source;
                    //TODO: warn if more then one "*" source occurs.
                    if (source != null && source == "*")
                    {
                        _defaultDestination = destination;
                    }
                    return(destination);
                }
                else
                {
                    return(_destinations[destinationDefinition.Id] as Destination);
                }
            }
        }
示例#3
0
        private static DestinationDetails generateDestinationDetails(DestinationDefinition destinationDefinition)
        {
            //currently only allowing planets with normal atmospheric environment to have a governing race
            if (destinationDefinition.environmentState == DestinationDefinition.EnvironmentState.NORMAL)
            {
                //load the destination profile into a text object
                TextAsset destinationProfileJson = Resources.Load <TextAsset>(destinationsProfileFilePath);

                //deserialize the destination profile json into an object
                DestinationProfile destinationProfile = JsonConvert.DeserializeObject <DestinationProfile>(destinationProfileJson.text);

                //check if destination is occupied
                if (((WeightedBool)WeightedValueSelector.selectValue(destinationProfile.occupyingRaceWeights)).value)
                {
                    //randomly select an environment type for the destination
                    RaceDefinitions.Race race = ((WeightedRace)WeightedValueSelector.selectValue(destinationProfile.raceWeights)).value;

                    return(new DestinationDetails(destinationDefinition, race));
                }
            }

            //new destination without occupying race
            return(new DestinationDetails(destinationDefinition, RaceDefinitions.Race.NONE));
        }
示例#4
0
 protected override Destination NewDestination(DestinationDefinition destinationDefinition)
 {
     return(new MessageDestination(this, destinationDefinition));
 }
 public DataDestination(IService service, DestinationDefinition destinationDefinition)
     : base(service, destinationDefinition)
 {
     _sequenceManager = new SequenceManager(this);
 }
示例#6
0
 internal Destination(IService service, DestinationDefinition destinationDefinition)
 {
     _service = service;
     _destinationDefinition = destinationDefinition;
     _initialized           = false;
 }
示例#7
0
 public MessageDestination(IService service, DestinationDefinition destinationDefinition)
     : base(service, destinationDefinition)
 {
     _subscriptionManager = new SubscriptionManager(this);
 }
示例#8
0
 /// <summary>
 /// Creates a new Destination.
 /// </summary>
 /// <param name="destinationDefinition">Destination settings.</param>
 /// <returns>The new Destination instance.</returns>
 protected virtual Destination NewDestination(DestinationDefinition destinationDefinition)
 {
     return(new Destination(this, destinationDefinition));
 }
 /// <summary>
 /// Initializes a new instance of the RemotingDestination class.
 /// </summary>
 /// <param name="service">Service.</param>
 /// <param name="destinationDefinition">Destination definition.</param>
 public RemotingDestination(IService service, DestinationDefinition destinationDefinition)
     : base(service, destinationDefinition)
 {
 }
 internal void SetDestinationSettings(DestinationDefinition value)
 {
     _destinationDefinition = value;
 }
示例#11
0
        protected override Destination NewDestination(DestinationDefinition destinationDefinition)
        {
            RemotingDestination remotingDestination = new RemotingDestination(this, destinationDefinition);

            return(remotingDestination);
        }