Ejemplo n.º 1
0
 void Start()
 {
     this.InnerPreStart();
     if (!this._time_simulation_manager)
     {
         this._time_simulation_manager = FindObjectOfType <NeodroidManager>();
     }
     if (!this._objective_function)
     {
         this._objective_function = FindObjectOfType <ObjectiveFunction>();
     }
     this._time_simulation_manager = NeodroidUtilities.MaybeRegisterComponent(
         this._time_simulation_manager,
         (NeodroidEnvironment)this);
     this.SaveInitialPoses();
     this.StartCoroutine(this.SaveInitialBodiesIE());
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        /// <summary>
        ///
        /// </summary>
        protected override void Setup()
        {
            this._grid = new int[this._width, this._height];

            var k = 0;

            for (var i = 0; i < this._width; i++)
            {
                for (var j = 0; j < this._height; j++)
                {
                    this._grid[i, j] = k++;
                }
            }

            this._time_simulation_manager = (IManager)NeodroidUtilities.MaybeRegisterComponent(
                (NeodroidManager)this._time_simulation_manager,
                this);
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 protected override void RegisterComponent()
 {
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterComponent(
         (PrototypingEnvironment)this.ParentEnvironment,
         (Configurable)this);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         (PrototypingEnvironment)this.ParentEnvironment,
         (Configurable)this,
         this._x);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         (PrototypingEnvironment)this.ParentEnvironment,
         (Configurable)this,
         this._y);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         (PrototypingEnvironment)this.ParentEnvironment,
         (Configurable)this,
         this._z);
 }
Ejemplo n.º 4
0
 protected override void AddToEnvironment()
 {
     this._x = this.ConfigurableIdentifier + "X";
     this._y = this.ConfigurableIdentifier + "Y";
     this._z = this.ConfigurableIdentifier + "Z";
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterComponent(
         this.ParentEnvironment,
         (ConfigurableGameObject)this);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         this.ParentEnvironment,
         (ConfigurableGameObject)this,
         this._x);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         this.ParentEnvironment,
         (ConfigurableGameObject)this,
         this._y);
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterNamedComponent(
         this.ParentEnvironment,
         (ConfigurableGameObject)this,
         this._z);
 }
Ejemplo n.º 5
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        protected override void RegisterComponent()
        {
            this.ParentActor = NeodroidUtilities.MaybeRegisterNamedComponent(
                (Actor)this.ParentActor,
                (Motor)this,
                this._movement);
            this.ParentActor = NeodroidUtilities.MaybeRegisterNamedComponent(
                (Actor)this.ParentActor,
                (Motor)this,
                this._turn);

            this._parent_environment = NeodroidUtilities.MaybeRegisterComponent(
                (PrototypingEnvironment)this._parent_environment,
                this);

            if (this._parent_environment != null)
            {
                this._parent_environment.PreStepEvent  += this.PreStep;
                this._parent_environment.StepEvent     += this.Step;
                this._parent_environment.PostStepEvent += this.PostStep;
            }
        }
Ejemplo n.º 6
0
        public override void RegisterComponent()
        {
            this.ParentActor = NeodroidUtilities.MaybeRegisterComponent(this.ParentActor, (Motor)this);

            this._x          = this.MotorIdentifier + "X";
            this._y          = this.MotorIdentifier + "Y";
            this._z          = this.MotorIdentifier + "Z";
            this._rot_x      = this.MotorIdentifier + "RotX";
            this._rot_y      = this.MotorIdentifier + "RotY";
            this._rot_z      = this.MotorIdentifier + "RotZ";
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._x);
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._y);
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._z);
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._rot_x);
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._rot_y);
            this.ParentActor =
                NeodroidUtilities.MaybeRegisterNamedComponent(this.ParentActor, (Motor)this, this._rot_z);
        }
Ejemplo n.º 7
0
 public virtual void RegisterComponent()
 {
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterComponent(this.ParentEnvironment, this);
 }
Ejemplo n.º 8
0
 public virtual void RegisterComponent()
 {
     this._actor = NeodroidUtilities.MaybeRegisterComponent(this._actor, this);
 }
Ejemplo n.º 9
0
 protected virtual void RegisterComponent()
 {
     this._environment = NeodroidUtilities.MaybeRegisterComponent(this._environment, this);
 }
Ejemplo n.º 10
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 protected override void RegisterComponent()
 {
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterComponent(
         (PrototypingEnvironment)this.ParentEnvironment,
         this);
 }
Ejemplo n.º 11
0
 protected virtual void AddToEnvironment()
 {
     this.ParentEnvironment = NeodroidUtilities.MaybeRegisterComponent(this.ParentEnvironment, this);
 }
Ejemplo n.º 12
0
 /// <inheritdoc />
 /// <summary>
 /// </summary>
 protected override void RegisterComponent()
 {
     this._objective_function = NeodroidUtilities.MaybeRegisterComponent(this._objective_function, this);
 }