| 04-09-2007, 05:27 PM | #1 |
Trying to learn struct and the new jass language extension. Reading the doc, but found something, not sure if it's me tat is wrong or its Vex who did a typo. Since im new so i can't be sure. JASS:struct encap real a=0.0 private real b=0.0 public real c=4.5 private method dosomething takes nothing returns nothing if (this.a==5) then set this.a=56 endif endmethod static method altcreate takes real a, real b, real c returns encap local encap r=encap.create() set r.a=a set r.b=b set r.c=c call r.dosomething() //even though it is private you can use //it since we are inside the struct declaration return r endmethod method randomize takes nothing returns nothing // All legal: set this.a= GetRandomReal(0,45.0) set this.b= GetRandomReal(0,45.0) set this.c= GetRandomReal(0,45.0) endmethod endstruct function test takes nothing returns nothing local encap e=encap.dosomething(5,12.4,78.0) //!!!!shouldn't this be = local encap e=encap.altcreate(5,12.4,78.0)? call BJDebugMsg(R2S(e.a)+" , "+R2S(e.c)) endfunction |
| 04-09-2007, 05:37 PM | #2 |
yes, its a typo. |
| 04-09-2007, 06:10 PM | #3 |
No, it's not a typo. It's a mistake. They are different concepts. |
| 04-09-2007, 07:35 PM | #4 |
They are different concepts thus this is a typo because I didn't intend to type dosomething so I typed something I didn't mean to type then it is typo. |
| 04-09-2007, 07:37 PM | #5 |
Omg stop defining typos or not. Thanks to infrane, not to the rest |
