/// <inheritdoc/>
        public override void CreateBehaviors(ISimulation simulation)
        {
            var behaviors = new BehaviorContainer(Name);
            var context   = new ComponentBindingContext(this, simulation, behaviors);

            behaviors.Build(simulation, context)
            .AddIfNo <ITimeBehavior>(context => new Time(context))
            .AddIfNo <IFrequencyBehavior>(context => new Frequency(context))
            .AddIfNo <IBiasingBehavior>(context => new Biasing(context));
            simulation.EntityBehaviors.Add(behaviors);
        }
コード例 #2
0
        /// <summary>
        /// Creates the behaviors for the specified simulation and registers them with the simulation.
        /// </summary>
        /// <param name="simulation">The simulation.</param>
        public override void CreateBehaviors(ISimulation simulation)
        {
            var behaviors = new BehaviorContainer(Name);
            var context   = new ComponentBindingContext(this, simulation, behaviors);

            if (simulation.UsesBehaviors <IBiasingBehavior>())
            {
                behaviors.Add(new BiasingBehavior(Name, context));
            }
            simulation.EntityBehaviors.Add(behaviors);
        }