New List Nodes

FlowCanvas Forums Support New List Nodes

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1219
    chocolacode
    Participant

    Hey Gavalakis,

    I am trying to create some nodes in FC for some List<T> methods, however I get stuck,

    Can you please help to create some nodes for me: 🙂

    RemoveAll(Predicate<T>)
    Sort(Comparison<T>)
    FindAll(Predicate<T>):List<T>
    FindLast(Predicate<T>):T
    LastIndexOf(T):Int

    Thanks much in advance!!

    #1220
    ktysdal
    Participant

    Hi chocolacode, I’m going to try to answer this since it relates a bit to a question I asked a little while back.
    If you make a list variable and then use it as a starting point to drag from the output, then you should see a list<Object> menu with all the nodes you need for that type.

    You can see my original question here:
    https://flowcanvas.paradoxnotion.com/topic/finding-object-in-a-list/
    Gavalakis explained it well in that post.

    Hope that helps.

    Attachments:
    You must be logged in to view attached files.
    #1223
    chocolacode
    Participant

    Hi ktysdal,

    that is perfect!! Thanks for that!

    now I need to figure out a way to create a type for the Predicate<T> and for the Comparison<T> so I can use them in the nodes I want. I have tried to add a Predicate Type and I find no way to do that…

    One of my current challenges is that I have a List of Floats(approx 500 entries or could be more), I want a way to remove some of these entries by providing a search expression. I know that I can do a for loop to accomplish the same… but that will not be efficient. That is why I want to use the RemoveAll(Predicate<T>) . Now I can select that node, but I am stuck with the Predicate<T> type 🙁

    If you can provide some help on that I will really appreciate..
    Thanks !!

    #1229
    chocolacode
    Participant

    Hey Ktysdal, Gavalakis,

    Do you have any answer to my
    Question above?

    Thanks!!

    #1230
    Gavalakis
    Keymaster

    Hey,

    A Predicate is a delegate, which basically a delegate is a pointer to a function. Unfortunately though, I would not recommend working with delegates in FlowCanvas because things can become very complicated quickly, since within FlowCanvas, support for assigning a method to a delegate is not supported (at least right now).

    For what you are after, I would either recommend the typical for-loop approach, or even the creation of a custom node [LINK] that takes a list, processes it as you desire, and finally returns the processed list as an output.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    #1231
    chocolacode
    Participant

    Hi Gavalakis,

    Thanks for your answer!!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.