tooltiperror
Super Moderator
- Reaction score
- 231
Today I got thinking. It would be logical to make structs in vanilla JASS.
Think of a struct, what is it but a number? Then you use the number, or the name of the object, to reference arrays. So let's say we have two real arrays.
Then we have a global integer array: the struct. Let's call it [ljass]udg_structCount[/ljass], for example. Then we could just create make a simple function, or we could even just instruct people to set variables at the end of their functions.
Or, we could even set the global count to an integer, to give the struct a name. We would need to revise the above function to return an integer.
Now, to make it even more complicated and interesting, we could use hashtables instead to save a value as a key or something like that, and with a more simple syntax and a cleaner interface, this could be a complete system for vanilla JASSers to use structs, and we could make it easily customizable.
Thoughts?
Edit: I call it SugarStructs, or SuStruct for short, or even SS.
EditEdit: Another thought, what about using a key from a hashtable instead of recycling a global variable?
Think of a struct, what is it but a number? Then you use the number, or the name of the object, to reference arrays. So let's say we have two real arrays.
Then we have a global integer array: the struct. Let's call it [ljass]udg_structCount[/ljass], for example. Then we could just create make a simple function, or we could even just instruct people to set variables at the end of their functions.
JASS:
Or, we could even set the global count to an integer, to give the struct a name. We would need to revise the above function to return an integer.
JASS:
JASS:
Now, to make it even more complicated and interesting, we could use hashtables instead to save a value as a key or something like that, and with a more simple syntax and a cleaner interface, this could be a complete system for vanilla JASSers to use structs, and we could make it easily customizable.
Thoughts?
Edit: I call it SugarStructs, or SuStruct for short, or even SS.
EditEdit: Another thought, what about using a key from a hashtable instead of recycling a global variable?