HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do I get the type of a struct?

01-31-2009, 03:08 PM#1
divo
I have a struct called "area" from which "circle", "rectangle", & "triangle" extend.
My search function takes an area as argument but how can I check which kind of area it has been given?

I'm looking for something like:
getType(struct)

Or maybe:
struct.type
01-31-2009, 03:18 PM#2
Vexorian
I think it is like .getTypeId() should be in the manual.
01-31-2009, 03:22 PM#3
divo
Cheers but getType() only works for structs that extend an interface. Right now I'm just extending area with an empty interface as a workaround.
01-31-2009, 03:31 PM#4
Vexorian
Yes, it is all right that vJass forces you to use an interface when your design seems to be polymorphism-based.