/// <summary>
 /// Initializes a new instance of the DecomposeAgent class.
 /// </summary>
 public DeconstructAgentCollectionComponent()
   : base(RS.deconstructQNName, RS.deconstructQNNickname,
       RS.deconstructQNDescription,
       RS.pluginCategoryName, RS.utilitySubcategoryName, RS.icon_deconstructAC, RS.desconstructQNGuid)
 {
   agentCollection = new SpatialCollectionType();
 }
 protected override bool GetInputs(IGH_DataAccess da)
 {
   if (!base.GetInputs(da)) return false;
   SpatialCollectionType neighborsCollection = new SpatialCollectionType();
   if (!da.GetData(nextInputIndex++, ref neighborsCollection)) return false;
   neighbors = neighborsCollection.Quelea;
   return true;
 }
Esempio n. 3
0
    private SpatialCollectionType GetNeighbors()
    {
      neighbors = new SpatialCollectionAsList<IQuelea>();
      wrappedPositions = new List<Point3d>();
      if (agent.VisionRadius > 0)
      {
        if (agent.Environment.Wrap)
        {
          neighbors = GetNeighborsWrapped();
        }
        else
        {
          neighbors = queleaNetwork.Quelea.GetNeighborsInSphere(agent, agent.VisionRadius * visionRadiusMultiplier);

          if (visionAngleMultiplier < 1.0)
          {
            neighbors = GetNeighborsInVisionAngle(neighbors);
          }
        }
      }
      SpatialCollectionType neighborsType = new SpatialCollectionType(neighbors);
      neighborsType.WrappedPositions = wrappedPositions;
      return neighborsType;
    }