HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help optimizing

08-21-2009, 02:25 PM#1
Silvenon
Ok, I made a struct for creating trackables. I believe it's pretty inefficiently made, but I did my best. It uses ABC, but I want it to use Tables instead, but I'm not so good with them (I tried a few times). I think everything here is pretty much self-explanatory, so I hope you'll be able to help me.

This "int" argument in the Code function interface means that the function passed to OnTrack and OnHit functions also take "int" and that is actually the Trackable struct, which is later converted with Trackable(int) typecasting.

Any help will be much appreciated.

Expand JASS:
08-24-2009, 05:18 PM#2
Silvenon
C'mon, the code is not that big. Please? :D
08-24-2009, 05:46 PM#3
Rising_Dusk
I'm not sure I really understand what you're asking anyone to do. All you do is a bunch of struct maneuvering and interfacing, there's not exactly much optimization to be had. If your problem is with your using ABC instead of table, table's documentation explains better than anyone else how to use it.

Just replace your call SetTriggerStructA(this.tt, this) calls with set MyTable[GetHandleId(this.tt)] = this, while defining appropriate variables. Voillah, easy. You can also use handletables if you want with set MyHandleTable[this.tt] = this.
08-25-2009, 11:15 AM#4
Silvenon
I was asking for a better solution than that bunch of struct maneuvering and interfacing, because it looks pretty sloppy. And yeah, I wanted to replace ABC with Tables. Yeah, you're right, I just read my post and I realized I barely said anything about what I want at all.

Ok, I got the Tables, the only problem now is that maneuvering :D