Handling abstract variables

Forums 💬 NodeCanvas ⚙️ Support Handling abstract variables

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19674
    grofit
    Participant

      So in my current situation I use a 3rd party library which has some abstract classes and the functions return back the abstract class so you do not know if you are getting one of the various implementations of that abstract class.

      So for example they may pass back the abstract class Vehicle, but the underlying object may be a car or a plane, however I do not really care as all I want to do is call the shared abstract variables on there.

      So when I was trying this and I used dynamic vars (as the var types were not showing up as mentioned in other thread) it gave me the error saying “No VariableData of name ‘_someVehicle’ and type ‘Car’ exists. Adding new instead…” even though the method called was returning a Vehicle, not a Car…

      So is there a way to handle this scenario, as it is pretty much just like using interfaces although its a concrete class type?

      Should I add a BBCar, BBBoat, BBPlane and a BBVehicle and just use the latter throughout, as it will know about the types for the actual implementations or do I NEED to be explicit with the variable type?

      #19676
      Gavalakis
      Keymaster

        I will look into abstract handling and get back to you here with a nice answer 🙂

        #19675
        grofit
        Participant

          Thank you kindly 🙂

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