Agent.Components.DebugDeconstructAgent.SolveInstance C# (CSharp) Method

SolveInstance() protected method

This is the method that actually does the work.
protected SolveInstance ( IGH_DataAccess DA ) : void
DA IGH_DataAccess The DA object is used to retrieve from inputs and store in outputs.
return void
    protected override void SolveInstance(IGH_DataAccess DA)
    {
      // First, we need to retrieve all data from the input parameters.
      // We'll start by declaring variables and assigning them starting values.
      AgentType agent = new AgentType();

      // Then we need to access the input parameters individually. 
      // When data cannot be extracted from a parameter, we should abort this method.
      if (!DA.GetData(0, ref agent)) return;

      // We should now validate the data and warn the user if invalid data is supplied.

      // We're set to create the output now. To keep the size of the SolveInstance() method small, 
      // The actual functionality will be in a different method:

      // Finally assign the spiral to the output parameter.
      DA.SetData(0, agent.Position);
      DA.SetData(1, agent.Velocity);
      DA.SetData(2, agent.Acceleration);
      DA.SetData(3, agent.Lifespan);
      DA.SetData(4, agent.RefPosition);
    }