TList Question

BlitzMax Forums/BlitzMax Beginners Area/TList Question

Chroma(Posted 2009) [#1]
Opinions on whether this is possible? Can't test atm.

Type TBlah
     Field BlahList:TList

     Method Something()
          BlahList.SomethingElse()
     End Method

     Method SomethingElse()
          'do stuff to the BlahList
     End Method
End Type






Chroma(Posted 2009) [#2]
Hmm...actually...woundn't this cycle through every TYang in the YangList through the .Render() without having to do a For/Next loop? Again, not at home so I can't test it.


Type TYin
   Field YangList:TList = New TList

   Method Render()
      TYang(YangList).Render()
   End Method
End Type

Type TYang
   Field image:TImage
   Field x#, y#

   Method Render()
      DrawImage image, x, y
   End Method
End Type



Chroma(Posted 2009) [#3]
...


Warpy(Posted 2009) [#4]
nope. You're trying to cast a TList to a TYang, which if it worked would just give you one object, not perform the operation on every object in the list. It doesn't work anyway, because TList doesn't extend TYang.


Chroma(Posted 2009) [#5]
Yeah I tried it when I went home for lunch. Thanks for the explanation.