| 05-28-2009, 07:23 AM | #1 |
Right now I have a global that has a size of 8191 for all recipe types in my recipe system. It works well and such but I thought of improving it to have a global for each recipe type but it would break my MUI structs. Does anybody has a clue on how to do that? |
| 05-28-2009, 08:36 AM | #2 |
It took me a while to figure out, but he's saying he has this: JASS:globals boolean array Combined endglobals struct Recipe //... endstruct JASS:globals endglobals struct Recipe boolean array Combined[8191] endstruct The only way I can think of doing it easily is this: JASS:struct Recipe Table CombinedT method operator Combined takes integer J returns boolean return CombinedT[J] == 1 endmethod method operator Combined= takes integer J, boolean V returns nothing if V then set CombinedT[J] = 1 endif set CombinedT[J] = 0 endmethod static method create takes nothing returns nothing set CombinedT = Table.create() endmethod endstruct |
| 05-28-2009, 01:01 PM | #3 |
how about an static array? |
| 05-28-2009, 01:58 PM | #4 | |
Quote:
|
| 05-28-2009, 02:12 PM | #5 |
Got this solved thanks to pyrogasm. |
